fix disko generation

This commit is contained in:
Gerg-L 2023-10-14 17:50:35 -04:00
parent 5a6d712c2e
commit 9a6522d05c
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
4 changed files with 25 additions and 20 deletions

View file

@ -1,7 +1,5 @@
{ disko, ... }: _: {
{ disk.nvme0n1 =
imports = [ disko.nixosModules.disko ];
disko.devices.disk.nvme0n1 =
let let
baseDevice = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; baseDevice = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456";
in in
@ -35,5 +33,4 @@
}; };
}; };
}; };
_file = ./disko.nix;
} }

View file

@ -1,9 +1,6 @@
{ disko, ... }: lib: {
{ lib, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices.disk = disk =
lib.genAttrs lib.genAttrs
[ [
"0E" "0E"
@ -53,8 +50,7 @@
}; };
} }
); );
zpool = {
disko.devices.zpool = {
rpool = { rpool = {
type = "zpool"; type = "zpool";
mode = "mirror"; mode = "mirror";
@ -108,5 +104,4 @@
}; };
}; };
}; };
_file = ./disko.nix;
} }

View file

@ -1,7 +1,5 @@
{ disko, ... }: _: {
{ disk.sda =
imports = [ disko.nixosModules.disko ];
disko.devices.disk.sda =
let let
baseDevice = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144"; baseDevice = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144";
in in
@ -35,5 +33,4 @@
}; };
}; };
}; };
_file = ./disko.nix;
} }

View file

@ -1,4 +1,9 @@
inputs@{ unstable, self, ... }: inputs@{
unstable,
self,
disko,
...
}:
let let
inherit (unstable) lib; inherit (unstable) lib;
@ -62,12 +67,23 @@ in
networking.hostName = name; networking.hostName = name;
nixpkgs.hostPlatform = system; nixpkgs.hostPlatform = system;
}) })
(lib.optionals (self.diskoConfigurations ? "disko-${name}") [
self.diskoConfigurations."disko-${name}"
disko.nixosModules.default
])
]; ];
} }
); );
mkDisko = mkDisko =
names: names:
lib.genAttrs names (name: (import "${self}/hosts/${name}/disko.nix" inputs)); lib.listToAttrs (
map
(name: {
name = "disko-${name}";
value.disko.devices = import "${self}/disko/${name}.nix" lib;
})
names
);
mkPackages = mkPackages =
path: pkgs: path: pkgs: