nixos/tests: users.(extraUsers|extraGroup->users|group)

This commit is contained in:
Florian Klink 2018-06-30 01:55:42 +02:00
parent 0868aa76f6
commit 89d5d191b4
13 changed files with 17 additions and 17 deletions

View File

@ -9,7 +9,7 @@ import ./make-test.nix ({ pkgs, lib, ... }:
machine =
{ config, pkgs, ... }:
{ services.atd.enable = true;
users.extraUsers.alice = { isNormalUser = true; };
users.users.alice = { isNormalUser = true; };
};
# "at" has a resolution of 1 minute

View File

@ -1,12 +1,12 @@
{ lib, ... }:
{ users.extraUsers.alice =
{ users.users.alice =
{ isNormalUser = true;
description = "Alice Foobar";
password = "foobar";
};
users.extraUsers.bob =
users.users.bob =
{ isNormalUser = true;
description = "Bob Foobar";
password = "foobar";

View File

@ -78,8 +78,8 @@ in
# there's nobody around that can input password
PreferredAuthentications publickey
'';
users.extraUsers.alice = { isNormalUser = true; };
users.extraUsers.bob = { isNormalUser = true; };
users.users.alice = { isNormalUser = true; };
users.users.bob = { isNormalUser = true; };
};
};

View File

@ -43,7 +43,7 @@ let
boot.loader.systemd-boot.enable = true;
''}
users.extraUsers.alice = {
users.users.alice = {
isNormalUser = true;
home = "/home/alice";
description = "Alice Foobar";

View File

@ -18,7 +18,7 @@ import ./make-test.nix ({ pkgs, ...} : {
# should have no effect
services.jenkinsSlave.enable = true;
users.extraUsers.jenkins.extraGroups = [ "users" ];
users.users.jenkins.extraGroups = [ "users" ];
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
};
@ -27,7 +27,7 @@ import ./make-test.nix ({ pkgs, ...} : {
{ config, pkgs, ... }:
{ services.jenkinsSlave.enable = true;
users.extraUsers.jenkins.extraGroups = [ "users" ];
users.users.jenkins.extraGroups = [ "users" ];
};
};

View File

@ -16,7 +16,7 @@ import ./make-test.nix ({ pkgs, ...} : {
enableOCR = true;
testScript = { nodes, ... }: let
user = nodes.machine.config.users.extraUsers.alice;
user = nodes.machine.config.users.users.alice;
in ''
startAll;
$machine->waitForText(qr/${user.description}/);

View File

@ -17,7 +17,7 @@ in {
services.openssh.enable = true;
security.pam.services.sshd.limits =
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
users.extraUsers.root.openssh.authorizedKeys.keys = [
users.users.root.openssh.authorizedKeys.keys = [
snakeOilPublicKey
];
};
@ -29,7 +29,7 @@ in {
services.openssh = { enable = true; startWhenNeeded = true; };
security.pam.services.sshd.limits =
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
users.extraUsers.root.openssh.authorizedKeys.keys = [
users.users.root.openssh.authorizedKeys.keys = [
snakeOilPublicKey
];
};

View File

@ -30,7 +30,7 @@ in
enable = true;
};
users.extraUsers.alice = {
users.users.alice = {
isNormalUser = true;
name = "alice";
uid = 1000;

View File

@ -41,7 +41,7 @@ import ./make-test.nix ({ pkgs, ...} :
enableOCR = true;
testScript = { nodes, ... }: let
user = nodes.machine.config.users.extraUsers.alice;
user = nodes.machine.config.users.users.alice;
xdo = "${pkgs.xdotool}/bin/xdotool";
in ''
startAll;

View File

@ -21,7 +21,7 @@ let
enableOCR = true;
testScript = { nodes, ... }: let
user = nodes.machine.config.users.extraUsers.alice;
user = nodes.machine.config.users.users.alice;
in ''
startAll;
$machine->waitForText(qr/select your user/i);

View File

@ -48,7 +48,7 @@ import ./make-test.nix ({ pkgs, ...} : {
enableOCR = true;
testScript = { nodes, ... }: let
user = nodes.machine.config.users.extraUsers.alice;
user = nodes.machine.config.users.users.alice;
in ''
startAll;
$machine->waitForText(qr/Username:/);

View File

@ -14,7 +14,7 @@ in
{ config, lib, pkgs, ... }:
with lib;
{
users.extraGroups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; };
users.groups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; };
users.users = {
test0 = { isNormalUser = true; extraGroups = [ "wheel" ]; };
test1 = { isNormalUser = true; password = password; };

View File

@ -334,7 +334,7 @@ let
virtualisation.memorySize = 2048;
virtualisation.virtualbox.host.enable = true;
services.xserver.displayManager.auto.user = "alice";
users.extraUsers.alice.extraGroups = let
users.users.alice.extraGroups = let
inherit (config.virtualisation.virtualbox.host) enableHardening;
in lib.mkIf enableHardening (lib.singleton "vboxusers");
};