mirror of https://github.com/bjeanes/dotfiles.git
Move brew path into home.sessionVariables
Also, instead of checking for both directories each time, just do an architecture check during build and add the path blindly.wip
parent
a97fed5d86
commit
9ccc82c1cc
24
flake.nix
24
flake.nix
|
@ -339,24 +339,22 @@
|
||||||
linux = { };
|
linux = { };
|
||||||
|
|
||||||
# home-manager config specific to Darwin
|
# home-manager config specific to Darwin
|
||||||
darwin = let
|
darwin = { pkgs, ... }: {
|
||||||
addBrewPath = ''
|
|
||||||
# Apple Silicon
|
|
||||||
[ -d /opt/homebrew/bin ] && export PATH="/opt/homebrew/bin:$PATH"
|
|
||||||
[ -d /opt/homebrew/sbin ] && export PATH="/opt/homebrew/sbin:$PATH"
|
|
||||||
|
|
||||||
# Intel
|
|
||||||
[ -d /usr/local/bin ] && export PATH="/usr/local/bin:$PATH"
|
|
||||||
[ -d /usr/local/sbin ] && export PATH="/usr/local/sbin:$PATH"
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
# Yank/paste in Neovim to/from macOS clipboard by default
|
# Yank/paste in Neovim to/from macOS clipboard by default
|
||||||
programs.nixvim.clipboard.register = "unnamedplus";
|
programs.nixvim.clipboard.register = "unnamedplus";
|
||||||
|
|
||||||
programs.git.extraConfig."gpg \"ssh\"".program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
|
programs.git.extraConfig."gpg \"ssh\"".program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
|
||||||
|
|
||||||
programs.bash.initExtra = addBrewPath;
|
home.sessionVariables =
|
||||||
programs.zsh.initExtra = addBrewPath;
|
let
|
||||||
|
brewPrefix =
|
||||||
|
if pkgs.stdenv.hostPlatform.isAarch64
|
||||||
|
then "/opt/homebrew"
|
||||||
|
else "/usr/local";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
PATH = "${brewPrefix}/bin:${brewPrefix}/sbin:$PATH";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue