diff options
| -rw-r--r-- | modules/environment/default.nix | 5 | ||||
| -rw-r--r-- | modules/launchd/default.nix | 11 | ||||
| -rw-r--r-- | modules/services/khd.nix | 3 |
3 files changed, 11 insertions, 8 deletions
diff --git a/modules/environment/default.nix b/modules/environment/default.nix index 80dc394..f982b25 100644 --- a/modules/environment/default.nix +++ b/modules/environment/default.nix @@ -32,8 +32,7 @@ in { }; environment.systemPath = mkOption { - type = types.loeOf types.path; - default = cfg.profiles ++ [ "/usr/local" "/usr" "" ]; + type = types.loeOf types.str; description = "The set of paths that are added to PATH."; apply = x: if isList x then makeBinPath x else x; }; @@ -113,6 +112,8 @@ in { config = { + environment.systemPath = cfg.profiles ++ [ "/usr/local" "/usr" "" ]; + environment.profiles = [ # Use user, default and system profiles. "$HOME/.nix-profile" diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix index 16e761c..078bfff 100644 --- a/modules/launchd/default.nix +++ b/modules/launchd/default.nix @@ -14,6 +14,8 @@ let launchdConfig = import ./launchd.nix; + makeDrvBinPath = ps: concatMapStringsSep ":" (p: if isDerivation p then "${p}/bin" else p) ps; + serviceOptions = { config, name, ... }: let @@ -33,15 +35,14 @@ let }; path = mkOption { - type = types.listOf types.path; + type = types.loeOf (types.either types.path types.str); default = []; - apply = ps: "${makeBinPath ps}"; description = '' Packages added to the service's <envar>PATH</envar> - environment variable. Both the <filename>bin</filename> - and <filename>sbin</filename> subdirectories of each - package are added. + environment variable. Only the <filename>bin</filename> + and subdirectories of each package is added. ''; + apply = ps: if isList ps then (makeDrvBinPath ps) else ps; }; command = mkOption { diff --git a/modules/services/khd.nix b/modules/services/khd.nix index 140460b..f308736 100644 --- a/modules/services/khd.nix +++ b/modules/services/khd.nix @@ -21,6 +21,7 @@ in package = mkOption { type = types.path; default = pkgs.khd; + defaultText = "pkgs.khd"; description = "This option specifies the khd package to use."; }; @@ -30,7 +31,7 @@ in config = mkIf cfg.enable { launchd.user.agents.khd = { - path = [ cfg.package pkgs.kwm "${config.environment.systemPath}:" ]; + path = [ cfg.package pkgs.kwm config.environment.systemPath ]; serviceConfig.Program = "${cfg.package}/bin/khd"; serviceConfig.KeepAlive = true; serviceConfig.ProcessType = "Interactive"; |
