From 85a7b22c6e3fea97f2b0b6b9435c6c6298157b58 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 14 Jan 2023 00:13:32 -0300 Subject: [PATCH 01/62] nixos/maintainers/scripts/cloudstack/cloudstack-image.nix: get rid of `with lib` --- nixos/maintainers/scripts/cloudstack/cloudstack-image.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/maintainers/scripts/cloudstack/cloudstack-image.nix b/nixos/maintainers/scripts/cloudstack/cloudstack-image.nix index 005f75476e9a..b66ee5d7b9bc 100644 --- a/nixos/maintainers/scripts/cloudstack/cloudstack-image.nix +++ b/nixos/maintainers/scripts/cloudstack/cloudstack-image.nix @@ -2,8 +2,6 @@ { config, lib, pkgs, ... }: -with lib; - { imports = [ ../../../modules/virtualisation/cloudstack-config.nix ]; From 0a1db3863228537d88667e0731fe7af5d9912a60 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 14 Jan 2023 00:14:00 -0300 Subject: [PATCH 02/62] nixos/maintainers/scripts/lxd/lxd-image-inner.nix: get rid of `with lib` --- nixos/maintainers/scripts/lxd/lxd-image-inner.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/maintainers/scripts/lxd/lxd-image-inner.nix b/nixos/maintainers/scripts/lxd/lxd-image-inner.nix index ee55da1e9ce2..c1a9b1aacd18 100644 --- a/nixos/maintainers/scripts/lxd/lxd-image-inner.nix +++ b/nixos/maintainers/scripts/lxd/lxd-image-inner.nix @@ -4,8 +4,6 @@ { config, pkgs, lib, ... }: -with lib; - { imports = [ # Include the default lxd configuration. From 80f0839fde4c38ebce05a4f896542f9bd56d9e7c Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 14 Jan 2023 00:14:50 -0300 Subject: [PATCH 03/62] nixos/maintainers/scripts/lxd/lxd-image.nix: get rid of `with lib` --- nixos/maintainers/scripts/lxd/lxd-image.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/maintainers/scripts/lxd/lxd-image.nix b/nixos/maintainers/scripts/lxd/lxd-image.nix index cf30836dffe5..07605c5c3120 100644 --- a/nixos/maintainers/scripts/lxd/lxd-image.nix +++ b/nixos/maintainers/scripts/lxd/lxd-image.nix @@ -1,7 +1,5 @@ { lib, config, pkgs, ... }: -with lib; - { imports = [ ../../../modules/virtualisation/lxc-container.nix From 1be3d3633602fe85821990d0c054ce6b040e7b34 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 14 Jan 2023 00:15:35 -0300 Subject: [PATCH 04/62] nixos/maintainers/scripts/lxd/nix.tpl: get rid of `with lib` --- nixos/maintainers/scripts/lxd/nix.tpl | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/maintainers/scripts/lxd/nix.tpl b/nixos/maintainers/scripts/lxd/nix.tpl index 307258ddc628..25ae1bc399f2 100644 --- a/nixos/maintainers/scripts/lxd/nix.tpl +++ b/nixos/maintainers/scripts/lxd/nix.tpl @@ -1,7 +1,5 @@ { lib, config, pkgs, ... }: -with lib; - # WARNING: THIS CONFIGURATION IS AUTOGENERATED AND WILL BE OVERWRITTEN AUTOMATICALLY { From 4c6a14172058ba37527da454f37a513d35a3a1c7 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:10:50 -0300 Subject: [PATCH 05/62] nixos/modules/rename.nix: get rid of `with lib` --- nixos/modules/rename.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 45a27029dff1..a4a2c316fd6c 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -1,7 +1,10 @@ { lib, pkgs, ... }: -with lib; - +let + inherit (lib) + mkAliasOptionModuleMD + mkRemovedOptionModule; +in { imports = [ /* From d87f1b8c9f6060319b277f089f6e698de3fd1567 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 14 Jan 2023 00:19:27 -0300 Subject: [PATCH 06/62] nixos/tests/hardened.nix: get rid of `with lib` --- nixos/tests/hardened.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/tests/hardened.nix b/nixos/tests/hardened.nix index ccb858168547..f54506224e51 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 ]; From 5bba43ec576f2d8ffb4119c2383233df8f912398 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 14 Jan 2023 00:21:23 -0300 Subject: [PATCH 07/62] nixos/tests/nfs/kerberos.nix: get rid of `with lib` --- nixos/tests/nfs/kerberos.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/tests/nfs/kerberos.nix b/nixos/tests/nfs/kerberos.nix index 5684131f671b..a7d08bc628c6 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; From dc5919aa58b1967264f07459fd6343ed3d4bc9de Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 18:44:45 -0300 Subject: [PATCH 08/62] nixos/tests/quake3.nix: get rid of `with lib` --- nixos/tests/quake3.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/tests/quake3.nix b/nixos/tests/quake3.nix index ef5fcc41476b..2d8c5207001c 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, ... }: From 047734d8e6bc7aa8c4b26cdaf583e6ab9cf3d4ac Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 09/62] nixos/tests/boot-stage1.nix: get rid of `with lib` --- nixos/tests/boot-stage1.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/boot-stage1.nix b/nixos/tests/boot-stage1.nix index fbe82d61afae..7bef34f4cc3d 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}" From b5a6dff664b0f60a4e9fde6f48e1e97def093b20 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 10/62] nixos/tests/budgie.nix: get rid of `with lib` --- nixos/tests/budgie.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/budgie.nix b/nixos/tests/budgie.nix index a2599572b3bf..ff6bd3128195 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 = [ From 87586867d6b73a4bbd8578da478a4e20257a2799 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 11/62] nixos/tests/calibre-web.nix: get rid of `with lib` --- nixos/tests/calibre-web.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/tests/calibre-web.nix b/nixos/tests/calibre-web.nix index 9832d5469787..aea9bca3ebe9 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, ... }: { From 7aa945d9496f3fee0184e939052ce94d30079430 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 12/62] nixos/tests/cinnamon.nix: get rid of `with lib` --- nixos/tests/cinnamon.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/cinnamon.nix b/nixos/tests/cinnamon.nix index f0add4142929..e455d96c4fb0 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 ]; From 4e180394490ee15caeb742982e7f3bb6e27bca94 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 13/62] nixos/tests/convos.nix: get rid of `with lib` --- nixos/tests/convos.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nixos/tests/convos.nix b/nixos/tests/convos.nix index a5dafed8f6f0..8fe5892da9e5 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 = From defe8992398696ff8ef97201e1536e371db2ab59 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 14/62] nixos/tests/fluidd.nix: get rid of `with lib` --- nixos/tests/fluidd.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/fluidd.nix b/nixos/tests/fluidd.nix index f49a4110d714..82a2c1e4049f 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 = { From b51ac3bd4c4dffb8b4e99df763b596fa0e9e41df Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:04 -0300 Subject: [PATCH 15/62] nixos/tests/gnome-flashback.nix: get rid of `with lib` --- nixos/tests/gnome-flashback.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nixos/tests/gnome-flashback.nix b/nixos/tests/gnome-flashback.nix index c97264e6928a..70569db797ec 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 ]; From ca96a578a54963c2400de0d4592796d781093d5b Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 16/62] nixos/tests/gnome-xorg.nix: get rid of `with lib` --- nixos/tests/gnome-xorg.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/gnome-xorg.nix b/nixos/tests/gnome-xorg.nix index d616d4f02351..7762fff5c3a2 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 From 3002c44f4811f0c32ebb82251c41e3917dedf9fb Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 17/62] nixos/tests/gnome.nix: get rid of `with lib` --- nixos/tests/gnome.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/gnome.nix b/nixos/tests/gnome.nix index 5a28e3bb0e81..9aa88c4852c0 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 = { ... }: From d1a2a4cbccd45e7ff3b32c0f073eb04d42651329 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 18/62] nixos/tests/hibernate.nix: get rid of `with lib` --- nixos/tests/hibernate.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix index 4d0b53e95b32..24b4ed382c12 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; }; From 70e8a86b2b1e06c8daec4120c5c506f9674b7e5c Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 19/62] nixos/tests/pantheon.nix: get rid of `with lib` --- nixos/tests/pantheon.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 0b920c7a6d5f..653fcc6edad1 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 = { ... }: From 714180048b5cf2ea0baa4fbc1632669882f1da0d Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 20/62] nixos/tests/redis.nix: get rid of `with lib` --- nixos/tests/redis.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/tests/redis.nix b/nixos/tests/redis.nix index abea1657f3ea..94b50d07be6d 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; From f872db7aed7bec423dbe332cc2946f2db5bbc57f Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 21/62] nixos/tests/ulogd.nix: get rid of `with lib` --- nixos/tests/ulogd.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/ulogd.nix b/nixos/tests/ulogd.nix index ce52d855ffc2..d351fdae7983 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; From 75a76768fe9d81f38f3640862805c2d9086445f4 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 29 Apr 2023 22:17:05 -0300 Subject: [PATCH 22/62] nixos/tests/xautolock.nix: get rid of `with lib` --- nixos/tests/xautolock.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/xautolock.nix b/nixos/tests/xautolock.nix index 529567e07971..cf81c4a1cf05 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 ]; From 5202b743058166133051bbf980cba8136b97f093 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:15 -0300 Subject: [PATCH 23/62] nixos/tests/3proxy.nix: get rid of `with lib` --- nixos/tests/3proxy.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/3proxy.nix b/nixos/tests/3proxy.nix index 647d9d57c7ff..83d39de018a3 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, ... }: { From 5252e855952c555469f081306584dd8a12959ded Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:15 -0300 Subject: [PATCH 24/62] nixos/tests/apparmor.nix: get rid of `with lib` --- nixos/tests/apparmor.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/tests/apparmor.nix b/nixos/tests/apparmor.nix index f85bff0295e7..99a5cd558eb0 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 = From a4af083f62896a460d6904d13a099672c4fb6563 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:15 -0300 Subject: [PATCH 25/62] nixos/tests/atuin.nix: get rid of `with lib` --- nixos/tests/atuin.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/tests/atuin.nix b/nixos/tests/atuin.nix index 2bc5494f5556..9f23a3cf6713 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 = From 6d1287bb756d22111e3770fbd24cb43629152759 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:15 -0300 Subject: [PATCH 26/62] nixos/tests/bazarr.nix: get rid of `with lib` --- nixos/tests/bazarr.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/bazarr.nix b/nixos/tests/bazarr.nix index e59833e5e945..aa0550e243ae 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, ... }: From ba6bc92d5edeb9cc8055bb43e767dcb84a6d9f37 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:15 -0300 Subject: [PATCH 27/62] nixos/tests/cadvisor.nix: get rid of `with lib` --- nixos/tests/cadvisor.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nixos/tests/cadvisor.nix b/nixos/tests/cadvisor.nix index c372dea301d2..70e068fcf21c 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; From 334b168990a27099ae0a42bc3b9fe6b88c146adc Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:15 -0300 Subject: [PATCH 28/62] nixos/tests/common/acme/server/default.nix: get rid of `with lib` --- nixos/tests/common/acme/server/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nixos/tests/common/acme/server/default.nix b/nixos/tests/common/acme/server/default.nix index b81f860125c8..2a2e3b08a1df 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 '' From 5ee5e4bb465cd7530e5f01de779334ca6cdc7870 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 29/62] nixos/tests/common/auto.nix: get rid of `with lib` --- nixos/tests/common/auto.nix | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/nixos/tests/common/auto.nix b/nixos/tests/common/auto.nix index f2ab82f88ff7..ac56bed4a88f 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 ''; - }; - } From a137b4161d6b7ccb4312dc07c5c90ccaa85e5a85 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 30/62] nixos/tests/couchdb.nix: get rid of `with lib` --- nixos/tests/couchdb.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/nixos/tests/couchdb.nix b/nixos/tests/couchdb.nix index b57072d6be2d..cf6ca8e4548d 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; From 18d90beb1ad6ad9703937752837f0d326913c6c9 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 31/62] nixos/tests/doas.nix: get rid of `with lib` --- nixos/tests/doas.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/doas.nix b/nixos/tests/doas.nix index 3713c728195c..2aa8b02caf57 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 = { ... }: From 1792f2c61c78d6232e8597b574c2b096420c7193 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 32/62] nixos/tests/doh-proxy-rust.nix: get rid of `with lib` --- nixos/tests/doh-proxy-rust.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/doh-proxy-rust.nix b/nixos/tests/doh-proxy-rust.nix index 11ed87d23bbe..8c743fe77e32 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, ... }: { From 49483ab7689dd20013a75dbd01d7e681faaf8747 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 33/62] nixos/tests/esphome.nix: get rid of `with lib` --- nixos/tests/esphome.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/tests/esphome.nix b/nixos/tests/esphome.nix index b8dbdb0b3795..5a318b65a723 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 = { ... }: From 9bdb3ee1755f2da2f410712147d18520a61b8133 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 34/62] nixos/tests/hadoop/hdfs.nix: get rid of `with lib` --- nixos/tests/hadoop/hdfs.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nixos/tests/hadoop/hdfs.nix b/nixos/tests/hadoop/hdfs.nix index 9415500463de..429d4bf6b538 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") From 081a3c1fbec0bc4743442a131ac25b31d0bdc434 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 35/62] nixos/tests/iftop.nix: get rid of `with lib` --- nixos/tests/iftop.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/iftop.nix b/nixos/tests/iftop.nix index 6d0090b39463..933f115a8a5a 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 = { From cb95162f89fa71d71d00efd566bbf4126b7abd0e Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 36/62] nixos/tests/jackett.nix: get rid of `with lib` --- nixos/tests/jackett.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/jackett.nix b/nixos/tests/jackett.nix index 0a706c99b999..bc8b724e8b4b 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, ... }: From 67fd24d50920ab63f7f54b27e016205b19a1a819 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 37/62] nixos/tests/jirafeau.nix: get rid of `with lib` --- nixos/tests/jirafeau.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/jirafeau.nix b/nixos/tests/jirafeau.nix index 0f5af7f718a4..dbfaf515e257 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 = { From 80042b4cd3dd8f19bf3450b6ba4c99c1d8f4488a Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 38/62] nixos/tests/komga.nix: get rid of `with lib` --- nixos/tests/komga.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/komga.nix b/nixos/tests/komga.nix index 02db50ef25f7..d48d19bbbdd3 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, ... }: From 9f34f195e1bd8a96c58743ce526ebd98a9df5342 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 39/62] nixos/tests/libreddit.nix: get rid of `with lib` --- nixos/tests/libreddit.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/libreddit.nix b/nixos/tests/libreddit.nix index 82a44cb4e9cb..ecf347b9e12e 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; From 635170328010cca3d9e84bd6d332d66053139114 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 40/62] nixos/tests/lidarr.nix: get rid of `with lib` --- nixos/tests/lidarr.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/lidarr.nix b/nixos/tests/lidarr.nix index 7fbaea62f80e..8230dda53736 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, ... }: From 13dc33c7ac8b292cabaeab3739179c2547893f39 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 41/62] nixos/tests/miniflux.nix: get rid of `with lib` --- nixos/tests/miniflux.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/tests/miniflux.nix b/nixos/tests/miniflux.nix index d905aea048a3..be3e7abb6abd 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 = From ca916d0f614d2cf505e7fcb0f8a65c348d851111 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:17 -0300 Subject: [PATCH 42/62] nixos/tests/misc.nix: get rid of `with lib` --- nixos/tests/misc.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix index 0d5f0fe2f044..442b45948c60 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"; }; From aa7d79c0f6784e367c311d7ee656a428b6dcd006 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 43/62] nixos/tests/mpv.nix: get rid of `with lib` --- nixos/tests/mpv.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/mpv.nix b/nixos/tests/mpv.nix index a4803f3cb5b5..32a81cbe2495 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, ... }: From 2e4a81b23ab08a60def6d9cc0861abc8f660fbfc Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 44/62] nixos/tests/n8n.nix: get rid of `with lib` --- nixos/tests/n8n.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/tests/n8n.nix b/nixos/tests/n8n.nix index 044240fbce7f..771296bf37a5 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, ... }: From 757b9f1be6abac8674679617d2cfc64616205c66 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 45/62] nixos/tests/noto-fonts.nix: get rid of `with lib` --- nixos/tests/noto-fonts.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/noto-fonts.nix b/nixos/tests/noto-fonts.nix index e4c33fe26a9e..0515f16d101c 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 ]; From 98f50648847d0118359baecda8cdc9feda4bdffd Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 46/62] nixos/tests/nzbhydra2.nix: get rid of `with lib` --- nixos/tests/nzbhydra2.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/tests/nzbhydra2.nix b/nixos/tests/nzbhydra2.nix index c82c756c3a1c..e1d528cd9520 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; }; From 56934ebec436a3baa375629977375a58bc7dcb82 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 47/62] nixos/tests/oci-containers.nix: get rid of `with lib` --- nixos/tests/oci-containers.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/tests/oci-containers.nix b/nixos/tests/oci-containers.nix index 1bcfb276dbee..1afa9df36dfa 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, ... }: { From 196debcf296540849a639becb2916f70d92544ea Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 48/62] nixos/tests/odoo.nix: get rid of `with lib` --- nixos/tests/odoo.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nixos/tests/odoo.nix b/nixos/tests/odoo.nix index 96e3405482b4..7c2cf31370f9 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 = { ... }: { From 4e9cdcb64ee36d68acc2f6ab013c5aecb9526942 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:18 -0300 Subject: [PATCH 49/62] nixos/tests/ombi.nix: get rid of `with lib` --- nixos/tests/ombi.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/ombi.nix b/nixos/tests/ombi.nix index ce3064ce6ac6..fb3a37c978e3 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, ... }: From 8cc0632c464c0390c16a8e32c8b59b5ade6c2899 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 50/62] nixos/tests/please.nix: get rid of `with lib` --- nixos/tests/please.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/tests/please.nix b/nixos/tests/please.nix index 2437cfe16130..af825ae4b9b3 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" ]; } From a8790192f3634328236924a9ba41cd459a38322b Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 51/62] nixos/tests/polaris.nix: get rid of `with lib` --- nixos/tests/polaris.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/polaris.nix b/nixos/tests/polaris.nix index fb2e67f075aa..bb105d600032 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, ... }: { From cb47374b5e187bbc3ef8d97f1e528db3f94d2f78 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 52/62] nixos/tests/prowlarr.nix: get rid of `with lib` --- nixos/tests/prowlarr.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/prowlarr.nix b/nixos/tests/prowlarr.nix index 144cbd5fc95d..af669afd5700 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, ... }: From 2f459bb0c48fdea41137c78b1efa3ce6f1bb9f3d Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 53/62] nixos/tests/radarr.nix: get rid of `with lib` --- nixos/tests/radarr.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/radarr.nix b/nixos/tests/radarr.nix index 85fd6572f061..bf9eb11c2b12 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, ... }: From 1b26f82eede5dd6ac3af663f6dde9b3cc1d430c5 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 54/62] nixos/tests/readarr.nix: get rid of `with lib` --- nixos/tests/readarr.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/nixos/tests/readarr.nix b/nixos/tests/readarr.nix index bb7dd8529848..7c144e2ee02f 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, ... }: From 5f00f1f49c38ded052d6e76853ebd21fa3b48dba Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 55/62] nixos/tests/sonarr.nix: get rid of `with lib` --- nixos/tests/sonarr.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/sonarr.nix b/nixos/tests/sonarr.nix index bdfc8916cb7f..57e6b72db3a3 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, ... }: From bef35b3b88b0b3072d6a971d3e155d3055bc1ec9 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 56/62] nixos/tests/sudo.nix: get rid of `with lib` --- nixos/tests/sudo.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/nixos/tests/sudo.nix b/nixos/tests/sudo.nix index 661fe9989e7a..3b6028c6f0b0 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 = { From 07b75a58e1664dc0913c2a1a5d0a6635987fe9ce Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:19 -0300 Subject: [PATCH 57/62] nixos/tests/systemd-timesyncd.nix: get rid of `with lib` --- nixos/tests/systemd-timesyncd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/systemd-timesyncd.nix b/nixos/tests/systemd-timesyncd.nix index ad5b9a47383b..43abd36c47d9 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 From de2927e336fd653cb805afe8af8ed3006ff2dedf Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:20 -0300 Subject: [PATCH 58/62] nixos/tests/tor.nix: get rid of `with lib` --- nixos/tests/tor.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nixos/tests/tor.nix b/nixos/tests/tor.nix index 71ec9df4641f..b55fbf91232c 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; From 9fe5926b1553272ed34a5ed99aa141870ab6d960 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:21 -0300 Subject: [PATCH 59/62] nixos/tests/uptime-kuma.nix: get rid of `with lib` --- nixos/tests/uptime-kuma.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/tests/uptime-kuma.nix b/nixos/tests/uptime-kuma.nix index 3d588d73cdb5..00e2008a5257 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, ... }: From 21b0935d38efb2ade3bf6d9a08ab9211eeef4497 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:21 -0300 Subject: [PATCH 60/62] nixos/tests/xss-lock.nix: get rid of `with lib` --- nixos/tests/xss-lock.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/nixos/tests/xss-lock.nix b/nixos/tests/xss-lock.nix index c927d9274e65..e4e41a5aa797 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 = { From 6955c0c03b1736a5fa57730f56085cb1f5703038 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:21 -0300 Subject: [PATCH 61/62] nixos/tests/yabar.nix: get rid of `with lib` --- nixos/tests/yabar.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/nixos/tests/yabar.nix b/nixos/tests/yabar.nix index ff7a47ae6370..212a8ce4bbf5 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 ]; From aec8dddef7af66a7a4dc93449a23bdf638d342b6 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 30 Apr 2023 11:26:16 -0300 Subject: [PATCH 62/62] nixos/tests/gitlab.nix: get rid of `with lib` --- nixos/tests/gitlab.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/nixos/tests/gitlab.nix b/nixos/tests/gitlab.nix index 672b497e7ec6..d4e7603c20ca 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" ]"""