mirror of
https://github.com/nix-community/disko.git
synced 2024-09-11 06:25:33 +03:00
drop environment.systemPackages
Those packages are only used for installation and are not used afterwards. system.build outputs can be used to get them in an installer included.
This commit is contained in:
parent
6c3e0d22e4
commit
67f991e2bc
18
module.nix
18
module.nix
@ -16,26 +16,8 @@ in {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
addScripts = lib.mkOption {
|
||||
description = ''
|
||||
add disko-create and disko-mount scripts to systemPackages.
|
||||
'';
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
environment.systemPackages = (lib.optionals cfg.addScripts [
|
||||
(pkgs.writers.writeDashBin "disko-create" ''
|
||||
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
|
||||
${types.diskoLib.create cfg.devices}
|
||||
'')
|
||||
(pkgs.writers.writeDashBin "disko-mount" ''
|
||||
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
|
||||
${types.diskoLib.mount cfg.devices}
|
||||
'')
|
||||
]) ++ 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}
|
||||
|
@ -33,7 +33,6 @@
|
||||
(lib.optionalAttrs (testMode == "module") {
|
||||
imports = [ ../module.nix ];
|
||||
disko = {
|
||||
addScripts = false;
|
||||
enableConfig = true;
|
||||
devices = import disko-config { inherit disks lib; };
|
||||
};
|
||||
@ -76,7 +75,6 @@
|
||||
(lib.optionalAttrs (testMode == "module") {
|
||||
imports = [ ../module.nix ];
|
||||
disko = {
|
||||
addScripts = true;
|
||||
enableConfig = false;
|
||||
devices = import disko-config { disks = builtins.tail disks; inherit lib; };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user