chore: nix fmt

This commit is contained in:
Rasyidan Akbar F. 2025-10-01 13:39:08 +07:00
commit 423907b530

View file

@ -16,30 +16,31 @@ let
lib.unique [ homebrewBin homebrewSbin ] lib.unique [ homebrewBin homebrewSbin ]
else else
[ ]; [ ];
formatPathList = paths: lib.concatMapStrings (path: " \"${path}\"\n") paths; formatPathList = paths:
lib.concatMapStrings (path: " \"${path}\"\n") paths;
in { in {
programs.nushell.enable = lib.mkDefault true; programs.nushell.enable = lib.mkDefault true;
programs.nushell.envFile.text = '' programs.nushell.envFile.text = ''
let nix_paths = [ let nix_paths = [
${formatPathList [ profileBin systemBin defaultBin ]} ] ${formatPathList [ profileBin systemBin defaultBin ]} ]
let homebrew_paths = [ let homebrew_paths = [
${formatPathList homebrewPaths} ] ${formatPathList homebrewPaths} ]
let path_candidates = ($nix_paths | append $homebrew_paths | flatten) let path_candidates = ($nix_paths | append $homebrew_paths | flatten)
if ($env.PATH? == null) { if ($env.PATH? == null) {
$env.PATH = $path_candidates $env.PATH = $path_candidates
} else { } else {
for path in $path_candidates { for path in $path_candidates {
if not ($env.PATH | any {|it| $it == $path}) { if not ($env.PATH | any {|it| $it == $path}) {
$env.PATH = ($env.PATH | append $path) $env.PATH = ($env.PATH | append $path)
}
}
} }
}
}
$env.NIX_PROFILES = "/run/current-system/sw ${config.home.profileDirectory}" $env.NIX_PROFILES = "/run/current-system/sw ${config.home.profileDirectory}"
''; '';
programs.oh-my-posh = { programs.oh-my-posh = {