iso: Make a script for iso generation

This commit is contained in:
Tom Hubrecht 2023-06-07 14:13:36 +02:00
parent 857c1bb88e
commit c21e8669c6
5 changed files with 46 additions and 0 deletions

5
iso/build-iso.sh Normal file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
NIXPKGS=$(nix-build nixpkgs.nix)
nixos-generate -c configuration.nix -I NIX_PATH="$NIXPKGS" -f install-iso

32
iso/configuration.nix Normal file
View file

@ -0,0 +1,32 @@
{ pkgs, ... }:
let
dgn-lib = import ../lib/trivial.nix;
dgn-members = (import ../meta).members.groups.iso;
in
{
boot = {
blacklistedKernelModules = [ "snd_pcsp" ];
kernelPackages = pkgs.linuxPackages_6_1;
tmp.cleanOnBoot = true;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
supportedFilesystems = [
"exfat"
"zfs"
];
};
services = {
openssh.enable = true;
};
users.users.root.openssh.authorizedKeys.keyFiles =
builtins.map (m: dgn-lib.mkRel ../keys "${m}.keys") dgn-members;
}

5
iso/nixpkgs.nix Normal file
View file

@ -0,0 +1,5 @@
let
inherit (import ../npins) nixpkgs;
in
(import nixpkgs { }).srcOnly { name = "nixpkgs-for-iso"; src = nixpkgs; }

View file

@ -26,6 +26,9 @@ let
# members of this group are root on web nodes # members of this group are root on web nodes
web = [ "mdebray" "raito" ]; web = [ "mdebray" "raito" ];
# members of this group will have root acces on the installation isos
iso = [ "thubrecht" "mdebray" "raito" ];
}; };
in in

View file

@ -43,6 +43,7 @@ pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
npins npins
colmena colmena
nixos-generators
] ++ (builtins.map (p: callPackage p { }) [ ] ++ (builtins.map (p: callPackage p { }) [
(sources.disko + "/package.nix") (sources.disko + "/package.nix")
]); ]);