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 6 #337780

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7ba7678
nixos/installer.netboot: remove `with lib;`
Stunkymonkey Dec 29, 2024
6191700
nixos/headless: remove `with lib;`
Stunkymonkey Dec 29, 2024
79f382a
nixos/installation-device: remove `with lib;`
Stunkymonkey Dec 29, 2024
223a09d
nixos/security.rtkit: remove `with lib;`
Stunkymonkey Dec 29, 2024
be5013d
nixos/services.kubernetes.kubelet: remove `with lib;`
Stunkymonkey Dec 29, 2024
7c33b1f
nixos/services.kubernetes.kubelet: fmt
Stunkymonkey Dec 29, 2024
ca65d76
nixos/services.kubernetes.pki: remove `with lib;`
Stunkymonkey Dec 29, 2024
1b3e161
nixos/services.kubernetes.pki: fmt
Stunkymonkey Dec 29, 2024
f84012a
nixos/services.kubernetes.proxy: remove `with lib;`
Stunkymonkey Dec 29, 2024
7728012
nixos/services.gocd-server: remove `with lib;`
Stunkymonkey Dec 29, 2024
039bbe4
nixos/services.icecream.daemon: remove `with lib;`
Stunkymonkey Dec 29, 2024
a581660
nixos/services.icecream.scheduler: remove `with lib;`
Stunkymonkey Dec 29, 2024
0c8685d
nixos/services.ircdHybrid: remove `with lib;`
Stunkymonkey Dec 29, 2024
f3b9b0c
nixos/services.target: remove `with lib;`
Stunkymonkey Dec 29, 2024
19ea3f4
nixos/services.jibri: remove `with lib;`
Stunkymonkey Dec 29, 2024
cde4787
nixos/services.jibri: fmt
Stunkymonkey Dec 29, 2024
575a263
nixos/services.keepalived: remove `with lib;`
Stunkymonkey Dec 29, 2024
9e9a6a2
nixos/services.chrony: remove `with lib;`
Stunkymonkey Dec 29, 2024
2b8f118
nixos/services.ntp: remove `with lib;`
Stunkymonkey Dec 29, 2024
1a8a4ff
nixos/services.openntpd: remove `with lib;`
Stunkymonkey Dec 29, 2024
fc2714c
nixos/services.scion.scion-control: remove `with lib;`
Stunkymonkey Dec 29, 2024
600cc93
nixos/services.scion.scion-daemon: remove `with lib;`
Stunkymonkey Dec 29, 2024
865c886
nixos/services.scion.scion-dispatcher: remove `with lib;`
Stunkymonkey Dec 29, 2024
22777f3
nixos/services.scion.scion-router: remove `with lib;`
Stunkymonkey Dec 29, 2024
4ab2b6f
nixos/services.scion: remove `with lib;`
Stunkymonkey Dec 29, 2024
47cf218
nixos/services.strongswan-swanctl: remove `with lib;`
Stunkymonkey Dec 29, 2024
7b4f0fd
nixos/services.strongswan-swanctl: fmt
Stunkymonkey Dec 29, 2024
0770f7e
nixos/services.v2raya: remove `with lib;`
Stunkymonkey Dec 29, 2024
dceba10
nixos/services.v2raya: fmt
Stunkymonkey Dec 29, 2024
2df9496
nixos/services.vdirsyncer: remove `with lib;`
Stunkymonkey Dec 29, 2024
347302b
nixos/services.vsftpd: remove `with lib;`
Stunkymonkey Dec 29, 2024
d65a788
nixos/services.webhook: remove `with lib;`
Stunkymonkey Dec 29, 2024
41cd653
nixos/services.networking.websockify: remove `with lib;`
Stunkymonkey Dec 29, 2024
fa2b8fd
nixos/services.networking.websockify: fmt
Stunkymonkey Dec 29, 2024
62f02a7
nixos/services.wg-netmanager: remove `with lib;`
Stunkymonkey Dec 29, 2024
e9d6bba
nixos/networking.wg-quick: remove `with lib;`
Stunkymonkey Dec 29, 2024
462823c
nixos/services.wgautomesh: remove `with lib;`
Stunkymonkey Dec 29, 2024
0949986
nixos/services.wgautomesh: fmt
Stunkymonkey Dec 29, 2024
e836261
nixos/networking.wireless: remove `with lib;`
Stunkymonkey Dec 29, 2024
7263275
nixos/networking.wireless: fmt
Stunkymonkey Dec 29, 2024
2e73f2d
nixos/services.x2goserver: remove `with lib;`
Stunkymonkey Dec 29, 2024
c955b48
nixos/services.xandikos: remove `with lib;`
Stunkymonkey Dec 29, 2024
0aa644b
nixos/services.xandikos: fmt
Stunkymonkey Dec 29, 2024
34669b4
nixos/services.xinetd: remove `with lib;`
Stunkymonkey Dec 29, 2024
bd9e620
nixos/services.xl2tpd: remove `with lib;`
Stunkymonkey Dec 29, 2024
31b5009
nixos/services.xray: remove `with lib;`
Stunkymonkey Dec 29, 2024
4d29342
nixos/services.xrdp: remove `with lib;`
Stunkymonkey Dec 29, 2024
e3b588a
nixos/services.zerobin: remove `with lib;`
Stunkymonkey Dec 29, 2024
bb68d79
nixos/services.zerotierone: remove `with lib;`
Stunkymonkey Dec 29, 2024
e78c841
nixos/services.znc: remove `with lib;`
Stunkymonkey Dec 29, 2024
c5d5b0d
nixos/services.printing: remove `with lib;`
Stunkymonkey Dec 29, 2024
36ddee3
nixos/services.atd: remove `with lib;`
Stunkymonkey Dec 29, 2024
4cff1f5
nixos/services.cron: remove `with lib;`
Stunkymonkey Dec 29, 2024
ed7294a
nixos/services.fcron: remove `with lib;`
Stunkymonkey Dec 29, 2024
064afbe
nixos/services.elasticsearch-curator: remove `with lib;`
Stunkymonkey Dec 29, 2024
83c8c6b
nixos/services.elasticsearch: remove `with lib;`
Stunkymonkey Dec 29, 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
4 changes: 0 additions & 4 deletions nixos/modules/installer/netboot/netboot-base.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# This module contains the basic configuration for building netboot
# images

