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;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
pathsToLink = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
|
|
@ -13,22 +18,28 @@
|
|||
pathDir = "/run/system-manager/sw";
|
||||
in
|
||||
{
|
||||
environment.etc = {
|
||||
"profile.d/system-manager-path.sh".source =
|
||||
pkgs.writeText "system-manager-path.sh" ''
|
||||
export PATH=${pathDir}/bin/:''${PATH}
|
||||
'';
|
||||
environment = {
|
||||
pathsToLink = [
|
||||
"/bin"
|
||||
];
|
||||
|
||||
# TODO: figure out how to properly add fish support. We could start by
|
||||
# looking at what NixOS and HM do to set up the fish env.
|
||||
#"fish/conf.d/system-manager-path.fish".source =
|
||||
# pkgs.writeTextFile {
|
||||
# name = "system-manager-path.fish";
|
||||
# executable = true;
|
||||
# text = ''
|
||||
# set -gx PATH "${pathDir}/bin/" $PATH
|
||||
# '';
|
||||
# };
|
||||
etc = {
|
||||
"profile.d/system-manager-path.sh".source =
|
||||
pkgs.writeText "system-manager-path.sh" ''
|
||||
export PATH=${pathDir}/bin/:''${PATH}
|
||||
'';
|
||||
|
||||
# TODO: figure out how to properly add fish support. We could start by
|
||||
# looking at what NixOS and HM do to set up the fish env.
|
||||
#"fish/conf.d/system-manager-path.fish".source =
|
||||
# pkgs.writeTextFile {
|
||||
# name = "system-manager-path.fish";
|
||||
# executable = true;
|
||||
# text = ''
|
||||
# set -gx PATH "${pathDir}/bin/" $PATH
|
||||
# '';
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.system-manager-path = {
|
||||
|
|
@ -44,7 +55,7 @@
|
|||
pathDrv = pkgs.buildEnv {
|
||||
name = "system-manager-path";
|
||||
paths = config.environment.systemPackages;
|
||||
pathsToLink = [ "/bin" ];
|
||||
inherit (config.environment) pathsToLink;
|
||||
};
|
||||
in
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue