nix: use reverse-DNS style id as unique identifier
All checks were successful
Test / Create distribution (push) Successful in 19s
Test / Sandbox (push) Successful in 31s
Test / Fortify (push) Successful in 35s
Test / Sandbox (race detector) (push) Successful in 31s
Test / Fortify (race detector) (push) Successful in 35s
Test / Fpkg (push) Successful in 33s
Test / Flake checks (push) Successful in 1m7s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-05-25 20:12:30 +09:00
parent dde2516304
commit 2ffca6984a
5 changed files with 114 additions and 98 deletions

View File

@@ -99,9 +99,10 @@
home.stateVersion = "23.05";
};
apps = [
{
apps = {
"cat.gensokyo.extern.foot.noEnablements" = {
name = "ne-foot";
identity = 1;
verbose = true;
share = pkgs.foot;
packages = with pkgs; [
@@ -115,17 +116,21 @@
dbus = false;
pulse = false;
};
}
{
};
"cat.gensokyo.extern.foot.pulseaudio" = {
name = "pa-foot";
identity = 2;
verbose = true;
share = pkgs.foot;
packages = [ pkgs.foot ];
command = "foot";
capability.dbus = false;
}
{
};
"cat.gensokyo.extern.Alacritty.x11" = {
name = "x11-alacritty";
identity = 3;
verbose = true;
share = pkgs.alacritty;
packages = with pkgs; [
@@ -142,9 +147,11 @@
dbus = false;
pulse = false;
};
}
{
};
"cat.gensokyo.extern.foot.directWayland" = {
name = "da-foot";
identity = 4;
verbose = true;
insecureWayland = true;
share = pkgs.foot;
@@ -159,9 +166,11 @@
dbus = false;
pulse = false;
};
}
{
};
"cat.gensokyo.extern.strace.wantFail" = {
name = "strace-failure";
identity = 5;
verbose = true;
share = pkgs.strace;
command = "strace true";
@@ -171,7 +180,7 @@
dbus = false;
pulse = false;
};
}
];
};
};
};
}

View File

@@ -24,7 +24,7 @@ let
};
callTestCase =
path:
path: identity:
let
tc = import path {
inherit
@@ -36,6 +36,7 @@ let
in
{
name = "check-sandbox-${tc.name}";
inherit identity;
verbose = true;
inherit (tc)
tty
@@ -51,10 +52,12 @@ let
(toString (builtins.toFile "fortify-${tc.name}-want.json" (builtins.toJSON tc.want)))
];
};
testCaseName = name: "cat.gensokyo.fortify.test." + name;
in
{
preset = callTestCase ./preset.nix;
tty = callTestCase ./tty.nix;
mapuid = callTestCase ./mapuid.nix;
device = callTestCase ./device.nix;
${testCaseName "preset"} = callTestCase ./preset.nix 1;
${testCaseName "tty"} = callTestCase ./tty.nix 2;
${testCaseName "mapuid"} = callTestCase ./mapuid.nix 3;
${testCaseName "device"} = callTestCase ./device.nix 4;
}

View File

@@ -6,7 +6,6 @@
}:
let
testProgram = pkgs.callPackage ./tool/package.nix { inherit (config.environment.fortify.package) version; };
testCases = import ./case lib testProgram;
in
{
users.users = {
@@ -76,11 +75,6 @@ in
}
];
apps = with testCases; [
preset
tty
mapuid
device
];
apps = import ./case lib testProgram;
};
}