Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide/nixos: remove with lib; part 1 #335603

Merged
merged 139 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
624f590
nixos/appstream: remove `with lib;`
Stunkymonkey Aug 27, 2024
9da3697
nixos/console: remove `with lib;`
Stunkymonkey Aug 27, 2024
3ad0220
debug-info: remove `with lib;`
Stunkymonkey Aug 27, 2024
58baef7
nixos/fonts.fontDir: remove `with lib;`
Stunkymonkey Aug 27, 2024
7fece7e
nixos/fonts.enableGhostscriptFonts: remove `with lib;`
Stunkymonkey Aug 27, 2024
6b9c5be
nixos/gtk.iconCache: remove `with lib;`
Stunkymonkey Aug 27, 2024
e514851
nixos/networking.iproute2: remove `with lib;`
Stunkymonkey Aug 27, 2024
88e6e9d
nixos/time: remove `with lib;`
Stunkymonkey Aug 27, 2024
dd7e20e
nixos/environment.memoryAllocator: remove `with lib;`
Stunkymonkey Aug 27, 2024
b5b0eda
nixos/networking: remove `with lib;`
Stunkymonkey Aug 27, 2024
87c8da0
nixos/environment.noXlibs: remove `with lib;`
Stunkymonkey Aug 27, 2024
d65b7db
nixos/system.nss*: remove `with lib;`
Stunkymonkey Aug 27, 2024
58258bd
nixos/powerManagement: remove `with lib;`
Stunkymonkey Aug 27, 2024
c39ad44
nixos/networking.resolvconf: remove `with lib;`
Stunkymonkey Aug 27, 2024
21d7a61
nixos/environment: remove `with lib;`
Stunkymonkey Aug 27, 2024
d666633
nixos/environment.paths: remove `with lib;`
Stunkymonkey Aug 27, 2024
6232911
nixos/environment.terminfo: remove `with lib;`
Stunkymonkey Aug 27, 2024
a39c467
nixos/environment.unix-odbc-drivers.nix: remove `with lib;`
Stunkymonkey Aug 27, 2024
e50a74b
nixos/vte: remove `with lib;`
Stunkymonkey Aug 27, 2024
7f5a38f
nixos/xdg.autostart: remove `with lib;`
Stunkymonkey Aug 27, 2024
1da2c43
nixos/xdg.icons: remove `with lib;`
Stunkymonkey Aug 27, 2024
56adb6a
nixos/xdg.menus: remove `with lib;`
Stunkymonkey Aug 27, 2024
6278285
nixos/xdg.mime: remove `with lib;`
Stunkymonkey Aug 27, 2024
f3fff00
nixos/xdg.portal.lxqt: remove `with lib;`
Stunkymonkey Aug 27, 2024
352763b
nixos/xdg.portal.wlr: remove `with lib;`
Stunkymonkey Aug 27, 2024
413bd7c
nixos/xdg.sounds: remove `with lib;`
Stunkymonkey Aug 27, 2024
be8d4ec
nixos/hardware.acpilight: remove `with lib;`
Stunkymonkey Aug 27, 2024
930af3e
nixos/hardware.enableAllFirmware: remove `with lib;`
Stunkymonkey Aug 27, 2024
6c0e1c7
nixos/hardware.bladeRF: remove `with lib;`
Stunkymonkey Aug 27, 2024
374ad8d
nixos/hardware.brillo: remove `with lib;`
Stunkymonkey Aug 27, 2024
dd93025
nixos/hardware.ckb-next: remove `with lib;`
Stunkymonkey Aug 27, 2024
f41312d
nixos/hardware.corectrl: remove `with lib;`
Stunkymonkey Aug 27, 2024
0dac464
nixos/hardware/deviceTree: remove `with lib;`
Stunkymonkey Aug 27, 2024
6f3aef9
nixos/hardware.flipperzero: remove `with lib;`
Stunkymonkey Aug 27, 2024
166d20f
nixos/hardware.gkraken: remove `with lib;`
Stunkymonkey Aug 27, 2024
6d731ad
nixos/hardware.gpgSmartcards: remove `with lib;`
Stunkymonkey Aug 27, 2024
58e31e0
nixos/hardware.i2c: remove `with lib;`
Stunkymonkey Aug 27, 2024
e880cd1
nixos/hardware.infiniband: remove `with lib;`
Stunkymonkey Aug 27, 2024
9856183
nixos/security.polkit: remove `with lib;`
Stunkymonkey Aug 27, 2024
3e47355
nixos/services.salt.master: remove `with lib;`
Stunkymonkey Aug 27, 2024
2d4f871
nixos/services.rabbitmq: remove `with lib;`
Stunkymonkey Aug 27, 2024
bff6789
nixos/services.kubernetes.flannel: remove `with lib;`
Stunkymonkey Aug 27, 2024
4b3987a
nixos/services.jenkins: remove `with lib;`
Stunkymonkey Aug 27, 2024
5fb9046
nixos/services.jenkins.jobBuilder: remove `with lib;`
Stunkymonkey Aug 27, 2024
75d565a
nixos/services.couchdb: remove `with lib;`
Stunkymonkey Aug 27, 2024
626c4c1
nixos/services.dgraph: remove `with lib;`
Stunkymonkey Aug 27, 2024
f06f3a7
nixos/services.dragonflydb: remove `with lib;`
Stunkymonkey Aug 27, 2024
17003ea
nixos/services.ferretdb: remove `with lib;`
Stunkymonkey Aug 27, 2024
567aa06
nixos/services.firebird: remove `with lib;`
Stunkymonkey Aug 27, 2024
3db1445
nixos/services.hbase-standalone: remove `with lib;`
Stunkymonkey Aug 27, 2024
0dbb2e5
nixos/services.influxdb: remove `with lib;`
Stunkymonkey Aug 27, 2024
93fb328
nixos/services.openldap: remove `with lib;`
Stunkymonkey Aug 27, 2024
6bbc3df
nixos/services.opentsdb: remove `with lib;`
Stunkymonkey Aug 27, 2024
18c0ca5
nixos/services.pgmanage: remove `with lib;`
Stunkymonkey Aug 27, 2024
edcd08a
nixos/services.rethinkdb: remove `with lib;`
Stunkymonkey Aug 27, 2024
24f82fc
nixos/services.surrealdb: remove `with lib;`
Stunkymonkey Aug 27, 2024
38b5d41
nixos/services.blueman: remove `with lib;`
Stunkymonkey Aug 27, 2024
f2e025b
nixos/services.cpupower-gui: remove `with lib;`
Stunkymonkey Aug 27, 2024
5fd49dc
nixos/services.deepin.app-services: remove `with lib;`
Stunkymonkey Aug 27, 2024
345c0fc
nixos/services.deepin.dde-api.enable: remove `with lib;`
Stunkymonkey Aug 27, 2024
8de58d8
nixos/services.dleyna-renderer: remove `with lib;`
Stunkymonkey Aug 27, 2024
fe453fb
nixos/services.dleyna-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
b7a9638
nixos/services.flatpak: remove `with lib;`
Stunkymonkey Aug 27, 2024
42f3c52
nixos/services.gsignond: remove `with lib;`
Stunkymonkey Aug 27, 2024
6c70288
nixos/services.neard: remove `with lib;`
Stunkymonkey Aug 27, 2024
5ee2871
nixos/services.psd: remove `with lib;`
Stunkymonkey Aug 27, 2024
63f7206
nixos/services.system-config-printer: remove `with lib;`
Stunkymonkey Aug 27, 2024
506e98b
nixos/services.telepathy: remove `with lib;`
Stunkymonkey Aug 27, 2024
dee0a91
nixos/services.tumbler: remove `with lib;`
Stunkymonkey Aug 27, 2024
8ddfb13
nixos/services.distccd: remove `with lib;`
Stunkymonkey Aug 27, 2024
25ddce8
nixos/services.hoogle: remove `with lib;`
Stunkymonkey Aug 27, 2024
5134f4b
nixos/services.jupyter: remove `with lib;`
Stunkymonkey Aug 27, 2024
a986e3c
nixos/services.jupyter.kernels: remove `with lib;`
Stunkymonkey Aug 27, 2024
df4401e
nixos/services.jupyterhub: remove `with lib;`
Stunkymonkey Aug 27, 2024
f65c358
nixos/services.livebook: remove `with lib;`
Stunkymonkey Aug 27, 2024
45bc597
nixos/services.rstudio-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
2606546
nixos/services.greetd: remove `with lib;`
Stunkymonkey Aug 27, 2024
facc95c
nixos/services.emacs: remove `with lib;`
Stunkymonkey Aug 27, 2024
11e4758
nixos/services.haste: remove `with lib;`
Stunkymonkey Aug 27, 2024
fe2d014
nixos/services.infinoted: remove `with lib;`
Stunkymonkey Aug 27, 2024
6b5ef21
nixos/services.odoo: remove `with lib;`
Stunkymonkey Aug 27, 2024
eb3a044
nixos/services.crossfire-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
07d3ecf
nixos/services.deliantra-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
d746055
nixos/services.freeciv: remove `with lib;`
Stunkymonkey Aug 27, 2024
d93ebcf
nixos/services.minecraft-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
3e00196
nixos/services.minetest-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
e79224a
nixos/services.terraria: remove `with lib;`
Stunkymonkey Aug 27, 2024
f8305b6
nixos/services.acpid: remove `with lib;`
Stunkymonkey Aug 27, 2024
efcfb7e
nixos/services.auto-cpufreq: remove `with lib;`
Stunkymonkey Aug 27, 2024
555402c
nixos/services.bolt: remove `with lib;`
Stunkymonkey Aug 27, 2024
3822e79
nixos/services.brltty: remove `with lib;`
Stunkymonkey Aug 27, 2024
29536d4
nixos/services.fancontrol: remove `with lib;`
Stunkymonkey Aug 27, 2024
6c707fe
nixos/services.freefall: remove `with lib;`
Stunkymonkey Aug 27, 2024
8ebc060
nixos/services.fwupd: remove `with lib;`
Stunkymonkey Aug 27, 2024
d3a4a69
nixos/services.illum: remove `with lib;`
Stunkymonkey Aug 27, 2024
650db2b
nixos/services.interception-tools: remove `with lib;`
Stunkymonkey Aug 27, 2024
d71be6e
nixos/services.irqbalance: remove `with lib;`
Stunkymonkey Aug 27, 2024
f5c96d8
nixos/services.joycond: remove `with lib;`
Stunkymonkey Aug 27, 2024
3b7622d
nixos/services.kanata: remove `with lib;`
Stunkymonkey Aug 27, 2024
827d9df
nixos/services.keyd: remove `with lib;`
Stunkymonkey Aug 27, 2024
78b24be
nixos/services.lirc: remove `with lib;`
Stunkymonkey Aug 27, 2024
b2d7434
nixos/services.openrgb: remove `with lib;`
Stunkymonkey Aug 27, 2024
2f256fd
nixos/services.pcscd: remove `with lib;`
Stunkymonkey Aug 27, 2024
08ec49e
nixos/services.pommed: remove `with lib;`
Stunkymonkey Aug 27, 2024
439cb74
nixos/hardware.rasdaemon: remove `with lib;`
Stunkymonkey Aug 27, 2024
e2a4b67
nixos/services.ratbagd: remove `with lib;`
Stunkymonkey Aug 27, 2024
131116e
nixos/services.saned: remove `with lib;`
Stunkymonkey Aug 27, 2024
d59ce58
nixos/hardware.spacenavd: remove `with lib;`
Stunkymonkey Aug 27, 2024
b80de00
nixos/services.tcsd: remove `with lib;`
Stunkymonkey Aug 27, 2024
f4fdd33
nixos/services.thermald: remove `with lib;`
Stunkymonkey Aug 27, 2024
d9dc50d
nixos/services.thinkfan: remove `with lib;`
Stunkymonkey Aug 27, 2024
00052ae
nixos/services.throttled: remove `with lib;`
Stunkymonkey Aug 27, 2024
cb1696c
nixos/services.tlp: remove `with lib;`
Stunkymonkey Aug 27, 2024
624ea29
nixos/services.triggerhappy: remove `with lib;`
Stunkymonkey Aug 27, 2024
48633eb
nixos/hardware.tuxedo-rs: remove `with lib;`
Stunkymonkey Aug 27, 2024
b00fba5
nixos/services.udev: remove `with lib;`
Stunkymonkey Aug 27, 2024
0de89d2
nixos/services.udisks2: remove `with lib;`
Stunkymonkey Aug 27, 2024
c1573bb
nixos/services.undervolt: remove `with lib;`
Stunkymonkey Aug 27, 2024
ab7b22c
nixos/services.upower: remove `with lib;`
Stunkymonkey Aug 27, 2024
a79aa02
nixos/services.usbmuxd: remove `with lib;`
Stunkymonkey Aug 27, 2024
e5f1494
nixos/services.matter-server: remove `with lib;`
Stunkymonkey Aug 27, 2024
5645a33
nixos/services.zigbee2mqtt: remove `with lib;`
Stunkymonkey Aug 27, 2024
5eba86d
nixos/services.zwave-js: remove `with lib;`
Stunkymonkey Aug 27, 2024
d9a6443
nixos/services.SystemdJournal2Gelf: remove `with lib;`
Stunkymonkey Aug 27, 2024
e2a2735
nixos/services.awstats: remove `with lib;`
Stunkymonkey Aug 27, 2024
4e0ba37
nixos/services.fluentd: remove `with lib;`
Stunkymonkey Aug 27, 2024
83ed6b4
nixos/services.graylog: remove `with lib;`
Stunkymonkey Aug 27, 2024
d0885b1
nixos/services.heartbeat: remove `with lib;`
Stunkymonkey Aug 27, 2024
0470d7f
nixos/services.journalbeat: remove `with lib;`
Stunkymonkey Aug 27, 2024
5bc3fb4
nixos/services.journalwatch: remove `with lib;`
Stunkymonkey Aug 27, 2024
e3a59fb
nixos/services.logcheck: remove `with lib;`
Stunkymonkey Aug 27, 2024
5ba3692
nixos/services.logrotate: remove `with lib;`
Stunkymonkey Aug 27, 2024
5b61b70
nixos/services.logstash: remove `with lib;`
Stunkymonkey Aug 27, 2024
bb1483b
nixos/services.rsyslogd: remove `with lib;`
Stunkymonkey Aug 27, 2024
b14d3ec
nixos/services.syslog-ng: remove `with lib;`
Stunkymonkey Aug 27, 2024
12cf354
nixos/services.syslogd: remove `with lib;`
Stunkymonkey Aug 27, 2024
6408921
nixos/services.ulogd: remove `with lib;`
Stunkymonkey Aug 27, 2024
28072b6
nixos/services.vector: remove `with lib;`
Stunkymonkey Aug 27, 2024
14dad27
nixos/services.prometheus.exporters: remove `with lib;`
Stunkymonkey Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions nixos/modules/config/appstream.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{ config, lib, ... }:

