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