mirror of
https://github.com/ryanccn/flake.git
synced 2026-01-26 19:56:29 +01:00
feat(fish): proper PATH initialization
This commit is contained in:
parent
ea378cf3af
commit
1833524619
6 changed files with 76 additions and 181 deletions
22
modules/fish.nix
Normal file
22
modules/fish.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-2272570087
|
||||
programs.fish.loginShellInit =
|
||||
let
|
||||
dquote = str: "\"" + str + "\"";
|
||||
|
||||
profiles = [
|
||||
"/etc/profiles/per-user/$USER" # home-manager profile
|
||||
"$HOME/.nix-profile" # non-XDG home profile
|
||||
"$(set -q XDG_STATE_HOME; and echo \"$XDG_STATE_HOME\"; or echo \"$HOME/.local/state\")/nix/profile" # XDG home profile
|
||||
"/run/current-system/sw" # nix-darwin system profile
|
||||
"/nix/var/nix/profiles/default" # system profile
|
||||
];
|
||||
|
||||
makeBinSearchPath = lib.concatMapStringsSep " " (path: (dquote "${path}/bin"));
|
||||
in
|
||||
''
|
||||
fish_add_path --move --prepend --path ${makeBinSearchPath profiles}
|
||||
set fish_user_paths $fish_user_paths
|
||||
'';
|
||||
}
|
||||
|
|
@ -16,8 +16,14 @@
|
|||
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs.outPath}" ];
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nix/issues/7273
|
||||
auto-optimise-store = !pkgs.stdenv.isDarwin;
|
||||
|
||||
extra-platforms = [
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
|
|
@ -28,9 +34,8 @@
|
|||
sandbox = true;
|
||||
use-xdg-base-directories = true;
|
||||
|
||||
extra-substituters = [ "https://cache.lix.systems" ];
|
||||
|
||||
extra-trusted-public-keys = [ "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" ];
|
||||
extra-substituters = [ ];
|
||||
extra-trusted-public-keys = [ ];
|
||||
|
||||
nix-path = config.nix.nixPath;
|
||||
};
|
||||
|
|
@ -41,7 +46,6 @@
|
|||
inputs.am.overlays.default
|
||||
inputs.nish.overlays.default
|
||||
inputs.nrr.overlays.default
|
||||
inputs.choirpack.overlays.default
|
||||
inputs.nyoom.overlays.default
|
||||
self.overlays.ryan-mono-bin
|
||||
self.overlays.ibm-plex
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue