nixos/tests: users.(extraUsers|extraGroup->users|group)
This commit is contained in:
parent
0868aa76f6
commit
89d5d191b4
|
@ -9,7 +9,7 @@ import ./make-test.nix ({ pkgs, lib, ... }:
|
||||||
machine =
|
machine =
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{ services.atd.enable = true;
|
{ services.atd.enable = true;
|
||||||
users.extraUsers.alice = { isNormalUser = true; };
|
users.users.alice = { isNormalUser = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# "at" has a resolution of 1 minute
|
# "at" has a resolution of 1 minute
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
|
|
||||||
{ users.extraUsers.alice =
|
{ users.users.alice =
|
||||||
{ isNormalUser = true;
|
{ isNormalUser = true;
|
||||||
description = "Alice Foobar";
|
description = "Alice Foobar";
|
||||||
password = "foobar";
|
password = "foobar";
|
||||||
};
|
};
|
||||||
|
|
||||||
users.extraUsers.bob =
|
users.users.bob =
|
||||||
{ isNormalUser = true;
|
{ isNormalUser = true;
|
||||||
description = "Bob Foobar";
|
description = "Bob Foobar";
|
||||||
password = "foobar";
|
password = "foobar";
|
||||||
|
|
|
@ -78,8 +78,8 @@ in
|
||||||
# there's nobody around that can input password
|
# there's nobody around that can input password
|
||||||
PreferredAuthentications publickey
|
PreferredAuthentications publickey
|
||||||
'';
|
'';
|
||||||
users.extraUsers.alice = { isNormalUser = true; };
|
users.users.alice = { isNormalUser = true; };
|
||||||
users.extraUsers.bob = { isNormalUser = true; };
|
users.users.bob = { isNormalUser = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,7 +43,7 @@ let
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
''}
|
''}
|
||||||
|
|
||||||
users.extraUsers.alice = {
|
users.users.alice = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = "/home/alice";
|
home = "/home/alice";
|
||||||
description = "Alice Foobar";
|
description = "Alice Foobar";
|
||||||
|
|
|
@ -18,7 +18,7 @@ import ./make-test.nix ({ pkgs, ...} : {
|
||||||
# should have no effect
|
# should have no effect
|
||||||
services.jenkinsSlave.enable = true;
|
services.jenkinsSlave.enable = true;
|
||||||
|
|
||||||
users.extraUsers.jenkins.extraGroups = [ "users" ];
|
users.users.jenkins.extraGroups = [ "users" ];
|
||||||
|
|
||||||
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
|
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
|
||||||
};
|
};
|
||||||
|
@ -27,7 +27,7 @@ import ./make-test.nix ({ pkgs, ...} : {
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{ services.jenkinsSlave.enable = true;
|
{ services.jenkinsSlave.enable = true;
|
||||||
|
|
||||||
users.extraUsers.jenkins.extraGroups = [ "users" ];
|
users.users.jenkins.extraGroups = [ "users" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,7 +16,7 @@ import ./make-test.nix ({ pkgs, ...} : {
|
||||||
enableOCR = true;
|
enableOCR = true;
|
||||||
|
|
||||||
testScript = { nodes, ... }: let
|
testScript = { nodes, ... }: let
|
||||||
user = nodes.machine.config.users.extraUsers.alice;
|
user = nodes.machine.config.users.users.alice;
|
||||||
in ''
|
in ''
|
||||||
startAll;
|
startAll;
|
||||||
$machine->waitForText(qr/${user.description}/);
|
$machine->waitForText(qr/${user.description}/);
|
||||||
|
|
|
@ -17,7 +17,7 @@ in {
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
security.pam.services.sshd.limits =
|
security.pam.services.sshd.limits =
|
||||||
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
|
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
|
||||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
users.users.root.openssh.authorizedKeys.keys = [
|
||||||
snakeOilPublicKey
|
snakeOilPublicKey
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -29,7 +29,7 @@ in {
|
||||||
services.openssh = { enable = true; startWhenNeeded = true; };
|
services.openssh = { enable = true; startWhenNeeded = true; };
|
||||||
security.pam.services.sshd.limits =
|
security.pam.services.sshd.limits =
|
||||||
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
|
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
|
||||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
users.users.root.openssh.authorizedKeys.keys = [
|
||||||
snakeOilPublicKey
|
snakeOilPublicKey
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.extraUsers.alice = {
|
users.users.alice = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
name = "alice";
|
name = "alice";
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
|
|
|
@ -41,7 +41,7 @@ import ./make-test.nix ({ pkgs, ...} :
|
||||||
enableOCR = true;
|
enableOCR = true;
|
||||||
|
|
||||||
testScript = { nodes, ... }: let
|
testScript = { nodes, ... }: let
|
||||||
user = nodes.machine.config.users.extraUsers.alice;
|
user = nodes.machine.config.users.users.alice;
|
||||||
xdo = "${pkgs.xdotool}/bin/xdotool";
|
xdo = "${pkgs.xdotool}/bin/xdotool";
|
||||||
in ''
|
in ''
|
||||||
startAll;
|
startAll;
|
||||||
|
|
|
@ -21,7 +21,7 @@ let
|
||||||
enableOCR = true;
|
enableOCR = true;
|
||||||
|
|
||||||
testScript = { nodes, ... }: let
|
testScript = { nodes, ... }: let
|
||||||
user = nodes.machine.config.users.extraUsers.alice;
|
user = nodes.machine.config.users.users.alice;
|
||||||
in ''
|
in ''
|
||||||
startAll;
|
startAll;
|
||||||
$machine->waitForText(qr/select your user/i);
|
$machine->waitForText(qr/select your user/i);
|
||||||
|
|
|
@ -48,7 +48,7 @@ import ./make-test.nix ({ pkgs, ...} : {
|
||||||
enableOCR = true;
|
enableOCR = true;
|
||||||
|
|
||||||
testScript = { nodes, ... }: let
|
testScript = { nodes, ... }: let
|
||||||
user = nodes.machine.config.users.extraUsers.alice;
|
user = nodes.machine.config.users.users.alice;
|
||||||
in ''
|
in ''
|
||||||
startAll;
|
startAll;
|
||||||
$machine->waitForText(qr/Username:/);
|
$machine->waitForText(qr/Username:/);
|
||||||
|
|
|
@ -14,7 +14,7 @@ in
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
users.extraGroups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; };
|
users.groups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; };
|
||||||
users.users = {
|
users.users = {
|
||||||
test0 = { isNormalUser = true; extraGroups = [ "wheel" ]; };
|
test0 = { isNormalUser = true; extraGroups = [ "wheel" ]; };
|
||||||
test1 = { isNormalUser = true; password = password; };
|
test1 = { isNormalUser = true; password = password; };
|
||||||
|
|
|
@ -334,7 +334,7 @@ let
|
||||||
virtualisation.memorySize = 2048;
|
virtualisation.memorySize = 2048;
|
||||||
virtualisation.virtualbox.host.enable = true;
|
virtualisation.virtualbox.host.enable = true;
|
||||||
services.xserver.displayManager.auto.user = "alice";
|
services.xserver.displayManager.auto.user = "alice";
|
||||||
users.extraUsers.alice.extraGroups = let
|
users.users.alice.extraGroups = let
|
||||||
inherit (config.virtualisation.virtualbox.host) enableHardening;
|
inherit (config.virtualisation.virtualbox.host) enableHardening;
|
||||||
in lib.mkIf enableHardening (lib.singleton "vboxusers");
|
in lib.mkIf enableHardening (lib.singleton "vboxusers");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue