Add a pathsToLink option.
This commit is contained in:
parent
938a4d0115
commit
7ab72d8c7f
1 changed files with 27 additions and 16 deletions
|
|
@ -6,6 +6,11 @@
|
||||||
type = lib.types.listOf lib.types.package;
|
type = lib.types.listOf lib.types.package;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pathsToLink = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config =
|
||||||
|
|
@ -13,7 +18,12 @@
|
||||||
pathDir = "/run/system-manager/sw";
|
pathDir = "/run/system-manager/sw";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.etc = {
|
environment = {
|
||||||
|
pathsToLink = [
|
||||||
|
"/bin"
|
||||||
|
];
|
||||||
|
|
||||||
|
etc = {
|
||||||
"profile.d/system-manager-path.sh".source =
|
"profile.d/system-manager-path.sh".source =
|
||||||
pkgs.writeText "system-manager-path.sh" ''
|
pkgs.writeText "system-manager-path.sh" ''
|
||||||
export PATH=${pathDir}/bin/:''${PATH}
|
export PATH=${pathDir}/bin/:''${PATH}
|
||||||
|
|
@ -30,6 +40,7 @@
|
||||||
# '';
|
# '';
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.system-manager-path = {
|
systemd.services.system-manager-path = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -44,7 +55,7 @@
|
||||||
pathDrv = pkgs.buildEnv {
|
pathDrv = pkgs.buildEnv {
|
||||||
name = "system-manager-path";
|
name = "system-manager-path";
|
||||||
paths = config.environment.systemPackages;
|
paths = config.environment.systemPackages;
|
||||||
pathsToLink = [ "/bin" ];
|
inherit (config.environment) pathsToLink;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue