la génération de configuration se fait avec un script au lieu d'un Makefile
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
all:
|
|
||||||
nixos-generate-config --root /mnt
|
|
||||||
git config --global user.email "nixos-live@example.org"
|
|
||||||
git config --global user.name "NixOS Live"
|
|
||||||
cd /mnt/etc/nixos && git init . && git add . && git commit -m "initial commit"
|
|
||||||
cd /mnt/etc/nixos && git submodule add http://gogs.prunetwork.fr:80/nixos-config/nixos-template-base.git base
|
|
||||||
cd /mnt/etc/nixos && git submodule add https://gogs.prunetwork.fr/Capgemini-CDS-Arkea/template-nixos.git capgemini-cmb
|
|
||||||
14
generate-config.sh
Normal file
14
generate-config.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Génération de la configuration par l'outil NixOS
|
||||||
|
nixos-generate-config --root /mnt
|
||||||
|
# Configuration de Git
|
||||||
|
git config --global user.email "nixos-live@example.org"
|
||||||
|
git config --global user.name "NixOS Live"
|
||||||
|
# Initialisation du dépôt de la machine et ajout des templates de configuration
|
||||||
|
cd /mnt/etc/nixos
|
||||||
|
git init .
|
||||||
|
git add .
|
||||||
|
git commit -m "initial commit"
|
||||||
|
git submodule add https://gogs.prunetwork.fr/nixos-config/nixos-template-base.git base
|
||||||
|
git submodule add https://gogs.prunetwork.fr/Capgemini-CDS-Arkea/template-nixos.git capgemini-cmb
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
custom-generator = "generate-config.sh";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
capgemini-cmb/default.nix
|
capgemini-cmb/default.nix
|
||||||
@@ -14,10 +16,10 @@
|
|||||||
# Files to copy to the liveCD
|
# Files to copy to the liveCD
|
||||||
isoImage.contents = [
|
isoImage.contents = [
|
||||||
{
|
{
|
||||||
source = ./Makefile.installation;
|
source = "./${custom-generator}";
|
||||||
target = "/custom/Makefile";
|
target = "/custom/${custom-generator}";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
environment.shellAliases = { nixos-generate-custom-config = "cd /iso/custom/ && make";};
|
environment.shellAliases = { nixos-generate-custom-config = "/iso/custom/${custom-generator}";};
|
||||||
networking.hostName = "nixos-livecd.corp.capgemini.com";
|
networking.hostName = "nixos-livecd.corp.capgemini.com";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user