with lib;
{
options = {
appstream.enable = mkOption {
type = types.bool;
appstream.enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Whether to install files to support the
Expand All @@ -13,7 +11,7 @@ with lib;
};
};

config = mkIf config.appstream.enable {
config = lib.mkIf config.appstream.enable {
environment.pathsToLink = [
# per component metadata
"/share/metainfo"
Expand Down
78 changes: 37 additions & 41 deletions nixos/modules/config/console.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@

{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.console;

makeColor = i: concatMapStringsSep "," (x: "0x" + substring (2*i) 2 x);
makeColor = i: lib.concatMapStringsSep "," (x: "0x" + lib.substring (2*i) 2 x);

isUnicode = hasSuffix "UTF-8" (toUpper config.i18n.defaultLocale);
isUnicode = lib.hasSuffix "UTF-8" (lib.toUpper config.i18n.defaultLocale);

optimizedKeymap = pkgs.runCommand "keymap" {
nativeBuildInputs = [ pkgs.buildPackages.kbd ];
LOADKEYS_KEYMAP_PATH = "${consoleEnv pkgs.kbd}/share/keymaps/**";
preferLocalBuild = true;
} ''
loadkeys -b ${optionalString isUnicode "-u"} "${cfg.keyMap}" > $out
loadkeys -b ${lib.optionalString isUnicode "-u"} "${cfg.keyMap}" > $out
'';

# Sadly, systemd-vconsole-setup doesn't support binary keymaps.
vconsoleConf = pkgs.writeText "vconsole.conf" ''
KEYMAP=${cfg.keyMap}
${optionalString (cfg.font != null) "FONT=${cfg.font}"}
${lib.optionalString (cfg.font != null) "FONT=${cfg.font}"}
'';

consoleEnv = kbd: pkgs.buildEnv {
Expand All @@ -40,12 +36,12 @@ in
###### interface

options.console = {
enable = mkEnableOption "virtual console" // {
enable = lib.mkEnableOption "virtual console" // {
default = true;
};

font = mkOption {
type = with types; nullOr (either str path);
font = lib.mkOption {
type = with lib.types; nullOr (either str path);
default = null;
example = "LatArCyrHeb-16";
description = ''
Expand All @@ -61,17 +57,17 @@ in
'';
};

keyMap = mkOption {
type = with types; either str path;
keyMap = lib.mkOption {
type = with lib.types; either str path;
default = "us";
example = "fr";
description = ''
The keyboard mapping table for the virtual consoles.
'';
};

colors = mkOption {
type = with types; listOf (strMatching "[[:xdigit:]]{6}");
colors = lib.mkOption {
type = with lib.types; listOf (strMatching "[[:xdigit:]]{6}");
default = [ ];
example = [
"002b36" "dc322f" "859900" "b58900"
Expand All @@ -88,27 +84,27 @@ in

};

packages = mkOption {
type = types.listOf types.package;
packages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
description = ''
List of additional packages that provide console fonts, keymaps and
other resources for virtual consoles use.
'';
};

useXkbConfig = mkOption {
type = types.bool;
useXkbConfig = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
If set, configure the virtual console keymap from the xserver
keyboard settings.
'';
};

earlySetup = mkOption {
earlySetup = lib.mkOption {
default = false;
type = types.bool;
type = lib.types.bool;
description = ''
Enable setting virtual console options as early as possible (in initrd).
'';
Expand All @@ -119,20 +115,20 @@ in

###### implementation

config = mkMerge [
config = lib.mkMerge [
{ console.keyMap = with config.services.xserver;
mkIf cfg.useXkbConfig
lib.mkIf cfg.useXkbConfig
(pkgs.runCommand "xkb-console-keymap" { preferLocalBuild = true; } ''
'${pkgs.buildPackages.ckbcomp}/bin/ckbcomp' \
${optionalString (config.environment.sessionVariables ? XKB_CONFIG_ROOT)
${lib.optionalString (config.environment.sessionVariables ? XKB_CONFIG_ROOT)
"-I${config.environment.sessionVariables.XKB_CONFIG_ROOT}"
} \
-model '${xkb.model}' -layout '${xkb.layout}' \
-option '${xkb.options}' -variant '${xkb.variant}' > "$out"
'');
}

(mkIf (!cfg.enable) {
(lib.mkIf (!cfg.enable) {
systemd.services = {
"serial-getty@ttyS0".enable = false;
"serial-getty@hvc0".enable = false;
Expand All @@ -142,7 +138,7 @@ in
};
})

(mkIf cfg.enable (mkMerge [
(lib.mkIf cfg.enable (lib.mkMerge [
{ environment.systemPackages = [ pkgs.kbd ];

# Let systemd-vconsole-setup.service do the work of setting up the
Expand All @@ -151,12 +147,12 @@ in
# Provide kbd with additional packages.
environment.etc.kbd.source = "${consoleEnv pkgs.kbd}/share";

boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (mkBefore ''
boot.initrd.preLVMCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (lib.mkBefore ''
kbd_mode ${if isUnicode then "-u" else "-a"} -C /dev/console
printf "\033%%${if isUnicode then "G" else "@"}" >> /dev/console
loadkmap < ${optimizedKeymap}

${optionalString (cfg.earlySetup && cfg.font != null) ''
${lib.optionalString (cfg.earlySetup && cfg.font != null) ''
setfont -C /dev/console $extraUtils/share/consolefonts/font.psf
''}
'');
Expand All @@ -176,9 +172,9 @@ in
"${config.boot.initrd.systemd.package.kbd}/bin/setfont"
"${config.boot.initrd.systemd.package.kbd}/bin/loadkeys"
"${config.boot.initrd.systemd.package.kbd.gzip}/bin/gzip" # Fonts and keyboard layouts are compressed
] ++ optionals (cfg.font != null && hasPrefix builtins.storeDir cfg.font) [
] ++ lib.optionals (cfg.font != null && lib.hasPrefix builtins.storeDir cfg.font) [
"${cfg.font}"
] ++ optionals (hasPrefix builtins.storeDir cfg.keyMap) [
] ++ lib.optionals (lib.hasPrefix builtins.storeDir cfg.keyMap) [
"${cfg.keyMap}"
];

Expand All @@ -195,18 +191,18 @@ in
};
}

(mkIf (cfg.colors != []) {
(lib.mkIf (cfg.colors != []) {
boot.kernelParams = [
"vt.default_red=${makeColor 0 cfg.colors}"
"vt.default_grn=${makeColor 1 cfg.colors}"
"vt.default_blu=${makeColor 2 cfg.colors}"
];
})

(mkIf (cfg.earlySetup && cfg.font != null && !config.boot.initrd.systemd.enable) {
(lib.mkIf (cfg.earlySetup && cfg.font != null && !config.boot.initrd.systemd.enable) {
boot.initrd.extraUtilsCommands = ''
mkdir -p $out/share/consolefonts
${if substring 0 1 cfg.font == "/" then ''
${if lib.substring 0 1 cfg.font == "/" then ''
font="${cfg.font}"
'' else ''
font="$(echo ${consoleEnv pkgs.kbd}/share/consolefonts/${cfg.font}.*)"
Expand All @@ -222,14 +218,14 @@ in
];

imports = [
(mkRenamedOptionModule [ "i18n" "consoleFont" ] [ "console" "font" ])
(mkRenamedOptionModule [ "i18n" "consoleKeyMap" ] [ "console" "keyMap" ])
(mkRenamedOptionModule [ "i18n" "consoleColors" ] [ "console" "colors" ])
(mkRenamedOptionModule [ "i18n" "consolePackages" ] [ "console" "packages" ])
(mkRenamedOptionModule [ "i18n" "consoleUseXkbConfig" ] [ "console" "useXkbConfig" ])
(mkRenamedOptionModule [ "boot" "earlyVconsoleSetup" ] [ "console" "earlySetup" ])
(mkRenamedOptionModule [ "boot" "extraTTYs" ] [ "console" "extraTTYs" ])
(mkRemovedOptionModule [ "console" "extraTTYs" ] ''
(lib.mkRenamedOptionModule [ "i18n" "consoleFont" ] [ "console" "font" ])
(lib.mkRenamedOptionModule [ "i18n" "consoleKeyMap" ] [ "console" "keyMap" ])
(lib.mkRenamedOptionModule [ "i18n" "consoleColors" ] [ "console" "colors" ])
(lib.mkRenamedOptionModule [ "i18n" "consolePackages" ] [ "console" "packages" ])
(lib.mkRenamedOptionModule [ "i18n" "consoleUseXkbConfig" ] [ "console" "useXkbConfig" ])
(lib.mkRenamedOptionModule [ "boot" "earlyVconsoleSetup" ] [ "console" "earlySetup" ])
(lib.mkRenamedOptionModule [ "boot" "extraTTYs" ] [ "console" "extraTTYs" ])
(lib.mkRemovedOptionModule [ "console" "extraTTYs" ] ''
Since NixOS switched to systemd (circa 2012), TTYs have been spawned on
demand, so there is no need to configure them manually.
'')
Expand Down
9 changes: 3 additions & 6 deletions nixos/modules/config/debug-info.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{ config, lib, ... }:

with lib;

{

options = {

environment.enableDebugInfo = mkOption {
type = types.bool;
environment.enableDebugInfo = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Some NixOS packages provide debug symbols. However, these are
Expand All @@ -29,7 +26,7 @@ with lib;
};


config = mkIf config.environment.enableDebugInfo {
config = lib.mkIf config.environment.enableDebugInfo {

# FIXME: currently disabled because /lib is already in
# environment.pathsToLink, and we can't have both.
Expand Down
19 changes: 8 additions & 11 deletions nixos/modules/config/fonts/fontdir.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:

with lib;

let

cfg = config.fonts.fontDir;
Expand All @@ -12,7 +9,7 @@ let
find ${toString config.fonts.packages} -regex "$font_regexp" \
-exec ln -sf -t "$out/share/X11/fonts" '{}' \;
cd "$out/share/X11/fonts"
${optionalString cfg.decompressFonts ''
${lib.optionalString cfg.decompressFonts ''
${pkgs.gzip}/bin/gunzip -f *.gz
''}
${pkgs.xorg.mkfontscale}/bin/mkfontscale
Expand All @@ -27,19 +24,19 @@ in
options = {
fonts.fontDir = {

enable = mkOption {
type = types.bool;
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to create a directory with links to all fonts in
{file}`/run/current-system/sw/share/X11/fonts`.
'';
};

decompressFonts = mkOption {
type = types.bool;
decompressFonts = lib.mkOption {
type = lib.types.bool;
default = config.programs.xwayland.enable;
defaultText = literalExpression "config.programs.xwayland.enable";
defaultText = lib.literalExpression "config.programs.xwayland.enable";
description = ''
Whether to decompress fonts in
{file}`/run/current-system/sw/share/X11/fonts`.
Expand All @@ -49,7 +46,7 @@ in
};
};

config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {

environment.systemPackages = [ x11Fonts ];
environment.pathsToLink = [ "/share/X11/fonts" ];
Expand All @@ -61,7 +58,7 @@ in
};

imports = [
(mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ])
(lib.mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ])
];

}
9 changes: 3 additions & 6 deletions nixos/modules/config/fonts/ghostscript.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{ config, lib, pkgs, ... }:

with lib;

{
options = {
fonts.enableGhostscriptFonts = mkOption {
type = types.bool;
fonts.enableGhostscriptFonts = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to add the fonts provided by Ghostscript (such as
Expand All @@ -17,7 +14,7 @@ with lib;

};

config = mkIf config.fonts.enableGhostscriptFonts {
config = lib.mkIf config.fonts.enableGhostscriptFonts {
fonts.packages = [ pkgs.ghostscript.fonts ];
};
}
10 changes: 4 additions & 6 deletions nixos/modules/config/gtk/gtk-icon-cache.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{ config, lib, pkgs, ... }:

with lib;
{
options = {
gtk.iconCache.enable = mkOption {
type = types.bool;
gtk.iconCache.enable = lib.mkOption {
type = lib.types.bool;
default = config.services.xserver.enable;
defaultText = literalExpression "config.services.xserver.enable";
defaultText = lib.literalExpression "config.services.xserver.enable";
description = ''
Whether to build icon theme caches for GTK applications.
'';
};
};

config = mkIf config.gtk.iconCache.enable {
config = lib.mkIf config.gtk.iconCache.enable {

# (Re)build icon theme caches
# ---------------------------
Expand Down
11 changes: 4 additions & 7 deletions nixos/modules/config/iproute2.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.networking.iproute2;
in
{
options.networking.iproute2 = {
enable = mkEnableOption "copying IP route configuration files";
rttablesExtraConfig = mkOption {
type = types.lines;
enable = lib.mkEnableOption "copying IP route configuration files";
rttablesExtraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = ''
Verbatim lines to add to /etc/iproute2/rt_tables
'';
};
};

config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
environment.etc."iproute2/rt_tables.d/nixos.conf" = {
mode = "0644";
text = cfg.rttablesExtraConfig;
Expand Down
Loading