From 9e166662e0cfb73429ecebd96769f9f15c2fc318 Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Sun, 27 Jun 2021 07:31:45 +0000 Subject: [PATCH 1/3] localBinInPath: Initial commit --- nixos/modules/config/shells-environment.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix index a0a20228a742..c0306bd03b64 100644 --- a/nixos/modules/config/shells-environment.nix +++ b/nixos/modules/config/shells-environment.nix @@ -126,6 +126,14 @@ in type = types.bool; }; + environment.localBinInPath = mkOption { + description = '' + Include ~/.local/bin/ in $PATH. + ''; + default = false; + type = types.bool; + }; + environment.binsh = mkOption { default = "${config.system.build.binsh}/bin/sh"; defaultText = "\${config.system.build.binsh}/bin/sh"; @@ -198,6 +206,11 @@ in # ~/bin if it exists overrides other bin directories. export PATH="$HOME/bin:$PATH" ''} + + ${optionalString cfg.localBinInPath '' + # ~/.local/bin if it exists overrides other bin directories. + export PATH="$HOME/.local/bin:$PATH" + ''} ''; system.activationScripts.binsh = stringAfter [ "stdio" ] From 67af267cf7e27c5d2f7ef33a5c9bd02df7bbf11c Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Wed, 30 Jun 2021 21:27:56 +0200 Subject: [PATCH 2/3] Update nixos/modules/config/shells-environment.nix lgtm Co-authored-by: Sandro --- nixos/modules/config/shells-environment.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix index c0306bd03b64..5e5d75a91036 100644 --- a/nixos/modules/config/shells-environment.nix +++ b/nixos/modules/config/shells-environment.nix @@ -128,7 +128,7 @@ in environment.localBinInPath = mkOption { description = '' - Include ~/.local/bin/ in $PATH. + Add ~/.local/bin/ to $PATH ''; default = false; type = types.bool; From 55a211ae3184d105129f00da537c35e14197e300 Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Wed, 30 Jun 2021 21:32:08 +0200 Subject: [PATCH 3/3] Removed wrong comment --- nixos/modules/config/shells-environment.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix index 5e5d75a91036..34e558d8603d 100644 --- a/nixos/modules/config/shells-environment.nix +++ b/nixos/modules/config/shells-environment.nix @@ -208,7 +208,6 @@ in ''} ${optionalString cfg.localBinInPath '' - # ~/.local/bin if it exists overrides other bin directories. export PATH="$HOME/.local/bin:$PATH" ''} '';