{ lib, ... }:

with lib;

{
imports = [
./netboot.nix
Expand Down
20 changes: 8 additions & 12 deletions nixos/modules/installer/netboot/netboot.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# This module creates netboot media containing the given NixOS
# configuration.

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

with lib;

{
options = {

netboot.squashfsCompression = mkOption {
netboot.squashfsCompression = lib.mkOption {
default = "zstd -Xcompression-level 19";
description = ''
Compression settings to use for the squashfs nix store.
'';
example = "zstd -Xcompression-level 6";
type = types.str;
type = lib.types.str;
};

netboot.storeContents = mkOption {
example = literalExpression "[ pkgs.stdenv ]";
netboot.storeContents = lib.mkOption {
example = lib.literalExpression "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated netboot image.
Expand All @@ -32,27 +28,27 @@ with lib;
# here and it causes a cyclic dependency.
boot.loader.grub.enable = false;

fileSystems."/" = mkImageMediaOverride
fileSystems."/" = lib.mkImageMediaOverride
{ fsType = "tmpfs";
options = [ "mode=0755" ];
};

# In stage 1, mount a tmpfs on top of /nix/store (the squashfs
# image) to make this a live CD.
fileSystems."/nix/.ro-store" = mkImageMediaOverride
fileSystems."/nix/.ro-store" = lib.mkImageMediaOverride
{ fsType = "squashfs";
device = "../nix-store.squashfs";
options = [ "loop" ] ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
neededForBoot = true;
};

fileSystems."/nix/.rw-store" = mkImageMediaOverride
fileSystems."/nix/.rw-store" = lib.mkImageMediaOverride
{ fsType = "tmpfs";
options = [ "mode=0755" ];
neededForBoot = true;
};

fileSystems."/nix/store" = mkImageMediaOverride
fileSystems."/nix/store" = lib.mkImageMediaOverride
{ overlay = {
lowerdir = [ "/nix/.ro-store" ];
upperdir = "/nix/.rw-store/store";
Expand Down
4 changes: 0 additions & 4 deletions nixos/modules/profiles/headless.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Common configuration for headless machines (e.g., Amazon EC2
# instances).

{ lib, ... }:

with lib;

{
# Don't start a tty on the serial consoles.
systemd.services."serial-getty@ttyS0".enable = lib.mkDefault false;
Expand Down
23 changes: 10 additions & 13 deletions nixos/modules/profiles/installation-device.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Provide a basic configuration for installation devices like CDs.
{ config, pkgs, lib, ... }:

with lib;

{
imports =
[ # Enable devices which are usually scanned, because we don't know the
Expand All @@ -23,10 +20,10 @@ with lib;
system.nixos.variant_id = lib.mkDefault "installer";

# Enable in installer, even if the minimal profile disables it.
documentation.enable = mkImageMediaOverride true;
documentation.enable = lib.mkImageMediaOverride true;

# Show the manual.
documentation.nixos.enable = mkImageMediaOverride true;
documentation.nixos.enable = lib.mkImageMediaOverride true;

# Use less privileged nixos user
users.users.nixos = {
Expand All @@ -44,8 +41,8 @@ with lib;

# Allow passwordless sudo from nixos user
security.sudo = {
enable = mkDefault true;
wheelNeedsPassword = mkImageMediaOverride false;
enable = lib.mkDefault true;
wheelNeedsPassword = lib.mkImageMediaOverride false;
};

# Automatically log in at the virtual consoles.
Expand All @@ -62,7 +59,7 @@ with lib;
If you need a wireless connection, type
`sudo systemctl start wpa_supplicant` and configure a
network using `wpa_cli`. See the NixOS manual for details.
'' + optionalString config.services.xserver.enable ''
'' + lib.optionalString config.services.xserver.enable ''

Type `sudo systemctl start display-manager' to
start the graphical user interface.
Expand All @@ -74,14 +71,14 @@ with lib;
# installation device for head-less systems i.e. arm boards by manually
# mounting the storage in a different system.
services.openssh = {
enable = mkDefault true;
settings.PermitRootLogin = mkDefault "yes";
enable = lib.mkDefault true;
settings.PermitRootLogin = lib.mkDefault "yes";
};

# Enable wpa_supplicant, but don't start it by default.
networking.wireless.enable = mkDefault true;
networking.wireless.enable = lib.mkDefault true;
networking.wireless.userControlled.enable = true;
systemd.services.wpa_supplicant.wantedBy = mkOverride 50 [];
systemd.services.wpa_supplicant.wantedBy = lib.mkOverride 50 [];

# Tell the Nix evaluator to garbage collect more aggressively.
# This is desirable in memory-constrained environments that don't
Expand Down Expand Up @@ -114,7 +111,7 @@ with lib;
# Show all debug messages from the kernel but don't log refused packets
# because we have the firewall enabled. This makes installs from the
# console less cumbersome if the machine has a public IP.
networking.firewall.logRefusedConnections = mkDefault false;
networking.firewall.logRefusedConnections = lib.mkDefault false;

# Prevent installation media from evacuating persistent storage, as their
# var directory is not persistent and it would thus result in deletion of
Expand Down
14 changes: 5 additions & 9 deletions nixos/modules/security/rtkit.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# A module for ‘rtkit’, a DBus system service that hands out realtime
# scheduling priority to processes that ask for it.

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

with lib;

let
cfg = config.security.rtkit;
package = pkgs.rtkit;
Expand All @@ -13,8 +9,8 @@ in {

options = {

security.rtkit.enable = mkOption {
type = types.bool;
security.rtkit.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable the RealtimeKit system service, which hands
Expand All @@ -24,8 +20,8 @@ in {
'';
};

security.rtkit.args = mkOption {
type = types.listOf types.str;
security.rtkit.args = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = ''
Command-line options for `rtkit-daemon`.
Expand All @@ -39,7 +35,7 @@ in {
};


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

security.polkit.enable = true;

Expand Down
Loading
Loading