···23in
2425{
0002627 options = {
2829 programs.bash = {
3031- enable = lib.mkOption {
32- default = true;
33- description = ''
34- Whenever to configure Bash as an interactive shell.
35- Note that this tries to make Bash the default
36- {option}`users.defaultUserShell`,
37- which in turn means that you might need to explicitly
38- set this variable if you have another shell configured
39- with NixOS.
40- '';
41- type = lib.types.bool;
42- };
004344 shellAliases = lib.mkOption {
45 default = { };
···124125 };
126127- config = lib.mkIf cfg.enable {
0128129- programs.bash = {
130131- shellAliases = builtins.mapAttrs (name: lib.mkDefault) cfge.shellAliases;
132133- shellInit = ''
134- if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
135- . ${config.system.build.setEnvironment}
136- fi
137138- ${cfge.shellInit}
139- '';
140141- loginShellInit = cfge.loginShellInit;
142143- interactiveShellInit = ''
144- # Check the window size after every command.
145- shopt -s checkwinsize
146147- # Disable hashing (i.e. caching) of command lookups.
148- set +h
149150- ${cfg.promptInit}
151- ${cfg.promptPluginInit}
152- ${bashAliases}
153154- ${cfge.interactiveShellInit}
155- '';
156157- };
158159- environment.etc.profile.text = ''
160- # /etc/profile: DO NOT EDIT -- this file has been generated automatically.
161- # This file is read for login shells.
162163- # Only execute this file once per shell.
164- if [ -n "$__ETC_PROFILE_SOURCED" ]; then return; fi
165- __ETC_PROFILE_SOURCED=1
166167- # Prevent this file from being sourced by interactive non-login child shells.
168- export __ETC_PROFILE_DONE=1
169170- ${cfg.shellInit}
171- ${cfg.loginShellInit}
172173- # Read system-wide modifications.
174- if test -f /etc/profile.local; then
175- . /etc/profile.local
176- fi
177178- if [ -n "''${BASH_VERSION:-}" ]; then
179- . /etc/bashrc
180- fi
181- '';
182183- environment.etc.bashrc.text = ''
184- # /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
185186- # Only execute this file once per shell.
187- if [ -n "$__ETC_BASHRC_SOURCED" ] || [ -n "$NOSYSBASHRC" ]; then return; fi
188- __ETC_BASHRC_SOURCED=1
189190- # If the profile was not loaded in a parent process, source
191- # it. But otherwise don't do it because we don't want to
192- # clobber overridden values of $PATH, etc.
193- if [ -z "$__ETC_PROFILE_DONE" ]; then
194- . /etc/profile
195- fi
196197- # We are not always an interactive shell.
198- if [ -n "$PS1" ]; then
199- ${cfg.interactiveShellInit}
200- fi
201202- # Read system-wide modifications.
203- if test -f /etc/bashrc.local; then
204- . /etc/bashrc.local
205- fi
206- '';
207208- environment.etc.bash_logout.text = ''
209- # /etc/bash_logout: DO NOT EDIT -- this file has been generated automatically.
210211- # Only execute this file once per shell.
212- if [ -n "$__ETC_BASHLOGOUT_SOURCED" ] || [ -n "$NOSYSBASHLOGOUT" ]; then return; fi
213- __ETC_BASHLOGOUT_SOURCED=1
214215- ${cfg.logout}
216217- # Read system-wide modifications.
218- if test -f /etc/bash_logout.local; then
219- . /etc/bash_logout.local
220- fi
221- '';
222223- # Configuration for readline in bash. We use "option default"
224- # priority to allow user override using both .text and .source.
225- environment.etc.inputrc.source = lib.mkOptionDefault ./inputrc;
226227- users.defaultUserShell = lib.mkDefault pkgs.bashInteractive;
228229- environment.pathsToLink = lib.optionals cfg.completion.enable [
230- "/etc/bash_completion.d"
231- "/share/bash-completion"
232- ];
233234- environment.shells = [
235- "/run/current-system/sw/bin/bash"
236- "/run/current-system/sw/bin/sh"
237- "${pkgs.bashInteractive}/bin/bash"
238- "${pkgs.bashInteractive}/bin/sh"
239- ];
240241- };
242243}
···23in
2425{
26+ imports = [
27+ (lib.mkRemovedOptionModule [ "programs" "bash" "enable" ] "")
28+ ];
2930 options = {
3132 programs.bash = {
3334+ /*
35+ enable = lib.mkOption {
36+ default = true;
37+ description = ''
38+ Whenever to configure Bash as an interactive shell.
39+ Note that this tries to make Bash the default
40+ {option}`users.defaultUserShell`,
41+ which in turn means that you might need to explicitly
42+ set this variable if you have another shell configured
43+ with NixOS.
44+ '';
45+ type = lib.types.bool;
46+ };
47+ */
4849 shellAliases = lib.mkOption {
50 default = { };
···129130 };
131132+ config = # lib.mkIf cfg.enable
133+ {
134135+ programs.bash = {
136137+ shellAliases = builtins.mapAttrs (name: lib.mkDefault) cfge.shellAliases;
138139+ shellInit = ''
140+ if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
141+ . ${config.system.build.setEnvironment}
142+ fi
143144+ ${cfge.shellInit}
145+ '';
146147+ loginShellInit = cfge.loginShellInit;
148149+ interactiveShellInit = ''
150+ # Check the window size after every command.
151+ shopt -s checkwinsize
152153+ # Disable hashing (i.e. caching) of command lookups.
154+ set +h
155156+ ${cfg.promptInit}
157+ ${cfg.promptPluginInit}
158+ ${bashAliases}
159160+ ${cfge.interactiveShellInit}
161+ '';
162163+ };
164165+ environment.etc.profile.text = ''
166+ # /etc/profile: DO NOT EDIT -- this file has been generated automatically.
167+ # This file is read for login shells.
168169+ # Only execute this file once per shell.
170+ if [ -n "$__ETC_PROFILE_SOURCED" ]; then return; fi
171+ __ETC_PROFILE_SOURCED=1
172173+ # Prevent this file from being sourced by interactive non-login child shells.
174+ export __ETC_PROFILE_DONE=1
175176+ ${cfg.shellInit}
177+ ${cfg.loginShellInit}
178179+ # Read system-wide modifications.
180+ if test -f /etc/profile.local; then
181+ . /etc/profile.local
182+ fi
183184+ if [ -n "''${BASH_VERSION:-}" ]; then
185+ . /etc/bashrc
186+ fi
187+ '';
188189+ environment.etc.bashrc.text = ''
190+ # /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
191192+ # Only execute this file once per shell.
193+ if [ -n "$__ETC_BASHRC_SOURCED" ] || [ -n "$NOSYSBASHRC" ]; then return; fi
194+ __ETC_BASHRC_SOURCED=1
195196+ # If the profile was not loaded in a parent process, source
197+ # it. But otherwise don't do it because we don't want to
198+ # clobber overridden values of $PATH, etc.
199+ if [ -z "$__ETC_PROFILE_DONE" ]; then
200+ . /etc/profile
201+ fi
202203+ # We are not always an interactive shell.
204+ if [ -n "$PS1" ]; then
205+ ${cfg.interactiveShellInit}
206+ fi
207208+ # Read system-wide modifications.
209+ if test -f /etc/bashrc.local; then
210+ . /etc/bashrc.local
211+ fi
212+ '';
213214+ environment.etc.bash_logout.text = ''
215+ # /etc/bash_logout: DO NOT EDIT -- this file has been generated automatically.
216217+ # Only execute this file once per shell.
218+ if [ -n "$__ETC_BASHLOGOUT_SOURCED" ] || [ -n "$NOSYSBASHLOGOUT" ]; then return; fi
219+ __ETC_BASHLOGOUT_SOURCED=1
220221+ ${cfg.logout}
222223+ # Read system-wide modifications.
224+ if test -f /etc/bash_logout.local; then
225+ . /etc/bash_logout.local
226+ fi
227+ '';
228229+ # Configuration for readline in bash. We use "option default"
230+ # priority to allow user override using both .text and .source.
231+ environment.etc.inputrc.source = lib.mkOptionDefault ./inputrc;
232233+ users.defaultUserShell = lib.mkDefault pkgs.bashInteractive;
234235+ environment.pathsToLink = lib.optionals cfg.completion.enable [
236+ "/etc/bash_completion.d"
237+ "/share/bash-completion"
238+ ];
239240+ environment.shells = [
241+ "/run/current-system/sw/bin/bash"
242+ "/run/current-system/sw/bin/sh"
243+ "${pkgs.bashInteractive}/bin/bash"
244+ "${pkgs.bashInteractive}/bin/sh"
245+ ];
246247+ };
248249}
···1+{ config, lib, ... }:
0000023let
4 cfg = config.programs.fuse;
···7 meta.maintainers = with lib.maintainers; [ ];
89 options.programs.fuse = {
000010 mountMax = lib.mkOption {
11 # In the C code it's an "int" (i.e. signed and at least 16 bit), but
12 # negative numbers obviously make no sense:
···27 };
28 };
2930+ config = {
000000000000000000031 environment.etc."fuse.conf".text = ''
32 ${lib.optionalString (!cfg.userAllowOther) "#"}user_allow_other
33 mount_max = ${builtins.toString cfg.mountMax}
34 '';
035 };
36}
-2
nixos/modules/programs/ssh.nix
···335 }
336 );
337338- environment.corePackages = [ cfg.package ];
339-340 # SSH configuration. Slight duplication of the sshd_config
341 # generation in the sshd service.
342 environment.etc."ssh/ssh_config".text = ''
···335 }
336 );
33700338 # SSH configuration. Slight duplication of the sshd_config
339 # generation in the sshd service.
340 environment.etc."ssh/ssh_config".text = ''
+2
nixos/modules/security/wrappers/default.nix
···266 in
267 {
268 # These are mount related wrappers that require the +s permission.
00269 mount = mkSetuidRoot "${lib.getBin pkgs.util-linux}/bin/mount";
270 umount = mkSetuidRoot "${lib.getBin pkgs.util-linux}/bin/umount";
271 };
···266 in
267 {
268 # These are mount related wrappers that require the +s permission.
269+ fusermount = mkSetuidRoot "${lib.getBin pkgs.fuse}/bin/fusermount";
270+ fusermount3 = mkSetuidRoot "${lib.getBin pkgs.fuse3}/bin/fusermount3";
271 mount = mkSetuidRoot "${lib.getBin pkgs.util-linux}/bin/mount";
272 umount = mkSetuidRoot "${lib.getBin pkgs.util-linux}/bin/umount";
273 };
···461 # Add the mount helpers to the system path so that `mount' can find them.
462 system.fsPackages = [ pkgs.dosfstools ];
463464- environment.systemPackages = config.system.fsPackages;
000000465466 environment.etc.fstab.text =
467 let
···461 # Add the mount helpers to the system path so that `mount' can find them.
462 system.fsPackages = [ pkgs.dosfstools ];
463464+ environment.systemPackages =
465+ with pkgs;
466+ [
467+ fuse3
468+ fuse
469+ ]
470+ ++ config.system.fsPackages;
471472 environment.etc.fstab.text =
473 let