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";