diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-05-17 20:24:46 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 20:24:46 -0300 |
commit | c637afe9c187098c6780963212f409426a19b465 (patch) | |
tree | 50f0ac9510b72462f207c5fa2c0ce53cdad57f7b /nixos/tests | |
parent | 3c41d044393239c3574268a60062a6c3ca74d3c7 (diff) | |
parent | aec8dddef7af66a7a4dc93449a23bdf638d342b6 (diff) |
Merge pull request #229030 from atorres1985-contrib/with-lib-is-bad
With lib is bad: removes `with lib;` occurrences - part I
Diffstat (limited to 'nixos/tests')
57 files changed, 104 insertions, 227 deletions
diff --git a/nixos/tests/3proxy.nix b/nixos/tests/3proxy.nix index 647d9d57c7ffd..83d39de018a39 100644 --- a/nixos/tests/3proxy.nix +++ b/nixos/tests/3proxy.nix @@ -1,8 +1,6 @@ { lib, pkgs, ... }: { name = "3proxy"; - meta = with lib.maintainers; { - maintainers = [ misuzu ]; - }; + meta.maintainers = with lib.maintainers; [ misuzu ]; nodes = { peer0 = { lib, ... }: { diff --git a/nixos/tests/apparmor.nix b/nixos/tests/apparmor.nix index f85bff0295e71..99a5cd558eb02 100644 --- a/nixos/tests/apparmor.nix +++ b/nixos/tests/apparmor.nix @@ -1,14 +1,11 @@ import ./make-test-python.nix ({ pkgs, ... } : { name = "apparmor"; - meta = with pkgs.lib.maintainers; { - maintainers = [ julm ]; - }; + meta.maintainers = with lib.maintainers; [ julm ]; nodes.machine = { lib, pkgs, config, ... }: - with lib; { - security.apparmor.enable = mkDefault true; + security.apparmor.enable = lib.mkDefault true; }; testScript = diff --git a/nixos/tests/atuin.nix b/nixos/tests/atuin.nix index 2bc5494f55565..9f23a3cf6713f 100644 --- a/nixos/tests/atuin.nix +++ b/nixos/tests/atuin.nix @@ -6,10 +6,9 @@ let testPass = "password"; testEmail = "test.testerman@test.com"; in -with lib; { name = "atuin"; - meta.maintainers = with pkgs.lib.maintainers; [ devusb ]; + meta.maintainers = with lib.maintainers; [ devusb ]; nodes = { server = diff --git a/nixos/tests/bazarr.nix b/nixos/tests/bazarr.nix index e59833e5e945d..aa0550e243ae3 100644 --- a/nixos/tests/bazarr.nix +++ b/nixos/tests/bazarr.nix @@ -1,13 +1,11 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - let port = 42069; in { name = "bazarr"; - meta.maintainers = with maintainers; [ d-xo ]; + meta.maintainers = with lib.maintainers; [ d-xo ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/boot-stage1.nix b/nixos/tests/boot-stage1.nix index fbe82d61afaea..7bef34f4cc3d5 100644 --- a/nixos/tests/boot-stage1.nix +++ b/nixos/tests/boot-stage1.nix @@ -107,8 +107,8 @@ import ./make-test-python.nix ({ pkgs, ... }: { ''; }; - copyCanaries = with lib; concatMapStrings (canary: '' - ${optionalString (canary ? child) '' + copyCanaries = lib.concatMapStrings (canary: '' + ${lib.optionalString (canary ? child) '' copy_bin_and_libs "${canary.child}/bin/${canary.child.name}" ''} copy_bin_and_libs "${canary}/bin/${canary.name}" diff --git a/nixos/tests/budgie.nix b/nixos/tests/budgie.nix index 8fe32bb26fbd5..b1b0e618c884c 100644 --- a/nixos/tests/budgie.nix +++ b/nixos/tests/budgie.nix @@ -1,9 +1,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "budgie"; - meta = with lib; { - maintainers = [ maintainers.federicoschonborn ]; - }; + meta.maintainers = [ lib.maintainers.federicoschonborn ]; nodes.machine = { ... }: { imports = [ diff --git a/nixos/tests/cadvisor.nix b/nixos/tests/cadvisor.nix index c372dea301d29..70e068fcf21c4 100644 --- a/nixos/tests/cadvisor.nix +++ b/nixos/tests/cadvisor.nix @@ -1,15 +1,13 @@ -import ./make-test-python.nix ({ pkgs, ... } : { +import ./make-test-python.nix ({ lib, pkgs, ... } : { name = "cadvisor"; - meta = with pkgs.lib.maintainers; { - maintainers = [ offline ]; - }; + meta.maintainers = with lib.maintainers; [ offline ]; nodes = { machine = { ... }: { services.cadvisor.enable = true; }; - influxdb = { lib, ... }: with lib; { + influxdb = { lib, ... }: { services.cadvisor.enable = true; services.cadvisor.storageDriver = "influxdb"; services.influxdb.enable = true; diff --git a/nixos/tests/calibre-web.nix b/nixos/tests/calibre-web.nix index 9832d54697872..aea9bca3ebe90 100644 --- a/nixos/tests/calibre-web.nix +++ b/nixos/tests/calibre-web.nix @@ -5,10 +5,9 @@ import ./make-test-python.nix ( port = 3142; defaultPort = 8083; in - with lib; { name = "calibre-web"; - meta.maintainers = with pkgs.lib.maintainers; [ pborzenkov ]; + meta.maintainers = with lib.maintainers; [ pborzenkov ]; nodes = { customized = { pkgs, ... }: { diff --git a/nixos/tests/cinnamon.nix b/nixos/tests/cinnamon.nix index f0add41429293..e455d96c4fb09 100644 --- a/nixos/tests/cinnamon.nix +++ b/nixos/tests/cinnamon.nix @@ -1,9 +1,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "cinnamon"; - meta = with lib; { - maintainers = teams.cinnamon.members; - }; + meta.maintainers = lib.teams.cinnamon.members; nodes.machine = { nodes, ... }: { imports = [ ./common/user-account.nix ]; diff --git a/nixos/tests/common/acme/server/default.nix b/nixos/tests/common/acme/server/default.nix index b81f860125c88..2a2e3b08a1df4 100644 --- a/nixos/tests/common/acme/server/default.nix +++ b/nixos/tests/common/acme/server/default.nix @@ -76,9 +76,9 @@ let in { imports = [ ../../resolver.nix ]; - options.test-support.acme = with lib; { - caDomain = mkOption { - type = types.str; + options.test-support.acme = { + caDomain = lib.mkOption { + type = lib.types.str; readOnly = true; default = domain; description = lib.mdDoc '' @@ -86,8 +86,8 @@ in { identify the CA server. ''; }; - caCert = mkOption { - type = types.path; + caCert = lib.mkOption { + type = lib.types.path; readOnly = true; default = testCerts.ca.cert; description = lib.mdDoc '' diff --git a/nixos/tests/common/auto.nix b/nixos/tests/common/auto.nix index f2ab82f88ff76..ac56bed4a88f1 100644 --- a/nixos/tests/common/auto.nix +++ b/nixos/tests/common/auto.nix @@ -1,23 +1,16 @@ { config, lib, ... }: -with lib; - let - dmcfg = config.services.xserver.displayManager; cfg = config.test-support.displayManager.auto; - in - { ###### interface options = { - test-support.displayManager.auto = { - - enable = mkOption { + enable = lib.mkOption { default = false; description = lib.mdDoc '' Whether to enable the fake "auto" display manager, which @@ -27,20 +20,16 @@ in ''; }; - user = mkOption { + user = lib.mkOption { default = "root"; description = lib.mdDoc "The user account to login automatically."; }; - }; - }; - ###### implementation - config = mkIf cfg.enable { - + config = lib.mkIf cfg.enable { services.xserver.displayManager = { lightdm.enable = true; autoLogin = { @@ -62,7 +51,5 @@ in session include lightdm ''; - }; - } diff --git a/nixos/tests/convos.nix b/nixos/tests/convos.nix index a5dafed8f6f0b..8fe5892da9e52 100644 --- a/nixos/tests/convos.nix +++ b/nixos/tests/convos.nix @@ -1,14 +1,12 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: -with lib; + let port = 3333; in { name = "convos"; - meta = with pkgs.lib.maintainers; { - maintainers = [ sgo ]; - }; + meta.maintainers = with lib.maintainers; [ sgo ]; nodes = { machine = diff --git a/nixos/tests/couchdb.nix b/nixos/tests/couchdb.nix index b57072d6be2dd..cf6ca8e4548d1 100644 --- a/nixos/tests/couchdb.nix +++ b/nixos/tests/couchdb.nix @@ -1,9 +1,8 @@ let - makeNode = couchpkg: user: passwd: { pkgs, ... } : - { environment.systemPackages = with pkgs; [ jq ]; + { environment.systemPackages = [ pkgs.jq ]; services.couchdb.enable = true; services.couchdb.package = couchpkg; services.couchdb.adminUser = user; @@ -12,16 +11,11 @@ let testuser = "testadmin"; testpass = "cowabunga"; testlogin = "${testuser}:${testpass}@"; - -in import ./make-test-python.nix ({ pkgs, lib, ...}: - -with lib; - +in +import ./make-test-python.nix ({ pkgs, lib, ...}: { name = "couchdb"; - meta = with pkgs.lib.maintainers; { - maintainers = [ ]; - }; + meta.maintainers = [ ]; nodes = { couchdb3 = makeNode pkgs.couchdb3 testuser testpass; diff --git a/nixos/tests/doas.nix b/nixos/tests/doas.nix index 3713c728195ce..2aa8b02caf574 100644 --- a/nixos/tests/doas.nix +++ b/nixos/tests/doas.nix @@ -2,9 +2,7 @@ import ./make-test-python.nix ( { lib, ... }: { name = "doas"; - meta = with lib.maintainers; { - maintainers = [ cole-h ]; - }; + meta.maintainers = with lib.maintainers; [ cole-h ]; nodes.machine = { ... }: diff --git a/nixos/tests/doh-proxy-rust.nix b/nixos/tests/doh-proxy-rust.nix index 11ed87d23bbe6..8c743fe77e328 100644 --- a/nixos/tests/doh-proxy-rust.nix +++ b/nixos/tests/doh-proxy-rust.nix @@ -1,8 +1,6 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { name = "doh-proxy-rust"; - meta = with lib.maintainers; { - maintainers = [ stephank ]; - }; + meta.maintainers = with lib.maintainers; [ stephank ]; nodes = { machine = { pkgs, lib, ... }: { diff --git a/nixos/tests/esphome.nix b/nixos/tests/esphome.nix index b8dbdb0b37957..5a318b65a7231 100644 --- a/nixos/tests/esphome.nix +++ b/nixos/tests/esphome.nix @@ -4,10 +4,9 @@ let testPort = 6052; unixSocket = "/run/esphome/esphome.sock"; in -with lib; { name = "esphome"; - meta.maintainers = with pkgs.lib.maintainers; [ oddlama ]; + meta.maintainers = with lib.maintainers; [ oddlama ]; nodes = { esphomeTcp = { ... }: diff --git a/nixos/tests/fluidd.nix b/nixos/tests/fluidd.nix index f49a4110d7140..82a2c1e4049f3 100644 --- a/nixos/tests/fluidd.nix +++ b/nixos/tests/fluidd.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "fluidd"; - meta.maintainers = with maintainers; [ vtuan10 ]; + meta.maintainers = with lib.maintainers; [ vtuan10 ]; nodes.machine = { pkgs, ... }: { services.fluidd = { diff --git a/nixos/tests/gitlab.nix b/nixos/tests/gitlab.nix index 672b497e7ec68..d4e7603c20caa 100644 --- a/nixos/tests/gitlab.nix +++ b/nixos/tests/gitlab.nix @@ -11,8 +11,6 @@ { pkgs, lib, ... }: -with lib; - let inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey; initialRootPassword = "notproduction"; @@ -30,9 +28,7 @@ let bobProjectId = "3"; in { name = "gitlab"; - meta = with pkgs.lib.maintainers; { - maintainers = [ globin yayayayaka ]; - }; + meta.maintainers = with lib.maintainers; [ globin yayayayaka ]; nodes = { gitlab = { ... }: { @@ -43,10 +39,10 @@ in { virtualisation.useNixStoreImage = true; virtualisation.writableStore = false; - systemd.services.gitlab.serviceConfig.Restart = mkForce "no"; - systemd.services.gitlab-workhorse.serviceConfig.Restart = mkForce "no"; - systemd.services.gitaly.serviceConfig.Restart = mkForce "no"; - systemd.services.gitlab-sidekiq.serviceConfig.Restart = mkForce "no"; + systemd.services.gitlab.serviceConfig.Restart = lib.mkForce "no"; + systemd.services.gitlab-workhorse.serviceConfig.Restart = lib.mkForce "no"; + systemd.services.gitaly.serviceConfig.Restart = lib.mkForce "no"; + systemd.services.gitlab-sidekiq.serviceConfig.Restart = lib.mkForce "no"; services.nginx = { enable = true; @@ -195,7 +191,7 @@ in { gitlab.succeed( "echo \"Authorization: Bearer $(curl -X POST -H 'Content-Type: application/json' -d @${auth} http://gitlab/oauth/token | ${pkgs.jq}/bin/jq -r '.access_token')\" >/tmp/headers" ) - '' + optionalString doSetup '' + '' + lib.optionalString doSetup '' with subtest("Create user Alice"): gitlab.succeed( """[ "$(curl -o /dev/null -w '%{http_code}' -X POST -H 'Content-Type: application/json' -H @/tmp/headers -d @${createUserAlice} http://gitlab/api/v4/users)" = "201" ]""" diff --git a/nixos/tests/gnome-flashback.nix b/nixos/tests/gnome-flashback.nix index c97264e6928a0..70569db797ec9 100644 --- a/nixos/tests/gnome-flashback.nix +++ b/nixos/tests/gnome-flashback.nix @@ -1,12 +1,11 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { name = "gnome-flashback"; - meta = with lib; { - maintainers = teams.gnome.members ++ [ maintainers.chpatrick ]; - }; + meta.maintainers = lib.teams.gnome.members ++ [ lib.maintainers.chpatrick ]; - nodes.machine = { nodes, ... }: let - user = nodes.machine.config.users.users.alice; - in + nodes.machine = { nodes, ... }: + let + user = nodes.machine.config.users.users.alice; + in { imports = [ ./common/user-account.nix ]; diff --git a/nixos/tests/gnome-xorg.nix b/nixos/tests/gnome-xorg.nix index d616d4f02351a..7762fff5c3a25 100644 --- a/nixos/tests/gnome-xorg.nix +++ b/nixos/tests/gnome-xorg.nix @@ -1,7 +1,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { name = "gnome-xorg"; - meta = with lib; { - maintainers = teams.gnome.members; + meta = { + maintainers = lib.teams.gnome.members; }; nodes.machine = { nodes, ... }: let diff --git a/nixos/tests/gnome.nix b/nixos/tests/gnome.nix index 5a28e3bb0e810..9aa88c4852c07 100644 --- a/nixos/tests/gnome.nix +++ b/nixos/tests/gnome.nix @@ -1,8 +1,6 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { name = "gnome"; - meta = with lib; { - maintainers = teams.gnome.members; - }; + meta.maintainers = lib.teams.gnome.members; nodes.machine = { ... }: diff --git a/nixos/tests/hadoop/hdfs.nix b/nixos/tests/hadoop/hdfs.nix index 9415500463dec..429d4bf6b5389 100644 --- a/nixos/tests/hadoop/hdfs.nix +++ b/nixos/tests/hadoop/hdfs.nix @@ -1,6 +1,5 @@ # Test a minimal HDFS cluster with no HA import ../make-test-python.nix ({ package, lib, ... }: -with lib; { name = "hadoop-hdfs"; @@ -22,7 +21,7 @@ with lib; }; httpfs = { # The NixOS hadoop module only support webHDFS on 3.3 and newer - enable = mkIf (versionAtLeast package.version "3.3") true; + enable = lib.mkIf (lib.versionAtLeast package.version "3.3") true; openFirewall = true; }; }; @@ -57,7 +56,7 @@ with lib; datanode.wait_for_unit("hdfs-datanode") datanode.wait_for_unit("network.target") - '' + ( if versionAtLeast package.version "3" then '' + '' + (if lib.versionAtLeast package.version "3" then '' datanode.wait_for_open_port(9864) datanode.wait_for_open_port(9866) datanode.wait_for_open_port(9867) @@ -76,7 +75,7 @@ with lib; datanode.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile") assert "testfilecontents" in datanode.succeed("sudo -u hdfs hdfs dfs -cat /testfile") - '' + optionalString ( versionAtLeast package.version "3.3" ) '' + '' + lib.optionalString (lib.versionAtLeast package.version "3.3" ) '' namenode.wait_for_unit("hdfs-httpfs") namenode.wait_for_open_port(14000) assert "testfilecontents" in datanode.succeed("curl -f \"http://namenode:14000/webhdfs/v1/testfile?user.name=hdfs&op=OPEN\" 2>&1") diff --git a/nixos/tests/hardened.nix b/nixos/tests/hardened.nix index ccb8581685478..f54506224e51f 100644 --- a/nixos/tests/hardened.nix +++ b/nixos/tests/hardened.nix @@ -6,7 +6,6 @@ import ./make-test-python.nix ({ pkgs, ... } : { nodes.machine = { lib, pkgs, config, ... }: - with lib; { users.users.alice = { isNormalUser = true; extraGroups = [ "proc" ]; }; users.users.sybil = { isNormalUser = true; group = "wheel"; }; imports = [ ../modules/profiles/hardened.nix ]; diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix index 4d0b53e95b32a..24b4ed382c126 100644 --- a/nixos/tests/hibernate.nix +++ b/nixos/tests/hibernate.nix @@ -46,14 +46,14 @@ in makeTest { nodes = { # System configuration used for installing the installedConfig from above. - machine = { config, lib, pkgs, ... }: with lib; { + machine = { config, lib, pkgs, ... }: { imports = [ ../modules/profiles/installation-device.nix ../modules/profiles/base.nix ]; nix.settings = { - substituters = mkForce []; + substituters = lib.mkForce []; hashed-mirrors = null; connect-timeout = 1; }; diff --git a/nixos/tests/iftop.nix b/nixos/tests/iftop.nix index 6d0090b39463d..933f115a8a5ad 100644 --- a/nixos/tests/iftop.nix +++ b/nixos/tests/iftop.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: -with lib; - { name = "iftop"; - meta.maintainers = with pkgs.lib.maintainers; [ ma27 ]; + meta.maintainers = with lib.maintainers; [ ma27 ]; nodes = { withIftop = { diff --git a/nixos/tests/jackett.nix b/nixos/tests/jackett.nix index 0a706c99b999d..bc8b724e8b4b6 100644 --- a/nixos/tests/jackett.nix +++ b/nixos/tests/jackett.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "jackett"; - meta.maintainers = with maintainers; [ etu ]; + meta.maintainers = with lib.maintainers; [ etu ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/jirafeau.nix b/nixos/tests/jirafeau.nix index 0f5af7f718a40..dbfaf515e2576 100644 --- a/nixos/tests/jirafeau.nix +++ b/nixos/tests/jirafeau.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "jirafeau"; - meta.maintainers = with maintainers; [ davidtwco ]; + meta.maintainers = with lib.maintainers; [ davidtwco ]; nodes.machine = { pkgs, ... }: { services.jirafeau = { diff --git a/nixos/tests/komga.nix b/nixos/tests/komga.nix index 02db50ef25f72..d48d19bbbdd37 100644 --- a/nixos/tests/komga.nix +++ b/nixos/tests/komga.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "komga"; - meta.maintainers = with maintainers; [ govanify ]; + meta.maintainers = with lib.maintainers; [ govanify ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/libreddit.nix b/nixos/tests/libreddit.nix index 82a44cb4e9cb3..ecf347b9e12e4 100644 --- a/nixos/tests/libreddit.nix +++ b/nixos/tests/libreddit.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "libreddit"; - meta.maintainers = with maintainers; [ fab ]; + meta.maintainers = with lib.maintainers; [ fab ]; nodes.machine = { services.libreddit.enable = true; diff --git a/nixos/tests/lidarr.nix b/nixos/tests/lidarr.nix index 7fbaea62f80e6..8230dda53736c 100644 --- a/nixos/tests/lidarr.nix +++ b/nixos/tests/lidarr.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "lidarr"; - meta.maintainers = with maintainers; [ etu ]; + meta.maintainers = with lib.maintainers; [ etu ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/miniflux.nix b/nixos/tests/miniflux.nix index d905aea048a3a..be3e7abb6abd4 100644 --- a/nixos/tests/miniflux.nix +++ b/nixos/tests/miniflux.nix @@ -17,10 +17,9 @@ let ''; in -with lib; { name = "miniflux"; - meta.maintainers = with pkgs.lib.maintainers; [ ]; + meta.maintainers = [ ]; nodes = { default = diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix index 0d5f0fe2f044c..442b45948c608 100644 --- a/nixos/tests/misc.nix +++ b/nixos/tests/misc.nix @@ -1,20 +1,17 @@ # Miscellaneous small tests that don't warrant their own VM run. -import ./make-test-python.nix ({ pkgs, ...} : let +import ./make-test-python.nix ({ lib, pkgs, ...} : let foo = pkgs.writeText "foo" "Hello World"; in { name = "misc"; - meta = with pkgs.lib.maintainers; { - maintainers = [ eelco ]; - }; + meta.maintainers = with lib.maintainers; [ eelco ]; nodes.machine = { lib, ... }: - with lib; - { swapDevices = mkOverride 0 + { swapDevices = lib.mkOverride 0 [ { device = "/root/swapfile"; size = 128; } ]; - environment.variables.EDITOR = mkOverride 0 "emacs"; - documentation.nixos.enable = mkOverride 0 true; + environment.variables.EDITOR = lib.mkOverride 0 "emacs"; + documentation.nixos.enable = lib.mkOverride 0 true; systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ]; virtualisation.fileSystems = { "/tmp2" = { fsType = "tmpfs"; @@ -32,7 +29,7 @@ in { options = [ "bind" "rw" "noauto" ]; }; }; - systemd.automounts = singleton + systemd.automounts = lib.singleton { wantedBy = [ "multi-user.target" ]; where = "/tmp2"; }; diff --git a/nixos/tests/mpv.nix b/nixos/tests/mpv.nix index a4803f3cb5b55..32a81cbe2495e 100644 --- a/nixos/tests/mpv.nix +++ b/nixos/tests/mpv.nix @@ -1,13 +1,11 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - let port = toString 4321; in { name = "mpv"; - meta.maintainers = with maintainers; [ zopieux ]; + meta.maintainers = with lib.maintainers; [ zopieux ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/n8n.nix b/nixos/tests/n8n.nix index 044240fbce7f1..771296bf37a5a 100644 --- a/nixos/tests/n8n.nix +++ b/nixos/tests/n8n.nix @@ -1,13 +1,10 @@ import ./make-test-python.nix ({ lib, ... }: - -with lib; - let port = 5678; in { name = "n8n"; - meta.maintainers = with maintainers; [ freezeboy k900 ]; + meta.maintainers = with lib.maintainers; [ freezeboy k900 ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/nfs/kerberos.nix b/nixos/tests/nfs/kerberos.nix index 5684131f671b1..a7d08bc628c62 100644 --- a/nixos/tests/nfs/kerberos.nix +++ b/nixos/tests/nfs/kerberos.nix @@ -1,7 +1,5 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: -with lib; - let krb5 = { enable = true; diff --git a/nixos/tests/noto-fonts.nix b/nixos/tests/noto-fonts.nix index e4c33fe26a9e6..0515f16d101cd 100644 --- a/nixos/tests/noto-fonts.nix +++ b/nixos/tests/noto-fonts.nix @@ -1,8 +1,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "noto-fonts"; - meta = { - maintainers = with lib.maintainers; [ nickcao midchildan ]; - }; + meta.maintainers = with lib.maintainers; [ nickcao midchildan ]; nodes.machine = { imports = [ ./common/x11.nix ]; diff --git a/nixos/tests/nzbhydra2.nix b/nixos/tests/nzbhydra2.nix index c82c756c3a1ce..e1d528cd9520e 100644 --- a/nixos/tests/nzbhydra2.nix +++ b/nixos/tests/nzbhydra2.nix @@ -1,10 +1,7 @@ import ./make-test-python.nix ({ lib, ... }: - - with lib; - { name = "nzbhydra2"; - meta.maintainers = with maintainers; [ jamiemagee ]; + meta.maintainers = with lib.maintainers; [ jamiemagee ]; nodes.machine = { pkgs, ... }: { services.nzbhydra2.enable = true; }; diff --git a/nixos/tests/oci-containers.nix b/nixos/tests/oci-containers.nix index 1bcfb276dbeea..1afa9df36dfa4 100644 --- a/nixos/tests/oci-containers.nix +++ b/nixos/tests/oci-containers.nix @@ -11,9 +11,8 @@ let mkOCITest = backend: makeTest { name = "oci-containers-${backend}"; - meta = { - maintainers = with lib.maintainers; [ adisbladis benley mkaito ] ++ lib.teams.serokell.members; - }; + meta.maintainers = lib.teams.serokell.members + ++ (with lib.maintainers; [ adisbladis benley mkaito ]); nodes = { ${backend} = { pkgs, ... }: { diff --git a/nixos/tests/odoo.nix b/nixos/tests/odoo.nix index 96e3405482b41..7c2cf31370f9d 100644 --- a/nixos/tests/odoo.nix +++ b/nixos/tests/odoo.nix @@ -1,8 +1,6 @@ -import ./make-test-python.nix ({ pkgs, lib, ...} : with lib; { +import ./make-test-python.nix ({ pkgs, lib, ...} : { name = "odoo"; - meta = with pkgs.lib.maintainers; { - maintainers = [ mkg20001 ]; - }; + meta.maintainers = with lib.maintainers; [ mkg20001 ]; nodes = { server = { ... }: { diff --git a/nixos/tests/ombi.nix b/nixos/tests/ombi.nix index ce3064ce6ac68..fb3a37c978e3b 100644 --- a/nixos/tests/ombi.nix +++ b/nixos/tests/ombi.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "ombi"; - meta.maintainers = with maintainers; [ woky ]; + meta.maintainers = with lib.maintainers; [ woky ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 0b920c7a6d5f4..653fcc6edad11 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -3,9 +3,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { name = "pantheon"; - meta = with lib; { - maintainers = teams.pantheon.members; - }; + meta.maintainers = lib.teams.pantheon.members; nodes.machine = { ... }: diff --git a/nixos/tests/please.nix b/nixos/tests/please.nix index 2437cfe16130f..af825ae4b9b3c 100644 --- a/nixos/tests/please.nix +++ b/nixos/tests/please.nix @@ -6,10 +6,10 @@ import ./make-test-python.nix ({ lib, ... }: nodes.machine = { ... }: { - users.users = with lib; mkMerge [ - (listToAttrs (map - (n: nameValuePair n { isNormalUser = true; }) - (genList (x: "user${toString x}") 6))) + users.users = lib.mkMerge [ + (lib.listToAttrs (map + (n: lib.nameValuePair n { isNormalUser = true; }) + (lib.genList (x: "user${toString x}") 6))) { user0.extraGroups = [ "wheel" ]; } diff --git a/nixos/tests/polaris.nix b/nixos/tests/polaris.nix index fb2e67f075aac..bb105d600032f 100644 --- a/nixos/tests/polaris.nix +++ b/nixos/tests/polaris.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "polaris"; - meta.maintainers = with maintainers; [ pbsds ]; + meta.maintainers = with lib.maintainers; [ pbsds ]; nodes.machine = { pkgs, ... }: { diff --git a/nixos/tests/prowlarr.nix b/nixos/tests/prowlarr.nix index 144cbd5fc95d5..af669afd57004 100644 --- a/nixos/tests/prowlarr.nix +++ b/nixos/tests/prowlarr.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "prowlarr"; - meta.maintainers = with maintainers; [ jdreaver ]; + meta.maintainers = with lib.maintainers; [ jdreaver ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/quake3.nix b/nixos/tests/quake3.nix index ef5fcc41476bc..2d8c5207001cb 100644 --- a/nixos/tests/quake3.nix +++ b/nixos/tests/quake3.nix @@ -11,11 +11,11 @@ let }; # Only allow the demo data to be used (only if it's unfreeRedistributable). - unfreePredicate = pkg: with lib; let + unfreePredicate = pkg: let allowPackageNames = [ "quake3-demodata" "quake3-pointrelease" ]; allowLicenses = [ lib.licenses.unfreeRedistributable ]; - in elem pkg.pname allowPackageNames && - elem (pkg.meta.license or null) allowLicenses; + in lib.elem pkg.pname allowPackageNames && + lib.elem (pkg.meta.license or null) allowLicenses; client = { pkgs, ... }: diff --git a/nixos/tests/radarr.nix b/nixos/tests/radarr.nix index 85fd6572f0617..bf9eb11c2b126 100644 --- a/nixos/tests/radarr.nix +++ b/nixos/tests/radarr.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "radarr"; - meta.maintainers = with maintainers; [ etu ]; + meta.maintainers = with lib.maintainers; [ etu ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/readarr.nix b/nixos/tests/readarr.nix index bb7dd85298486..7c144e2ee02f5 100644 --- a/nixos/tests/readarr.nix +++ b/nixos/tests/readarr.nix @@ -1,10 +1,6 @@ -import ./make-test-python.nix ({ lib, ... }: - -with lib; - -{ +import ./make-test-python.nix ({ lib, ... }: { name = "readarr"; - meta.maintainers = with maintainers; [ jocelynthode ]; + meta.maintainers = with lib.maintainers; [ jocelynthode ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/redis.nix b/nixos/tests/redis.nix index abea1657f3ead..94b50d07be6dc 100644 --- a/nixos/tests/redis.nix +++ b/nixos/tests/redis.nix @@ -1,19 +1,17 @@ -import ./make-test-python.nix ({ pkgs, ... }: +import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "redis"; - meta = with pkgs.lib.maintainers; { - maintainers = [ flokli ]; - }; + meta.maintainers = with lib.maintainers; [ flokli ]; nodes = { machine = - { pkgs, lib, ... }: with lib; + { pkgs, lib, ... }: { services.redis.servers."".enable = true; services.redis.servers."test".enable = true; - users.users = listToAttrs (map (suffix: nameValuePair "member${suffix}" { + users.users = lib.listToAttrs (map (suffix: lib.nameValuePair "member${suffix}" { createHome = false; description = "A member of the redis${suffix} group"; isNormalUser = true; diff --git a/nixos/tests/sonarr.nix b/nixos/tests/sonarr.nix index bdfc8916cb7f9..57e6b72db3a35 100644 --- a/nixos/tests/sonarr.nix +++ b/nixos/tests/sonarr.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "sonarr"; - meta.maintainers = with maintainers; [ etu ]; + meta.maintainers = with lib.maintainers; [ etu ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/sudo.nix b/nixos/tests/sudo.nix index 661fe9989e7a8..3b6028c6f0b09 100644 --- a/nixos/tests/sudo.nix +++ b/nixos/tests/sudo.nix @@ -2,17 +2,13 @@ let password = "helloworld"; - in - import ./make-test-python.nix ({ pkgs, ...} : { + import ./make-test-python.nix ({ lib, pkgs, ...} : { name = "sudo"; - meta = with pkgs.lib.maintainers; { - maintainers = [ lschuermann ]; - }; + meta.maintainers = with lib.maintainers; [ lschuermann ]; nodes.machine = { lib, ... }: - with lib; { users.groups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; }; users.users = { diff --git a/nixos/tests/systemd-timesyncd.nix b/nixos/tests/systemd-timesyncd.nix index ad5b9a47383bd..43abd36c47d97 100644 --- a/nixos/tests/systemd-timesyncd.nix +++ b/nixos/tests/systemd-timesyncd.nix @@ -11,11 +11,11 @@ in { name = "systemd-timesyncd"; nodes = { current = mkVM {}; - pre1909 = mkVM ({lib, ... }: with lib; { + pre1909 = mkVM ({lib, ... }: { # create the path that should be migrated by our activation script when # upgrading to a newer nixos version system.stateVersion = "19.03"; - system.activationScripts.simulate-old-timesync-state-dir = mkBefore '' + system.activationScripts.simulate-old-timesync-state-dir = lib.mkBefore '' rm -f /var/lib/systemd/timesync mkdir -p /var/lib/systemd /var/lib/private/systemd/timesync ln -s /var/lib/private/systemd/timesync /var/lib/systemd/timesync diff --git a/nixos/tests/tor.nix b/nixos/tests/tor.nix index 71ec9df4641fa..b55fbf91232cb 100644 --- a/nixos/tests/tor.nix +++ b/nixos/tests/tor.nix @@ -1,15 +1,13 @@ -import ./make-test-python.nix ({ lib, ... }: with lib; - -{ +import ./make-test-python.nix ({ lib, ... }: { name = "tor"; - meta.maintainers = with maintainers; [ joachifm ]; + meta.maintainers = with lib.maintainers; [ joachifm ]; nodes.client = { pkgs, ... }: { boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ]; networking.firewall.enable = false; networking.useDHCP = false; - environment.systemPackages = with pkgs; [ netcat ]; + environment.systemPackages = [ pkgs.netcat ]; services.tor.enable = true; services.tor.client.enable = true; services.tor.settings.ControlPort = 9051; diff --git a/nixos/tests/ulogd.nix b/nixos/tests/ulogd.nix index ce52d855ffc28..d351fdae79836 100644 --- a/nixos/tests/ulogd.nix +++ b/nixos/tests/ulogd.nix @@ -1,9 +1,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "ulogd"; - meta = with lib; { - maintainers = with maintainers; [ p-h ]; - }; + meta.maintainers = with lib.maintainers; [ p-h ]; nodes.machine = { ... }: { networking.firewall.enable = false; diff --git a/nixos/tests/uptime-kuma.nix b/nixos/tests/uptime-kuma.nix index 3d588d73cdb5c..00e2008a5257d 100644 --- a/nixos/tests/uptime-kuma.nix +++ b/nixos/tests/uptime-kuma.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ lib, ... }: -with lib; - { name = "uptime-kuma"; - meta.maintainers = with maintainers; [ julienmalka ]; + meta.maintainers = with lib.maintainers; [ julienmalka ]; nodes.machine = { pkgs, ... }: diff --git a/nixos/tests/xautolock.nix b/nixos/tests/xautolock.nix index 529567e07971f..cf81c4a1cf05d 100644 --- a/nixos/tests/xautolock.nix +++ b/nixos/tests/xautolock.nix @@ -1,10 +1,8 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: -with lib; - { name = "xautolock"; - meta.maintainers = with pkgs.lib.maintainers; [ ]; + meta.maintainers = [ ]; nodes.machine = { imports = [ ./common/x11.nix ./common/user-account.nix ]; diff --git a/nixos/tests/xss-lock.nix b/nixos/tests/xss-lock.nix index c927d9274e65c..e4e41a5aa7978 100644 --- a/nixos/tests/xss-lock.nix +++ b/nixos/tests/xss-lock.nix @@ -1,10 +1,6 @@ -import ./make-test-python.nix ({ pkgs, lib, ... }: - -with lib; - -{ +import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "xss-lock"; - meta.maintainers = with pkgs.lib.maintainers; [ ]; + meta.maintainers = [ ]; nodes = { simple = { diff --git a/nixos/tests/yabar.nix b/nixos/tests/yabar.nix index ff7a47ae63709..212a8ce4bbf5f 100644 --- a/nixos/tests/yabar.nix +++ b/nixos/tests/yabar.nix @@ -1,12 +1,6 @@ -import ./make-test-python.nix ({ pkgs, lib, ... }: - -with lib; - -{ +import ./make-test-python.nix ({ pkgs, lib, ... }: { name = "yabar"; - meta = with pkgs.lib.maintainers; { - maintainers = [ ]; - }; + meta.maintainers = [ ]; nodes.machine = { imports = [ ./common/x11.nix ./common/user-account.nix ]; |