mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 22:51:22 +00:00
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 =
|
||||
{ config, pkgs, ... }:
|
||||
{ services.atd.enable = true;
|
||||
users.extraUsers.alice = { isNormalUser = true; };
|
||||
users.users.alice = { isNormalUser = true; };
|
||||
};
|
||||
|
||||
# "at" has a resolution of 1 minute
|
||||
|
@ -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";
|
||||
|
@ -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; };
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -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";
|
||||
|
@ -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" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -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}/);
|
||||
|
@ -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
|
||||
];
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ in
|
||||
enable = true;
|
||||
};
|
||||
|
||||
users.extraUsers.alice = {
|
||||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
name = "alice";
|
||||
uid = 1000;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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:/);
|
||||
|
@ -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; };
|
||||
|
@ -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");
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user