1import ./make-test-python.nix
2 ({ lib, ... }:
3 {
4 name = "dconf";
5
6 meta.maintainers = with lib.maintainers; [
7 linsui
8 ];
9
10 nodes.machine = { config, pkgs, lib, ... }: {
11 users.extraUsers.alice = { isNormalUser = true; };
12 programs.dconf = with lib.gvariant; {
13 enable = true;
14 profiles.user.databases = [
15 {
16 settings = {
17 "test/not".locked = mkInt32 1;
18 "test/is".locked = "locked";
19 };
20 locks = [
21 "/test/is/locked"
22 ];
23 }
24 ];
25 };
26 };
27
28 testScript = ''
29 machine.succeed("test $(dconf read -d /test/not/locked) == 1")
30 machine.succeed("test $(dconf read -d /test/is/locked) == \"'locked'\"")
31 machine.fail("sudo -u alice dbus-run-session -- dconf write /test/is/locked \"@s 'unlocked'\"")
32 machine.succeed("sudo -u alice dbus-run-session -- dconf write /test/not/locked \"@i 2\"")
33 '';
34 })