mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 15:13:46 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
64 lines
1.8 KiB
Nix
64 lines
1.8 KiB
Nix
{ lib, ... }:
|
|
{
|
|
name = "amd-sev";
|
|
meta = {
|
|
maintainers = with lib.maintainers; [
|
|
trundle
|
|
veehaitch
|
|
];
|
|
};
|
|
|
|
nodes.machine =
|
|
{ lib, ... }:
|
|
{
|
|
hardware.cpu.amd.sev.enable = true;
|
|
hardware.cpu.amd.sevGuest.enable = true;
|
|
|
|
specialisation.sevCustomUserGroup.configuration = {
|
|
users.groups.sevtest = { };
|
|
|
|
hardware.cpu.amd.sev = {
|
|
enable = true;
|
|
group = "root";
|
|
mode = "0600";
|
|
};
|
|
hardware.cpu.amd.sevGuest = {
|
|
enable = true;
|
|
group = "sevtest";
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript =
|
|
{ nodes, ... }:
|
|
let
|
|
specialisations = "${nodes.machine.system.build.toplevel}/specialisation";
|
|
in
|
|
''
|
|
machine.wait_for_unit("multi-user.target")
|
|
|
|
with subtest("Check default settings"):
|
|
out = machine.succeed("cat /etc/udev/rules.d/99-local.rules")
|
|
assert 'KERNEL=="sev", OWNER="root", GROUP="sev", MODE="0660"' in out
|
|
assert 'KERNEL=="sev-guest", OWNER="root", GROUP="sev-guest", MODE="0660"' in out
|
|
|
|
out = machine.succeed("cat /etc/group")
|
|
assert "sev:" in out
|
|
assert "sev-guest:" in out
|
|
assert "sevtest:" not in out
|
|
|
|
with subtest("Activate configuration with custom user/group"):
|
|
machine.succeed('${specialisations}/sevCustomUserGroup/bin/switch-to-configuration test')
|
|
|
|
with subtest("Check custom user and group"):
|
|
out = machine.succeed("cat /etc/udev/rules.d/99-local.rules")
|
|
assert 'KERNEL=="sev", OWNER="root", GROUP="root", MODE="0600"' in out
|
|
assert 'KERNEL=="sev-guest", OWNER="root", GROUP="sevtest", MODE="0660"' in out
|
|
|
|
out = machine.succeed("cat /etc/group")
|
|
assert "sev:" not in out
|
|
assert "sev-guest:" not in out
|
|
assert "sevtest:" in out
|
|
'';
|
|
}
|