Merge pull request #229030 from atorres1985-contrib/with-lib-is-bad

With lib is bad: removes `with lib;` occurrences - part I
This commit is contained in:
Anderson Torres 2023-05-17 20:24:46 -03:00 committed by GitHub
commit c637afe9c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 109 additions and 237 deletions

View File

@ -2,8 +2,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
{ {
imports = imports =
[ ../../../modules/virtualisation/cloudstack-config.nix ]; [ ../../../modules/virtualisation/cloudstack-config.nix ];

View File

@ -4,8 +4,6 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib;
{ {
imports = imports =
[ # Include the default lxd configuration. [ # Include the default lxd configuration.

View File

@ -1,7 +1,5 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
with lib;
{ {
imports = [ imports = [
../../../modules/virtualisation/lxc-container.nix ../../../modules/virtualisation/lxc-container.nix

View File

@ -1,7 +1,5 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
with lib;
# WARNING: THIS CONFIGURATION IS AUTOGENERATED AND WILL BE OVERWRITTEN AUTOMATICALLY # WARNING: THIS CONFIGURATION IS AUTOGENERATED AND WILL BE OVERWRITTEN AUTOMATICALLY
{ {

View File

@ -1,7 +1,10 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
with lib; let
inherit (lib)
mkAliasOptionModuleMD
mkRemovedOptionModule;
in
{ {
imports = [ imports = [
/* /*

View File

@ -1,8 +1,6 @@
{ lib, pkgs, ... }: { { lib, pkgs, ... }: {
name = "3proxy"; name = "3proxy";
meta = with lib.maintainers; { meta.maintainers = with lib.maintainers; [ misuzu ];
maintainers = [ misuzu ];
};
nodes = { nodes = {
peer0 = { lib, ... }: { peer0 = { lib, ... }: {

View File

@ -1,14 +1,11 @@
import ./make-test-python.nix ({ pkgs, ... } : { import ./make-test-python.nix ({ pkgs, ... } : {
name = "apparmor"; name = "apparmor";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ julm ];
maintainers = [ julm ];
};
nodes.machine = nodes.machine =
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
with lib;
{ {
security.apparmor.enable = mkDefault true; security.apparmor.enable = lib.mkDefault true;
}; };
testScript = testScript =

View File

@ -6,10 +6,9 @@ let
testPass = "password"; testPass = "password";
testEmail = "test.testerman@test.com"; testEmail = "test.testerman@test.com";
in in
with lib;
{ {
name = "atuin"; name = "atuin";
meta.maintainers = with pkgs.lib.maintainers; [ devusb ]; meta.maintainers = with lib.maintainers; [ devusb ];
nodes = { nodes = {
server = server =

View File

@ -1,13 +1,11 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
let let
port = 42069; port = 42069;
in in
{ {
name = "bazarr"; name = "bazarr";
meta.maintainers = with maintainers; [ d-xo ]; meta.maintainers = with lib.maintainers; [ d-xo ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -107,8 +107,8 @@ import ./make-test-python.nix ({ pkgs, ... }: {
''; '';
}; };
copyCanaries = with lib; concatMapStrings (canary: '' copyCanaries = lib.concatMapStrings (canary: ''
${optionalString (canary ? child) '' ${lib.optionalString (canary ? child) ''
copy_bin_and_libs "${canary.child}/bin/${canary.child.name}" copy_bin_and_libs "${canary.child}/bin/${canary.child.name}"
''} ''}
copy_bin_and_libs "${canary}/bin/${canary.name}" copy_bin_and_libs "${canary}/bin/${canary.name}"

View File

@ -1,9 +1,7 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: { import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "budgie"; name = "budgie";
meta = with lib; { meta.maintainers = [ lib.maintainers.federicoschonborn ];
maintainers = [ maintainers.federicoschonborn ];
};
nodes.machine = { ... }: { nodes.machine = { ... }: {
imports = [ imports = [

View File

@ -1,15 +1,13 @@
import ./make-test-python.nix ({ pkgs, ... } : { import ./make-test-python.nix ({ lib, pkgs, ... } : {
name = "cadvisor"; name = "cadvisor";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ offline ];
maintainers = [ offline ];
};
nodes = { nodes = {
machine = { ... }: { machine = { ... }: {
services.cadvisor.enable = true; services.cadvisor.enable = true;
}; };
influxdb = { lib, ... }: with lib; { influxdb = { lib, ... }: {
services.cadvisor.enable = true; services.cadvisor.enable = true;
services.cadvisor.storageDriver = "influxdb"; services.cadvisor.storageDriver = "influxdb";
services.influxdb.enable = true; services.influxdb.enable = true;

View File

@ -5,10 +5,9 @@ import ./make-test-python.nix (
port = 3142; port = 3142;
defaultPort = 8083; defaultPort = 8083;
in in
with lib;
{ {
name = "calibre-web"; name = "calibre-web";
meta.maintainers = with pkgs.lib.maintainers; [ pborzenkov ]; meta.maintainers = with lib.maintainers; [ pborzenkov ];
nodes = { nodes = {
customized = { pkgs, ... }: { customized = { pkgs, ... }: {

View File

@ -1,9 +1,7 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: { import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "cinnamon"; name = "cinnamon";
meta = with lib; { meta.maintainers = lib.teams.cinnamon.members;
maintainers = teams.cinnamon.members;
};
nodes.machine = { nodes, ... }: { nodes.machine = { nodes, ... }: {
imports = [ ./common/user-account.nix ]; imports = [ ./common/user-account.nix ];

View File

@ -76,9 +76,9 @@ let
in { in {
imports = [ ../../resolver.nix ]; imports = [ ../../resolver.nix ];
options.test-support.acme = with lib; { options.test-support.acme = {
caDomain = mkOption { caDomain = lib.mkOption {
type = types.str; type = lib.types.str;
readOnly = true; readOnly = true;
default = domain; default = domain;
description = lib.mdDoc '' description = lib.mdDoc ''
@ -86,8 +86,8 @@ in {
identify the CA server. identify the CA server.
''; '';
}; };
caCert = mkOption { caCert = lib.mkOption {
type = types.path; type = lib.types.path;
readOnly = true; readOnly = true;
default = testCerts.ca.cert; default = testCerts.ca.cert;
description = lib.mdDoc '' description = lib.mdDoc ''

View File

@ -1,23 +1,16 @@
{ config, lib, ... }: { config, lib, ... }:
with lib;
let let
dmcfg = config.services.xserver.displayManager; dmcfg = config.services.xserver.displayManager;
cfg = config.test-support.displayManager.auto; cfg = config.test-support.displayManager.auto;
in in
{ {
###### interface ###### interface
options = { options = {
test-support.displayManager.auto = { test-support.displayManager.auto = {
enable = lib.mkOption {
enable = mkOption {
default = false; default = false;
description = lib.mdDoc '' description = lib.mdDoc ''
Whether to enable the fake "auto" display manager, which Whether to enable the fake "auto" display manager, which
@ -27,20 +20,16 @@ in
''; '';
}; };
user = mkOption { user = lib.mkOption {
default = "root"; default = "root";
description = lib.mdDoc "The user account to login automatically."; description = lib.mdDoc "The user account to login automatically.";
}; };
}; };
}; };
###### implementation ###### implementation
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.xserver.displayManager = { services.xserver.displayManager = {
lightdm.enable = true; lightdm.enable = true;
autoLogin = { autoLogin = {
@ -62,7 +51,5 @@ in
session include lightdm session include lightdm
''; '';
}; };
} }

View File

@ -1,14 +1,12 @@
import ./make-test-python.nix ({ lib, pkgs, ... }: import ./make-test-python.nix ({ lib, pkgs, ... }:
with lib;
let let
port = 3333; port = 3333;
in in
{ {
name = "convos"; name = "convos";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ sgo ];
maintainers = [ sgo ];
};
nodes = { nodes = {
machine = machine =

View File

@ -1,9 +1,8 @@
let let
makeNode = couchpkg: user: passwd: makeNode = couchpkg: user: passwd:
{ pkgs, ... } : { pkgs, ... } :
{ environment.systemPackages = with pkgs; [ jq ]; { environment.systemPackages = [ pkgs.jq ];
services.couchdb.enable = true; services.couchdb.enable = true;
services.couchdb.package = couchpkg; services.couchdb.package = couchpkg;
services.couchdb.adminUser = user; services.couchdb.adminUser = user;
@ -12,16 +11,11 @@ let
testuser = "testadmin"; testuser = "testadmin";
testpass = "cowabunga"; testpass = "cowabunga";
testlogin = "${testuser}:${testpass}@"; testlogin = "${testuser}:${testpass}@";
in
in import ./make-test-python.nix ({ pkgs, lib, ...}: import ./make-test-python.nix ({ pkgs, lib, ...}:
with lib;
{ {
name = "couchdb"; name = "couchdb";
meta = with pkgs.lib.maintainers; { meta.maintainers = [ ];
maintainers = [ ];
};
nodes = { nodes = {
couchdb3 = makeNode pkgs.couchdb3 testuser testpass; couchdb3 = makeNode pkgs.couchdb3 testuser testpass;

View File

@ -2,9 +2,7 @@
import ./make-test-python.nix ( import ./make-test-python.nix (
{ lib, ... }: { { lib, ... }: {
name = "doas"; name = "doas";
meta = with lib.maintainers; { meta.maintainers = with lib.maintainers; [ cole-h ];
maintainers = [ cole-h ];
};
nodes.machine = nodes.machine =
{ ... }: { ... }:

View File

@ -1,8 +1,6 @@
import ./make-test-python.nix ({ lib, pkgs, ... }: { import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "doh-proxy-rust"; name = "doh-proxy-rust";
meta = with lib.maintainers; { meta.maintainers = with lib.maintainers; [ stephank ];
maintainers = [ stephank ];
};
nodes = { nodes = {
machine = { pkgs, lib, ... }: { machine = { pkgs, lib, ... }: {

View File

@ -4,10 +4,9 @@ let
testPort = 6052; testPort = 6052;
unixSocket = "/run/esphome/esphome.sock"; unixSocket = "/run/esphome/esphome.sock";
in in
with lib;
{ {
name = "esphome"; name = "esphome";
meta.maintainers = with pkgs.lib.maintainers; [ oddlama ]; meta.maintainers = with lib.maintainers; [ oddlama ];
nodes = { nodes = {
esphomeTcp = { ... }: esphomeTcp = { ... }:

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "fluidd"; name = "fluidd";
meta.maintainers = with maintainers; [ vtuan10 ]; meta.maintainers = with lib.maintainers; [ vtuan10 ];
nodes.machine = { pkgs, ... }: { nodes.machine = { pkgs, ... }: {
services.fluidd = { services.fluidd = {

View File

@ -11,8 +11,6 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
with lib;
let let
inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey; inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
initialRootPassword = "notproduction"; initialRootPassword = "notproduction";
@ -30,9 +28,7 @@ let
bobProjectId = "3"; bobProjectId = "3";
in { in {
name = "gitlab"; name = "gitlab";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ globin yayayayaka ];
maintainers = [ globin yayayayaka ];
};
nodes = { nodes = {
gitlab = { ... }: { gitlab = { ... }: {
@ -43,10 +39,10 @@ in {
virtualisation.useNixStoreImage = true; virtualisation.useNixStoreImage = true;
virtualisation.writableStore = false; virtualisation.writableStore = false;
systemd.services.gitlab.serviceConfig.Restart = mkForce "no"; systemd.services.gitlab.serviceConfig.Restart = lib.mkForce "no";
systemd.services.gitlab-workhorse.serviceConfig.Restart = mkForce "no"; systemd.services.gitlab-workhorse.serviceConfig.Restart = lib.mkForce "no";
systemd.services.gitaly.serviceConfig.Restart = mkForce "no"; systemd.services.gitaly.serviceConfig.Restart = lib.mkForce "no";
systemd.services.gitlab-sidekiq.serviceConfig.Restart = mkForce "no"; systemd.services.gitlab-sidekiq.serviceConfig.Restart = lib.mkForce "no";
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -195,7 +191,7 @@ in {
gitlab.succeed( 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" "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"): with subtest("Create user Alice"):
gitlab.succeed( 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" ]""" """[ "$(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" ]"""

View File

@ -1,12 +1,11 @@
import ./make-test-python.nix ({ pkgs, lib, ...} : { import ./make-test-python.nix ({ pkgs, lib, ...} : {
name = "gnome-flashback"; name = "gnome-flashback";
meta = with lib; { meta.maintainers = lib.teams.gnome.members ++ [ lib.maintainers.chpatrick ];
maintainers = teams.gnome.members ++ [ maintainers.chpatrick ];
};
nodes.machine = { nodes, ... }: let nodes.machine = { nodes, ... }:
user = nodes.machine.config.users.users.alice; let
in user = nodes.machine.config.users.users.alice;
in
{ imports = [ ./common/user-account.nix ]; { imports = [ ./common/user-account.nix ];

View File

@ -1,7 +1,7 @@
import ./make-test-python.nix ({ pkgs, lib, ...} : { import ./make-test-python.nix ({ pkgs, lib, ...} : {
name = "gnome-xorg"; name = "gnome-xorg";
meta = with lib; { meta = {
maintainers = teams.gnome.members; maintainers = lib.teams.gnome.members;
}; };
nodes.machine = { nodes, ... }: let nodes.machine = { nodes, ... }: let

View File

@ -1,8 +1,6 @@
import ./make-test-python.nix ({ pkgs, lib, ...} : { import ./make-test-python.nix ({ pkgs, lib, ...} : {
name = "gnome"; name = "gnome";
meta = with lib; { meta.maintainers = lib.teams.gnome.members;
maintainers = teams.gnome.members;
};
nodes.machine = nodes.machine =
{ ... }: { ... }:

View File

@ -1,6 +1,5 @@
# Test a minimal HDFS cluster with no HA # Test a minimal HDFS cluster with no HA
import ../make-test-python.nix ({ package, lib, ... }: import ../make-test-python.nix ({ package, lib, ... }:
with lib;
{ {
name = "hadoop-hdfs"; name = "hadoop-hdfs";
@ -22,7 +21,7 @@ with lib;
}; };
httpfs = { httpfs = {
# The NixOS hadoop module only support webHDFS on 3.3 and newer # 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; openFirewall = true;
}; };
}; };
@ -57,7 +56,7 @@ with lib;
datanode.wait_for_unit("hdfs-datanode") datanode.wait_for_unit("hdfs-datanode")
datanode.wait_for_unit("network.target") 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(9864)
datanode.wait_for_open_port(9866) datanode.wait_for_open_port(9866)
datanode.wait_for_open_port(9867) datanode.wait_for_open_port(9867)
@ -76,7 +75,7 @@ with lib;
datanode.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile") datanode.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile")
assert "testfilecontents" in datanode.succeed("sudo -u hdfs hdfs dfs -cat /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_unit("hdfs-httpfs")
namenode.wait_for_open_port(14000) 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") assert "testfilecontents" in datanode.succeed("curl -f \"http://namenode:14000/webhdfs/v1/testfile?user.name=hdfs&op=OPEN\" 2>&1")

View File

@ -6,7 +6,6 @@ import ./make-test-python.nix ({ pkgs, ... } : {
nodes.machine = nodes.machine =
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
with lib;
{ users.users.alice = { isNormalUser = true; extraGroups = [ "proc" ]; }; { users.users.alice = { isNormalUser = true; extraGroups = [ "proc" ]; };
users.users.sybil = { isNormalUser = true; group = "wheel"; }; users.users.sybil = { isNormalUser = true; group = "wheel"; };
imports = [ ../modules/profiles/hardened.nix ]; imports = [ ../modules/profiles/hardened.nix ];

View File

@ -46,14 +46,14 @@ in makeTest {
nodes = { nodes = {
# System configuration used for installing the installedConfig from above. # System configuration used for installing the installedConfig from above.
machine = { config, lib, pkgs, ... }: with lib; { machine = { config, lib, pkgs, ... }: {
imports = [ imports = [
../modules/profiles/installation-device.nix ../modules/profiles/installation-device.nix
../modules/profiles/base.nix ../modules/profiles/base.nix
]; ];
nix.settings = { nix.settings = {
substituters = mkForce []; substituters = lib.mkForce [];
hashed-mirrors = null; hashed-mirrors = null;
connect-timeout = 1; connect-timeout = 1;
}; };

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: import ./make-test-python.nix ({ pkgs, lib, ... }:
with lib;
{ {
name = "iftop"; name = "iftop";
meta.maintainers = with pkgs.lib.maintainers; [ ma27 ]; meta.maintainers = with lib.maintainers; [ ma27 ];
nodes = { nodes = {
withIftop = { withIftop = {

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "jackett"; name = "jackett";
meta.maintainers = with maintainers; [ etu ]; meta.maintainers = with lib.maintainers; [ etu ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "jirafeau"; name = "jirafeau";
meta.maintainers = with maintainers; [ davidtwco ]; meta.maintainers = with lib.maintainers; [ davidtwco ];
nodes.machine = { pkgs, ... }: { nodes.machine = { pkgs, ... }: {
services.jirafeau = { services.jirafeau = {

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "komga"; name = "komga";
meta.maintainers = with maintainers; [ govanify ]; meta.maintainers = with lib.maintainers; [ govanify ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "libreddit"; name = "libreddit";
meta.maintainers = with maintainers; [ fab ]; meta.maintainers = with lib.maintainers; [ fab ];
nodes.machine = { nodes.machine = {
services.libreddit.enable = true; services.libreddit.enable = true;

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "lidarr"; name = "lidarr";
meta.maintainers = with maintainers; [ etu ]; meta.maintainers = with lib.maintainers; [ etu ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -17,10 +17,9 @@ let
''; '';
in in
with lib;
{ {
name = "miniflux"; name = "miniflux";
meta.maintainers = with pkgs.lib.maintainers; [ ]; meta.maintainers = [ ];
nodes = { nodes = {
default = default =

View File

@ -1,20 +1,17 @@
# Miscellaneous small tests that don't warrant their own VM run. # 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"; foo = pkgs.writeText "foo" "Hello World";
in { in {
name = "misc"; name = "misc";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ eelco ];
maintainers = [ eelco ];
};
nodes.machine = nodes.machine =
{ lib, ... }: { lib, ... }:
with lib; { swapDevices = lib.mkOverride 0
{ swapDevices = mkOverride 0
[ { device = "/root/swapfile"; size = 128; } ]; [ { device = "/root/swapfile"; size = 128; } ];
environment.variables.EDITOR = mkOverride 0 "emacs"; environment.variables.EDITOR = lib.mkOverride 0 "emacs";
documentation.nixos.enable = mkOverride 0 true; documentation.nixos.enable = lib.mkOverride 0 true;
systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ]; systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ];
virtualisation.fileSystems = { "/tmp2" = virtualisation.fileSystems = { "/tmp2" =
{ fsType = "tmpfs"; { fsType = "tmpfs";
@ -32,7 +29,7 @@ in {
options = [ "bind" "rw" "noauto" ]; options = [ "bind" "rw" "noauto" ];
}; };
}; };
systemd.automounts = singleton systemd.automounts = lib.singleton
{ wantedBy = [ "multi-user.target" ]; { wantedBy = [ "multi-user.target" ];
where = "/tmp2"; where = "/tmp2";
}; };

View File

@ -1,13 +1,11 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
let let
port = toString 4321; port = toString 4321;
in in
{ {
name = "mpv"; name = "mpv";
meta.maintainers = with maintainers; [ zopieux ]; meta.maintainers = with lib.maintainers; [ zopieux ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,13 +1,10 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
let let
port = 5678; port = 5678;
in in
{ {
name = "n8n"; name = "n8n";
meta.maintainers = with maintainers; [ freezeboy k900 ]; meta.maintainers = with lib.maintainers; [ freezeboy k900 ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,7 +1,5 @@
import ../make-test-python.nix ({ pkgs, lib, ... }: import ../make-test-python.nix ({ pkgs, lib, ... }:
with lib;
let let
krb5 = krb5 =
{ enable = true; { enable = true;

View File

@ -1,8 +1,6 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: { import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "noto-fonts"; name = "noto-fonts";
meta = { meta.maintainers = with lib.maintainers; [ nickcao midchildan ];
maintainers = with lib.maintainers; [ nickcao midchildan ];
};
nodes.machine = { nodes.machine = {
imports = [ ./common/x11.nix ]; imports = [ ./common/x11.nix ];

View File

@ -1,10 +1,7 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "nzbhydra2"; name = "nzbhydra2";
meta.maintainers = with maintainers; [ jamiemagee ]; meta.maintainers = with lib.maintainers; [ jamiemagee ];
nodes.machine = { pkgs, ... }: { services.nzbhydra2.enable = true; }; nodes.machine = { pkgs, ... }: { services.nzbhydra2.enable = true; };

View File

@ -11,9 +11,8 @@ let
mkOCITest = backend: makeTest { mkOCITest = backend: makeTest {
name = "oci-containers-${backend}"; name = "oci-containers-${backend}";
meta = { meta.maintainers = lib.teams.serokell.members
maintainers = with lib.maintainers; [ adisbladis benley mkaito ] ++ lib.teams.serokell.members; ++ (with lib.maintainers; [ adisbladis benley mkaito ]);
};
nodes = { nodes = {
${backend} = { pkgs, ... }: { ${backend} = { pkgs, ... }: {

View File

@ -1,8 +1,6 @@
import ./make-test-python.nix ({ pkgs, lib, ...} : with lib; { import ./make-test-python.nix ({ pkgs, lib, ...} : {
name = "odoo"; name = "odoo";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ mkg20001 ];
maintainers = [ mkg20001 ];
};
nodes = { nodes = {
server = { ... }: { server = { ... }: {

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "ombi"; name = "ombi";
meta.maintainers = with maintainers; [ woky ]; meta.maintainers = with lib.maintainers; [ woky ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -3,9 +3,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
{ {
name = "pantheon"; name = "pantheon";
meta = with lib; { meta.maintainers = lib.teams.pantheon.members;
maintainers = teams.pantheon.members;
};
nodes.machine = { ... }: nodes.machine = { ... }:

View File

@ -6,10 +6,10 @@ import ./make-test-python.nix ({ lib, ... }:
nodes.machine = nodes.machine =
{ ... }: { ... }:
{ {
users.users = with lib; mkMerge [ users.users = lib.mkMerge [
(listToAttrs (map (lib.listToAttrs (map
(n: nameValuePair n { isNormalUser = true; }) (n: lib.nameValuePair n { isNormalUser = true; })
(genList (x: "user${toString x}") 6))) (lib.genList (x: "user${toString x}") 6)))
{ {
user0.extraGroups = [ "wheel" ]; user0.extraGroups = [ "wheel" ];
} }

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "polaris"; name = "polaris";
meta.maintainers = with maintainers; [ pbsds ]; meta.maintainers = with lib.maintainers; [ pbsds ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { { pkgs, ... }: {

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "prowlarr"; name = "prowlarr";
meta.maintainers = with maintainers; [ jdreaver ]; meta.maintainers = with lib.maintainers; [ jdreaver ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -11,11 +11,11 @@ let
}; };
# Only allow the demo data to be used (only if it's unfreeRedistributable). # 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" ]; allowPackageNames = [ "quake3-demodata" "quake3-pointrelease" ];
allowLicenses = [ lib.licenses.unfreeRedistributable ]; allowLicenses = [ lib.licenses.unfreeRedistributable ];
in elem pkg.pname allowPackageNames && in lib.elem pkg.pname allowPackageNames &&
elem (pkg.meta.license or null) allowLicenses; lib.elem (pkg.meta.license or null) allowLicenses;
client = client =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "radarr"; name = "radarr";
meta.maintainers = with maintainers; [ etu ]; meta.maintainers = with lib.maintainers; [ etu ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,10 +1,6 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }: {
with lib;
{
name = "readarr"; name = "readarr";
meta.maintainers = with maintainers; [ jocelynthode ]; meta.maintainers = with lib.maintainers; [ jocelynthode ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,19 +1,17 @@
import ./make-test-python.nix ({ pkgs, ... }: import ./make-test-python.nix ({ pkgs, lib, ... }:
{ {
name = "redis"; name = "redis";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ flokli ];
maintainers = [ flokli ];
};
nodes = { nodes = {
machine = machine =
{ pkgs, lib, ... }: with lib; { pkgs, lib, ... }:
{ {
services.redis.servers."".enable = true; services.redis.servers."".enable = true;
services.redis.servers."test".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; createHome = false;
description = "A member of the redis${suffix} group"; description = "A member of the redis${suffix} group";
isNormalUser = true; isNormalUser = true;

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "sonarr"; name = "sonarr";
meta.maintainers = with maintainers; [ etu ]; meta.maintainers = with lib.maintainers; [ etu ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -2,17 +2,13 @@
let let
password = "helloworld"; password = "helloworld";
in in
import ./make-test-python.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ lib, pkgs, ...} : {
name = "sudo"; name = "sudo";
meta = with pkgs.lib.maintainers; { meta.maintainers = with lib.maintainers; [ lschuermann ];
maintainers = [ lschuermann ];
};
nodes.machine = nodes.machine =
{ lib, ... }: { lib, ... }:
with lib;
{ {
users.groups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; }; users.groups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; };
users.users = { users.users = {

View File

@ -11,11 +11,11 @@ in {
name = "systemd-timesyncd"; name = "systemd-timesyncd";
nodes = { nodes = {
current = mkVM {}; current = mkVM {};
pre1909 = mkVM ({lib, ... }: with lib; { pre1909 = mkVM ({lib, ... }: {
# create the path that should be migrated by our activation script when # create the path that should be migrated by our activation script when
# upgrading to a newer nixos version # upgrading to a newer nixos version
system.stateVersion = "19.03"; 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 rm -f /var/lib/systemd/timesync
mkdir -p /var/lib/systemd /var/lib/private/systemd/timesync mkdir -p /var/lib/systemd /var/lib/private/systemd/timesync
ln -s /var/lib/private/systemd/timesync /var/lib/systemd/timesync ln -s /var/lib/private/systemd/timesync /var/lib/systemd/timesync

View File

@ -1,15 +1,13 @@
import ./make-test-python.nix ({ lib, ... }: with lib; import ./make-test-python.nix ({ lib, ... }: {
{
name = "tor"; name = "tor";
meta.maintainers = with maintainers; [ joachifm ]; meta.maintainers = with lib.maintainers; [ joachifm ];
nodes.client = { pkgs, ... }: { nodes.client = { pkgs, ... }: {
boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ]; boot.kernelParams = [ "audit=0" "apparmor=0" "quiet" ];
networking.firewall.enable = false; networking.firewall.enable = false;
networking.useDHCP = false; networking.useDHCP = false;
environment.systemPackages = with pkgs; [ netcat ]; environment.systemPackages = [ pkgs.netcat ];
services.tor.enable = true; services.tor.enable = true;
services.tor.client.enable = true; services.tor.client.enable = true;
services.tor.settings.ControlPort = 9051; services.tor.settings.ControlPort = 9051;

View File

@ -1,9 +1,7 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: { import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "ulogd"; name = "ulogd";
meta = with lib; { meta.maintainers = with lib.maintainers; [ p-h ];
maintainers = with maintainers; [ p-h ];
};
nodes.machine = { ... }: { nodes.machine = { ... }: {
networking.firewall.enable = false; networking.firewall.enable = false;

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
with lib;
{ {
name = "uptime-kuma"; name = "uptime-kuma";
meta.maintainers = with maintainers; [ julienmalka ]; meta.maintainers = with lib.maintainers; [ julienmalka ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:

View File

@ -1,10 +1,8 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: import ./make-test-python.nix ({ pkgs, lib, ... }:
with lib;
{ {
name = "xautolock"; name = "xautolock";
meta.maintainers = with pkgs.lib.maintainers; [ ]; meta.maintainers = [ ];
nodes.machine = { nodes.machine = {
imports = [ ./common/x11.nix ./common/user-account.nix ]; imports = [ ./common/x11.nix ./common/user-account.nix ];

View File

@ -1,10 +1,6 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: import ./make-test-python.nix ({ pkgs, lib, ... }: {
with lib;
{
name = "xss-lock"; name = "xss-lock";
meta.maintainers = with pkgs.lib.maintainers; [ ]; meta.maintainers = [ ];
nodes = { nodes = {
simple = { simple = {

View File

@ -1,12 +1,6 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: import ./make-test-python.nix ({ pkgs, lib, ... }: {
with lib;
{
name = "yabar"; name = "yabar";
meta = with pkgs.lib.maintainers; { meta.maintainers = [ ];
maintainers = [ ];
};
nodes.machine = { nodes.machine = {
imports = [ ./common/x11.nix ./common/user-account.nix ]; imports = [ ./common/x11.nix ./common/user-account.nix ];