···88}:
99let
10101111- corePackageNames = [
1212- "acl"
1313- "attr"
1414- "bashInteractive" # bash with ncurses support
1515- "bzip2"
1616- "coreutils-full"
1717- "cpio"
1818- "curl"
1919- "diffutils"
2020- "findutils"
2121- "gawk"
2222- "getent"
2323- "getconf"
2424- "gnugrep"
2525- "gnupatch"
2626- "gnused"
2727- "gnutar"
2828- "gzip"
2929- "xz"
3030- "less"
3131- "libcap"
3232- "ncurses"
3333- "netcat"
3434- "mkpasswd"
3535- "procps"
3636- "su"
3737- "time"
3838- "util-linux"
3939- "which"
4040- "zstd"
4141- ];
4242- corePackages =
4343- (map (
4444- n:
4545- let
4646- pkg = pkgs.${n};
4747- in
4848- lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg
4949- ) corePackageNames)
5050- ++ [ pkgs.stdenv.cc.libc ];
5151- corePackagesText = "[ ${lib.concatMapStringsSep " " (n: "pkgs.${n}") corePackageNames} ]";
1111+ requiredPackages =
1212+ map (pkg: lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg)
1313+ [
1414+ pkgs.acl
1515+ pkgs.attr
1616+ pkgs.bashInteractive # bash with ncurses support
1717+ pkgs.bzip2
1818+ pkgs.coreutils-full
1919+ pkgs.cpio
2020+ pkgs.curl
2121+ pkgs.diffutils
2222+ pkgs.findutils
2323+ pkgs.gawk
2424+ pkgs.stdenv.cc.libc
2525+ pkgs.getent
2626+ pkgs.getconf
2727+ pkgs.gnugrep
2828+ pkgs.gnupatch
2929+ pkgs.gnused
3030+ pkgs.gnutar
3131+ pkgs.gzip
3232+ pkgs.xz
3333+ pkgs.less
3434+ pkgs.libcap
3535+ pkgs.ncurses
3636+ pkgs.netcat
3737+ config.programs.ssh.package
3838+ pkgs.mkpasswd
3939+ pkgs.procps
4040+ pkgs.su
4141+ pkgs.time
4242+ pkgs.util-linux
4343+ pkgs.which
4444+ pkgs.zstd
4545+ ];
52465347 defaultPackageNames = [
5448 "perl"
···8680 '';
8781 };
88828989- corePackages = lib.mkOption {
9090- type = lib.types.listOf lib.types.package;
9191- default = corePackages;
9292- defaultText = lib.literalMD ''
9393- these packages, with their `meta.priority` numerically increased
9494- (thus lowering their installation priority):
9595-9696- ${corePackagesText}
9797- '';
9898- example = [ ];
9999- description = ''
100100- Set of core packages for a normal interactive system.
101101-102102- Only change this if you know what you're doing!
103103-104104- Like with systemPackages, packages are installed to
105105- {file}`/run/current-system/sw`. They are
106106- automatically available to all users, and are
107107- automatically updated every time you rebuild the system
108108- configuration.
109109- '';
110110- };
111111-11283 defaultPackages = lib.mkOption {
11384 type = lib.types.listOf lib.types.package;
11485 default = defaultPackages;
···180151181152 config = {
182153183183- environment.systemPackages = config.environment.corePackages ++ config.environment.defaultPackages;
154154+ environment.systemPackages = requiredPackages ++ config.environment.defaultPackages;
184155185156 environment.pathsToLink = [
186157 "/bin"
+103-97
nixos/modules/programs/bash/bash.nix
···2323in
24242525{
2626+ imports = [
2727+ (lib.mkRemovedOptionModule [ "programs" "bash" "enable" ] "")
2828+ ];
26292730 options = {
28312932 programs.bash = {
30333131- enable = lib.mkOption {
3232- default = true;
3333- description = ''
3434- Whenever to configure Bash as an interactive shell.
3535- Note that this tries to make Bash the default
3636- {option}`users.defaultUserShell`,
3737- which in turn means that you might need to explicitly
3838- set this variable if you have another shell configured
3939- with NixOS.
4040- '';
4141- type = lib.types.bool;
4242- };
3434+ /*
3535+ enable = lib.mkOption {
3636+ default = true;
3737+ description = ''
3838+ Whenever to configure Bash as an interactive shell.
3939+ Note that this tries to make Bash the default
4040+ {option}`users.defaultUserShell`,
4141+ which in turn means that you might need to explicitly
4242+ set this variable if you have another shell configured
4343+ with NixOS.
4444+ '';
4545+ type = lib.types.bool;
4646+ };
4747+ */
43484449 shellAliases = lib.mkOption {
4550 default = { };
···124129125130 };
126131127127- config = lib.mkIf cfg.enable {
132132+ config = # lib.mkIf cfg.enable
133133+ {
128134129129- programs.bash = {
135135+ programs.bash = {
130136131131- shellAliases = builtins.mapAttrs (name: lib.mkDefault) cfge.shellAliases;
137137+ shellAliases = builtins.mapAttrs (name: lib.mkDefault) cfge.shellAliases;
132138133133- shellInit = ''
134134- if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
135135- . ${config.system.build.setEnvironment}
136136- fi
139139+ shellInit = ''
140140+ if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
141141+ . ${config.system.build.setEnvironment}
142142+ fi
137143138138- ${cfge.shellInit}
139139- '';
144144+ ${cfge.shellInit}
145145+ '';
140146141141- loginShellInit = cfge.loginShellInit;
147147+ loginShellInit = cfge.loginShellInit;
142148143143- interactiveShellInit = ''
144144- # Check the window size after every command.
145145- shopt -s checkwinsize
149149+ interactiveShellInit = ''
150150+ # Check the window size after every command.
151151+ shopt -s checkwinsize
146152147147- # Disable hashing (i.e. caching) of command lookups.
148148- set +h
153153+ # Disable hashing (i.e. caching) of command lookups.
154154+ set +h
149155150150- ${cfg.promptInit}
151151- ${cfg.promptPluginInit}
152152- ${bashAliases}
156156+ ${cfg.promptInit}
157157+ ${cfg.promptPluginInit}
158158+ ${bashAliases}
153159154154- ${cfge.interactiveShellInit}
155155- '';
160160+ ${cfge.interactiveShellInit}
161161+ '';
156162157157- };
163163+ };
158164159159- environment.etc.profile.text = ''
160160- # /etc/profile: DO NOT EDIT -- this file has been generated automatically.
161161- # This file is read for login shells.
165165+ environment.etc.profile.text = ''
166166+ # /etc/profile: DO NOT EDIT -- this file has been generated automatically.
167167+ # This file is read for login shells.
162168163163- # Only execute this file once per shell.
164164- if [ -n "$__ETC_PROFILE_SOURCED" ]; then return; fi
165165- __ETC_PROFILE_SOURCED=1
169169+ # Only execute this file once per shell.
170170+ if [ -n "$__ETC_PROFILE_SOURCED" ]; then return; fi
171171+ __ETC_PROFILE_SOURCED=1
166172167167- # Prevent this file from being sourced by interactive non-login child shells.
168168- export __ETC_PROFILE_DONE=1
173173+ # Prevent this file from being sourced by interactive non-login child shells.
174174+ export __ETC_PROFILE_DONE=1
169175170170- ${cfg.shellInit}
171171- ${cfg.loginShellInit}
176176+ ${cfg.shellInit}
177177+ ${cfg.loginShellInit}
172178173173- # Read system-wide modifications.
174174- if test -f /etc/profile.local; then
175175- . /etc/profile.local
176176- fi
179179+ # Read system-wide modifications.
180180+ if test -f /etc/profile.local; then
181181+ . /etc/profile.local
182182+ fi
177183178178- if [ -n "''${BASH_VERSION:-}" ]; then
179179- . /etc/bashrc
180180- fi
181181- '';
184184+ if [ -n "''${BASH_VERSION:-}" ]; then
185185+ . /etc/bashrc
186186+ fi
187187+ '';
182188183183- environment.etc.bashrc.text = ''
184184- # /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
189189+ environment.etc.bashrc.text = ''
190190+ # /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
185191186186- # Only execute this file once per shell.
187187- if [ -n "$__ETC_BASHRC_SOURCED" ] || [ -n "$NOSYSBASHRC" ]; then return; fi
188188- __ETC_BASHRC_SOURCED=1
192192+ # Only execute this file once per shell.
193193+ if [ -n "$__ETC_BASHRC_SOURCED" ] || [ -n "$NOSYSBASHRC" ]; then return; fi
194194+ __ETC_BASHRC_SOURCED=1
189195190190- # If the profile was not loaded in a parent process, source
191191- # it. But otherwise don't do it because we don't want to
192192- # clobber overridden values of $PATH, etc.
193193- if [ -z "$__ETC_PROFILE_DONE" ]; then
194194- . /etc/profile
195195- fi
196196+ # If the profile was not loaded in a parent process, source
197197+ # it. But otherwise don't do it because we don't want to
198198+ # clobber overridden values of $PATH, etc.
199199+ if [ -z "$__ETC_PROFILE_DONE" ]; then
200200+ . /etc/profile
201201+ fi
196202197197- # We are not always an interactive shell.
198198- if [ -n "$PS1" ]; then
199199- ${cfg.interactiveShellInit}
200200- fi
203203+ # We are not always an interactive shell.
204204+ if [ -n "$PS1" ]; then
205205+ ${cfg.interactiveShellInit}
206206+ fi
201207202202- # Read system-wide modifications.
203203- if test -f /etc/bashrc.local; then
204204- . /etc/bashrc.local
205205- fi
206206- '';
208208+ # Read system-wide modifications.
209209+ if test -f /etc/bashrc.local; then
210210+ . /etc/bashrc.local
211211+ fi
212212+ '';
207213208208- environment.etc.bash_logout.text = ''
209209- # /etc/bash_logout: DO NOT EDIT -- this file has been generated automatically.
214214+ environment.etc.bash_logout.text = ''
215215+ # /etc/bash_logout: DO NOT EDIT -- this file has been generated automatically.
210216211211- # Only execute this file once per shell.
212212- if [ -n "$__ETC_BASHLOGOUT_SOURCED" ] || [ -n "$NOSYSBASHLOGOUT" ]; then return; fi
213213- __ETC_BASHLOGOUT_SOURCED=1
217217+ # Only execute this file once per shell.
218218+ if [ -n "$__ETC_BASHLOGOUT_SOURCED" ] || [ -n "$NOSYSBASHLOGOUT" ]; then return; fi
219219+ __ETC_BASHLOGOUT_SOURCED=1
214220215215- ${cfg.logout}
221221+ ${cfg.logout}
216222217217- # Read system-wide modifications.
218218- if test -f /etc/bash_logout.local; then
219219- . /etc/bash_logout.local
220220- fi
221221- '';
223223+ # Read system-wide modifications.
224224+ if test -f /etc/bash_logout.local; then
225225+ . /etc/bash_logout.local
226226+ fi
227227+ '';
222228223223- # Configuration for readline in bash. We use "option default"
224224- # priority to allow user override using both .text and .source.
225225- environment.etc.inputrc.source = lib.mkOptionDefault ./inputrc;
229229+ # Configuration for readline in bash. We use "option default"
230230+ # priority to allow user override using both .text and .source.
231231+ environment.etc.inputrc.source = lib.mkOptionDefault ./inputrc;
226232227227- users.defaultUserShell = lib.mkDefault pkgs.bashInteractive;
233233+ users.defaultUserShell = lib.mkDefault pkgs.bashInteractive;
228234229229- environment.pathsToLink = lib.optionals cfg.completion.enable [
230230- "/etc/bash_completion.d"
231231- "/share/bash-completion"
232232- ];
235235+ environment.pathsToLink = lib.optionals cfg.completion.enable [
236236+ "/etc/bash_completion.d"
237237+ "/share/bash-completion"
238238+ ];
233239234234- environment.shells = [
235235- "/run/current-system/sw/bin/bash"
236236- "/run/current-system/sw/bin/sh"
237237- "${pkgs.bashInteractive}/bin/bash"
238238- "${pkgs.bashInteractive}/bin/sh"
239239- ];
240240+ environment.shells = [
241241+ "/run/current-system/sw/bin/bash"
242242+ "/run/current-system/sw/bin/sh"
243243+ "${pkgs.bashInteractive}/bin/bash"
244244+ "${pkgs.bashInteractive}/bin/sh"
245245+ ];
240246241241- };
247247+ };
242248243249}
···335335 }
336336 );
337337338338- environment.corePackages = [ cfg.package ];
339339-340338 # SSH configuration. Slight duplication of the sshd_config
341339 # generation in the sshd service.
342340 environment.etc."ssh/ssh_config".text = ''
+2
nixos/modules/security/wrappers/default.nix
···266266 in
267267 {
268268 # These are mount related wrappers that require the +s permission.
269269+ fusermount = mkSetuidRoot "${lib.getBin pkgs.fuse}/bin/fusermount";
270270+ fusermount3 = mkSetuidRoot "${lib.getBin pkgs.fuse3}/bin/fusermount3";
269271 mount = mkSetuidRoot "${lib.getBin pkgs.util-linux}/bin/mount";
270272 umount = mkSetuidRoot "${lib.getBin pkgs.util-linux}/bin/umount";
271273 };
···461461 # Add the mount helpers to the system path so that `mount' can find them.
462462 system.fsPackages = [ pkgs.dosfstools ];
463463464464- environment.systemPackages = config.system.fsPackages;
464464+ environment.systemPackages =
465465+ with pkgs;
466466+ [
467467+ fuse3
468468+ fuse
469469+ ]
470470+ ++ config.system.fsPackages;
465471466472 environment.etc.fstab.text =
467473 let