File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
profiles/homeProfiles/shells/nushell Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 8
8
inherit ( config . home ) username sessionVariables ;
9
9
l = flake . inputs . nixpkgs . lib // builtins ;
10
10
11
- # FIXME: hardcoded
11
+ exaCfg = config . programs . exa ;
12
+
13
+ # FIXME: hardcoded -- note also that we can't rely on variable expansion to resolve paths in env.nu
12
14
userConfigDir = "~/.config/dotfield/users/${ username } /config/nushell" ;
13
15
14
16
/*
17
+ @partial
15
18
replaceVars :: [String] -> (String -> String)
16
19
*/
17
20
replaceVars = names :
18
21
l . replaceStrings
19
22
( l . map ( v : "$" + v ) names )
20
23
( l . map ( v : "$env.${ v } " ) names ) ;
21
24
25
+ /*
26
+ replaceVars' :: String -> String
27
+ */
28
+ replaceVars' = replaceVars commonNames ;
29
+
22
30
commonNames = [
23
31
"HOME"
24
32
"EDITOR"
37
45
lib . concatStringsSep "\n "
38
46
( lib . mapAttrsToList
39
47
( name : value : let
40
- value' = replaceVars commonNames value ;
48
+ value' = replaceVars' value ;
41
49
in "$env.${ name } = `${ value' } `" )
42
50
attrs ) ;
43
51
in {
63
71
xdg . configFile . "nushell/home.nu" . source = pkgs . writeText "home.nu" ''
64
72
${ attrsToEnvDecls sessionVariables }
65
73
'' ;
74
+
75
+ # FIXME: needs PR to upstream `exa` module for fix to use
76
+ # `home.shellAliases`, not shell-specific options
77
+ home . shellAliases = lib . mkIf ( exaCfg . enable && exaCfg . enableAliases ) {
78
+ ls = "exa" ;
79
+ ll = "exa -l" ;
80
+ la = "exa -a" ;
81
+ lt = "exa --tree" ;
82
+ lla = "exa -la" ;
83
+ } ;
66
84
}
You can’t perform that action at this time.
0 commit comments