module: put disko scripts in system.build for better reference

This commit is contained in:
lassulus 2022-11-23 13:29:51 +01:00
parent 9cf4f170ae
commit 7a4c85b53e

View file

@ -36,6 +36,21 @@ in {
'')
]) ++ lib.optionals cfg.enableConfig (types.diskoLib.packages cfg.devices pkgs);
system.build.formatScript = pkgs.writers.writeDash "disko-create" ''
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
${types.diskoLib.create cfg.devices}
'';
system.build.mountScript = pkgs.writers.writeDash "disko-mount" ''
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
${types.diskoLib.mount cfg.devices}
'';
system.build.disko = pkgs.writers.writeDash "disko" ''
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
${types.diskoLib.zapCreateMount cfg.devices}
'';
# Remember to add config keys here if they are added to types
fileSystems = lib.mkIf cfg.enableConfig (lib.mkMerge (lib.catAttrs "fileSystems" (types.diskoLib.config cfg.devices)));
boot = lib.mkIf cfg.enableConfig (lib.mkMerge (lib.catAttrs "boot" (types.diskoLib.config cfg.devices)));