Skip to content

Commit 51e0f8f

Browse files
committedMay 12, 2017
Merge branch 'master' into staging
Some more larger rebuilds from master.
2 parents fc873b6 + e256655 commit 51e0f8f

File tree

85 files changed

+3467
-1058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3467
-1058
lines changed
 

‎nixos/modules/module-list.nix

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
./security/wrappers/default.nix
131131
./security/sudo.nix
132132
./services/admin/salt/master.nix
133+
./services/admin/salt/minion.nix
133134
./services/amqp/activemq/default.nix
134135
./services/amqp/rabbitmq.nix
135136
./services/audio/alsa.nix

‎nixos/modules/programs/fish.nix

+74-9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,30 @@ in
2727
'';
2828
type = types.bool;
2929
};
30+
31+
vendor.config.enable = mkOption {
32+
type = types.bool;
33+
default = true;
34+
description = ''
35+
Whether fish should source configuration snippets provided by other packages.
36+
'';
37+
};
38+
39+
vendor.completions.enable = mkOption {
40+
type = types.bool;
41+
default = true;
42+
description = ''
43+
Whether fish should use completion files provided by other packages.
44+
'';
45+
};
46+
47+
vendor.functions.enable = mkOption {
48+
type = types.bool;
49+
default = true;
50+
description = ''
51+
Whether fish should autoload fish functions provided by other packages.
52+
'';
53+
};
3054

3155
shellAliases = mkOption {
3256
default = config.environment.shellAliases;
@@ -79,31 +103,72 @@ in
79103
environment.etc."fish/foreign-env/loginShellInit".text = cfge.loginShellInit;
80104
environment.etc."fish/foreign-env/interactiveShellInit".text = cfge.interactiveShellInit;
81105

106+
environment.etc."fish/nixos-env-preinit.fish".text = ''
107+
# avoid clobbering the environment if it's been set by a parent shell
108+
109+
# This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently
110+
# unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish
111+
set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $__fish_datadir/functions
112+
113+
# source the NixOS environment config
114+
fenv source ${config.system.build.setEnvironment}
115+
116+
# clear fish_function_path so that it will be correctly set when we return to $__fish_datadir/config.fish
117+
set -e fish_function_path
118+
'';
119+
82120
environment.etc."fish/config.fish".text = ''
83121
# /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically.
84122
85-
set fish_function_path $fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
86-
87-
fenv source ${config.system.build.setEnvironment} > /dev/null ^&1
88-
fenv source /etc/fish/foreign-env/shellInit > /dev/null
123+
# if our parent shell didn't source the general config, do it
124+
if not set -q __fish_nixos_general_config_sourced
125+
set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
126+
fenv source /etc/fish/foreign-env/shellInit > /dev/null
127+
set -e fish_function_path[1]
128+
129+
${cfg.shellInit}
89130
90-
${cfg.shellInit}
131+
# and leave a note to our children to spare them the same work
132+
set -gx __fish_nixos_general_config_sourced 1
133+
end
91134
92-
if status --is-login
135+
# if our parent shell didn't source the login config, do it
136+
status --is-login; and not set -q __fish_nixos_login_config_sourced
137+
and begin
138+
set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
93139
fenv source /etc/fish/foreign-env/loginShellInit > /dev/null
140+
set -e fish_function_path[1]
141+
94142
${cfg.loginShellInit}
143+
144+
# and leave a note to our children to spare them the same work
145+
set -gx __fish_nixos_login_config_sourced 1
95146
end
96147
97-
if status --is-interactive
148+
# if our parent shell didn't source the interactive config, do it
149+
status --is-interactive; and not set -q __fish_nixos_interactive_config_sourced
150+
and begin
98151
${fishAliases}
152+
153+
154+
set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
99155
fenv source /etc/fish/foreign-env/interactiveShellInit > /dev/null
156+
set -e fish_function_path[1]
157+
158+
${cfg.promptInit}
100159
${cfg.interactiveShellInit}
160+
161+
# and leave a note to our children to spare them the same work
162+
set -gx __fish_nixos_interactive_config_sourced 1
101163
end
102164
'';
103165

104166
# include programs that bring their own completions
105-
environment.pathsToLink = [ "/share/fish/vendor_completions.d" ];
106-
167+
environment.pathsToLink = []
168+
++ optional cfg.vendor.config.enable "/share/fish/vendor_conf.d"
169+
++ optional cfg.vendor.completions.enable "/share/fish/vendor_completions.d"
170+
++ optional cfg.vendor.functions.enable "/share/fish/vendor_functions.d";
171+
107172
environment.systemPackages = [ pkgs.fish ];
108173

109174
environment.shells = [

0 commit comments

Comments
 (0)
Please sign in to comment.