From 1dca29b8e4a868a5a5f8878198b07a52ca1e1055 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Wed, 2 Aug 2023 19:54:50 -0500 Subject: [PATCH] fix: (GO)PATH Signed-off-by: jolheiser --- apps/default.nix | 1 + apps/go.nix | 8 +++++++- apps/nushell.nix | 10 +++++++++- apps/nushell/env.nu | 1 - apps/wezterm/wezterm.lua | 2 +- apps/xdg.nix | 9 +++++++++ machines/chai/default.nix | 1 - machines/matcha/default.nix | 1 - 8 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 apps/xdg.nix diff --git a/apps/default.nix b/apps/default.nix index ae864f5..299598b 100644 --- a/apps/default.nix +++ b/apps/default.nix @@ -21,6 +21,7 @@ ./ssh.nix ./tiny.nix ./wezterm.nix + ./xdg.nix ./zoxide.nix ]; home = { diff --git a/apps/go.nix b/apps/go.nix index 8fa1bca..264945e 100644 --- a/apps/go.nix +++ b/apps/go.nix @@ -1 +1,7 @@ -{programs.go.enable = true;} +{config, ...}: { + programs.go = rec { + enable = true; + goPath = "${config.xdg.dataHome}/go"; + goBin = "${goPath}/bin"; + }; +} diff --git a/apps/nushell.nix b/apps/nushell.nix index 60845ab..e03f202 100644 --- a/apps/nushell.nix +++ b/apps/nushell.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + pkgs, + config, + ... +}: { programs.nushell = { enable = true; configFile.source = ./nushell/config.nu; @@ -19,6 +23,10 @@ use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/just/just.nu * use ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/nix/nix-completions.nu * ''; + extraEnv = '' + let-env GOPATH = "${config.xdg.dataHome}/go" + let-env PATH = ($env.PATH | split row (char esep) | prepend '${config.xdg.dataHome}/go/bin') + ''; }; xdg.configFile = { "nushell/jolheiser.nu".source = ./nushell/jolheiser.nu; diff --git a/apps/nushell/env.nu b/apps/nushell/env.nu index 3006c8d..0269f3f 100644 --- a/apps/nushell/env.nu +++ b/apps/nushell/env.nu @@ -60,4 +60,3 @@ let-env NU_PLUGIN_DIRS = [ # To add entries to PATH (on Windows you might use Path), you can use the following pattern: # let-env PATH = ($env.PATH | split row (char esep) | prepend '/some/path') - diff --git a/apps/wezterm/wezterm.lua b/apps/wezterm/wezterm.lua index 25e6431..0ec2d06 100644 --- a/apps/wezterm/wezterm.lua +++ b/apps/wezterm/wezterm.lua @@ -33,7 +33,7 @@ end) -- config return { - default_prog = { "nu", "--config", "~/.config/nushell/config.nu", "--env-config", "~/.config/nushell/config.nu" }, + default_prog = { "nu", "--config", "~/.config/nushell/config.nu", "--env-config", "~/.config/nushell/env.nu" }, color_scheme = theme_for_appearance(wezterm.gui.get_appearance()), window_close_confirmation = 'NeverPrompt', window_background_opacity = opacity, diff --git a/apps/xdg.nix b/apps/xdg.nix new file mode 100644 index 0000000..7f47814 --- /dev/null +++ b/apps/xdg.nix @@ -0,0 +1,9 @@ +{config, ...}: { + xdg = { + enable = true; + userDirs.enable = true; + cacheHome = "${config.home.homeDirectory}/.cache"; + configHome = "${config.home.homeDirectory}/.config"; + dataHome = "${config.home.homeDirectory}/.local/share"; + }; +} diff --git a/machines/chai/default.nix b/machines/chai/default.nix index cd80fd1..bed3cc6 100644 --- a/machines/chai/default.nix +++ b/machines/chai/default.nix @@ -41,7 +41,6 @@ in { users.users."${username}" = { extraGroups = ["wheel" "docker"]; isNormalUser = true; - shell = pkgs.nushell; }; environment.systemPackages = with pkgs; [ diff --git a/machines/matcha/default.nix b/machines/matcha/default.nix index d29994c..6660eec 100644 --- a/machines/matcha/default.nix +++ b/machines/matcha/default.nix @@ -43,7 +43,6 @@ in { users.users."${username}" = { extraGroups = ["wheel" "docker" "storage"]; isNormalUser = true; - shell = pkgs.nushell; }; system.stateVersion = "22.11";