From a6c0afbf2404d668c4d8aa718ad80329c1a7f974 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Mon, 26 Feb 2024 13:31:57 +0800 Subject: [PATCH] darwin/core: apply fix for $PATH orders --- darwin/profiles/common/core/default.nix | 17 +++++++++++++++++ darwin/profiles/desktop/packages/default.nix | 2 +- .../packages/{core.nix => window-manager.nix} | 11 ----------- 3 files changed, 18 insertions(+), 12 deletions(-) rename darwin/profiles/desktop/packages/{core.nix => window-manager.nix} (77%) diff --git a/darwin/profiles/common/core/default.nix b/darwin/profiles/common/core/default.nix index ec1e996..0b4a08c 100644 --- a/darwin/profiles/common/core/default.nix +++ b/darwin/profiles/common/core/default.nix @@ -1,6 +1,8 @@ { inputs, pkgs, + config, + lib, ... }: { ### Options @@ -31,4 +33,19 @@ useUserPackages = true; extraSpecialArgs = {inherit inputs;}; # ??? isnt specialArgs imported by default ??? }; + + # Create /etc/zshrc that loads the nix-darwin environment. + programs.zsh.enable = true; # default shell on catalina + programs.fish.enable = true; + + # fucking horrible + # https://github.com/LnL7/nix-darwin/issues/122#issuecomment-1659465635 + programs.fish.loginShellInit = let + dquote = str: "\"" + str + "\""; + + makeBinPathList = map (path: path + "/bin"); + in '' + fish_add_path --move --prepend --path ${lib.concatMapStringsSep " " dquote (makeBinPathList config.environment.profiles)} + set fish_user_paths $fish_user_paths + ''; } diff --git a/darwin/profiles/desktop/packages/default.nix b/darwin/profiles/desktop/packages/default.nix index c234462..edeff4c 100644 --- a/darwin/profiles/desktop/packages/default.nix +++ b/darwin/profiles/desktop/packages/default.nix @@ -1,7 +1,7 @@ {...}: { imports = [ - ./core.nix ./fonts.nix ./homebrew.nix + ./window-manager.nix ]; } diff --git a/darwin/profiles/desktop/packages/core.nix b/darwin/profiles/desktop/packages/window-manager.nix similarity index 77% rename from darwin/profiles/desktop/packages/core.nix rename to darwin/profiles/desktop/packages/window-manager.nix index 912483f..df03cf8 100644 --- a/darwin/profiles/desktop/packages/core.nix +++ b/darwin/profiles/desktop/packages/window-manager.nix @@ -1,15 +1,4 @@ {pkgs, ...}: { - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - #environment.systemPackages = with pkgs; [ - # neovim - # vscode - #]; - - # Create /etc/zshrc that loads the nix-darwin environment. - programs.zsh.enable = true; # default shell on catalina - programs.fish.enable = true; - services = { yabai = { enable = true;