diff options
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/config/fonts/fontconfig.nix | 29 | ||||
-rw-r--r-- | nixos/modules/config/fonts/fonts.nix | 8 | ||||
-rw-r--r-- | nixos/modules/config/nsswitch.nix | 44 | ||||
-rw-r--r-- | nixos/modules/services/hardware/udev.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/system/nscd.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/x11/desktop-managers/gnome3.nix | 5 | ||||
-rw-r--r-- | nixos/modules/services/x11/display-managers/gdm.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/stage-1-init.sh | 6 | ||||
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 1 | ||||
-rw-r--r-- | nixos/modules/virtualisation/containers.nix | 5 |
11 files changed, 66 insertions, 39 deletions
diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index 7516d7ddf1a6..4b6f9325fda0 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -27,9 +27,11 @@ with lib; config = mkIf config.fonts.enableFontConfig { - # Bring in the default (upstream) fontconfig configuration. + # Fontconfig 2.10 backward compatibility + + # Bring in the default (upstream) fontconfig configuration, only for fontconfig 2.10 environment.etc."fonts/fonts.conf".source = - pkgs.makeFontsConf { fontDirectories = config.fonts.fonts; }; + pkgs.makeFontsConf { fontconfig = pkgs.fontconfig_210; fontDirectories = config.fonts.fonts; }; environment.etc."fonts/conf.d/00-nixos.conf".text = '' @@ -47,6 +49,29 @@ with lib; </fontconfig> ''; + # Versioned fontconfig > 2.10. Take shared fonts.conf from fontconfig. + # Otherwise specify only font directories. + environment.etc."fonts/${pkgs.fontconfig.configVersion}/fonts.conf".source = + "${pkgs.fontconfig}/etc/fonts/fonts.conf"; + environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/00-nixos.conf".text = + '' + <?xml version='1.0'?> + <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> + <fontconfig> + + <!-- Set the default hinting style to "slight". --> + <match target="font"> + <edit mode="assign" name="hintstyle"> + <const>hintslight</const> + </edit> + </match> + + <!-- Font directories --> + ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)} + + </fontconfig> + ''; + environment.systemPackages = [ pkgs.fontconfig ]; }; diff --git a/nixos/modules/config/fonts/fonts.nix b/nixos/modules/config/fonts/fonts.nix index f6060a910a15..baf5b7713f5f 100644 --- a/nixos/modules/config/fonts/fonts.nix +++ b/nixos/modules/config/fonts/fonts.nix @@ -13,14 +13,6 @@ with lib; type = types.listOf types.path; example = literalExample "[ pkgs.dejavu_fonts ]"; description = "List of primary font paths."; - apply = list: list ++ - [ # - the user's current profile - "~/.nix-profile/lib/X11/fonts" - "~/.nix-profile/share/fonts" - # - the default profile - "/nix/var/nix/profiles/default/lib/X11/fonts" - "/nix/var/nix/profiles/default/share/fonts" - ]; }; }; diff --git a/nixos/modules/config/nsswitch.nix b/nixos/modules/config/nsswitch.nix index 45695d9cb89f..549e731f3b08 100644 --- a/nixos/modules/config/nsswitch.nix +++ b/nixos/modules/config/nsswitch.nix @@ -35,29 +35,27 @@ in config = { - environment.etc = - [ # Name Service Switch configuration file. Required by the C library. - # !!! Factor out the mdns stuff. The avahi module should define - # an option used by this module. - { source = pkgs.writeText "nsswitch.conf" - '' - passwd: files ldap - group: files ldap - shadow: files ldap - hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} ${optionalString nsswins "wins"} myhostname - networks: files dns - ethers: files - services: files - protocols: files - ''; - target = "nsswitch.conf"; - } - ]; - - # Use nss-myhostname to ensure that our hostname always resolves to - # a valid IP address. It returns all locally configured IP - # addresses, or ::1 and 127.0.0.2 as fallbacks. - system.nssModules = [ pkgs.systemd ]; + # Name Service Switch configuration file. Required by the C + # library. !!! Factor out the mdns stuff. The avahi module + # should define an option used by this module. + environment.etc."nsswitch.conf".text = + '' + passwd: files ldap + group: files ldap + shadow: files ldap + hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} ${optionalString nsswins "wins"} myhostname mymachines + networks: files dns + ethers: files + services: files + protocols: files + ''; + + # Systemd provides nss-myhostname to ensure that our hostname + # always resolves to a valid IP address. It returns all locally + # configured IP addresses, or ::1 and 127.0.0.2 as + # fallbacks. Systemd also provides nss-mymachines to return IP + # addresses of local containers. + system.nssModules = [ config.systemd.package ]; }; } diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 095a97338d52..2a6f4cfb4e37 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -31,6 +31,7 @@ let buildCommand = '' mkdir -p $out shopt -s nullglob + set +o pipefail # Set a reasonable $PATH for programs called by udev rules. echo 'ENV{PATH}="${udevPath}/bin:${udevPath}/sbin"' > $out/00-path.rules diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix index 5460e962ea2c..0879d9b85bd8 100644 --- a/nixos/modules/services/system/nscd.nix +++ b/nixos/modules/services/system/nscd.nix @@ -62,7 +62,7 @@ in mkdir -m 0755 -p /var/db/nscd ''; - restartTriggers = [ config.environment.etc.hosts.source ]; + restartTriggers = [ config.environment.etc.hosts.source config.environment.etc."nsswitch.conf".source ]; serviceConfig = { ExecStart = "@${pkgs.glibc}/sbin/nscd nscd -f ${cfgFile}"; diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 5ac1a9591fdf..ccf100686835 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -44,9 +44,10 @@ in { }; environment.gnome3.packageSet = mkOption { - default = pkgs.gnome3; - example = literalExample "pkgs.gnome3_12"; + default = null; + example = literalExample "pkgs.gnome3_10"; description = "Which Gnome 3 package set to use."; + apply = p: if p == null then pkgs.gnome3 else p; }; environment.gnome3.excludePackages = mkOption { diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index 9d14fc2e137c..080588df2472 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -5,8 +5,8 @@ with lib; let cfg = config.services.xserver.displayManager; - gdm = pkgs.gnome3_12.gdm; # gdm 3.10 not supported gnome3 = config.environment.gnome3.packageSet; + gdm = gnome3.gdm; in diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index da1963f98043..071eb8ee874c 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -372,7 +372,11 @@ exec 3>&- # Emit a udev rule for /dev/root to prevent systemd from complaining. -eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=$targetRoot || true) +if [ -e /mnt-root/iso ]; then + eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/mnt-root/iso || true) +else + eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=$targetRoot || true) +fi if [ "$ROOT_MAJOR" -a "$ROOT_MINOR" -a "$ROOT_MAJOR" != 0 ]; then mkdir -p /run/udev/rules.d echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > /run/udev/rules.d/61-dev-root-link.rules diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 45229e871ab6..cf2114046498 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -34,6 +34,8 @@ let doublePatchelf = pkgs.stdenv.isArm; } '' + set +o pipefail + mkdir -p $out/bin $out/lib ln -s $out/bin $out/sbin diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index c1205dc0c447..8a86149a9e12 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -85,6 +85,7 @@ let "systemd-journal-flush.service" "systemd-journal-gatewayd.socket" "systemd-journal-gatewayd.service" + "systemd-journald-dev-log.socket" "syslog.socket" # SysV init compatibility. diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 35e37257838e..3a603e0bbac3 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -271,9 +271,12 @@ in NotifyAccess = "all"; - # Note that on reboot, systemd-nspawn returns 10, so this + # Note that on reboot, systemd-nspawn returns 133, so this # unit will be restarted. On poweroff, it returns 0, so the # unit won't be restarted. + RestartForceExitStatus = "133"; + SuccessExitStatus = "133"; + Restart = "on-failure"; # Hack: we don't want to kill systemd-nspawn, since we call |