swaylock: add enable and package option
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
75f4f362e1
commit
2df3d5d39c
5 changed files with 87 additions and 31 deletions
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
swaylock-disabled = import ./disabled.nix;
|
||||
swaylock-settings = import ./settings.nix;
|
||||
swaylock-enabled = import ./enabled.nix;
|
||||
swaylock-legacy = import ./legacy.nix;
|
||||
}
|
||||
|
|
|
|||
10
tests/modules/programs/swaylock/enabled.nix
Normal file
10
tests/modules/programs/swaylock/enabled.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }: {
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/swaylock/config
|
||||
'';
|
||||
}
|
||||
19
tests/modules/programs/swaylock/legacy.nix
Normal file
19
tests/modules/programs/swaylock/legacy.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
home.stateVersion = "20.09";
|
||||
programs.swaylock = {
|
||||
settings = {
|
||||
color = "808080";
|
||||
font-size = 24;
|
||||
indicator-idle-visible = false; # Test that this does nothing
|
||||
indicator-radius = 100;
|
||||
line-color = "ffffff";
|
||||
show-failed-attempts = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = let homeConfig = "home-files/.config/swaylock/config";
|
||||
in ''
|
||||
assertFileExists ${homeConfig}
|
||||
assertFileContent ${homeConfig} ${./config}
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
{ ... }: {
|
||||
programs.swaylock.settings = {
|
||||
color = "808080";
|
||||
font-size = 24;
|
||||
indicator-idle-visible = false; # Test that this does nothing
|
||||
indicator-radius = 100;
|
||||
line-color = "ffffff";
|
||||
show-failed-attempts = true;
|
||||
{
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
color = "808080";
|
||||
font-size = 24;
|
||||
indicator-idle-visible = false; # Test that this does nothing
|
||||
indicator-radius = 100;
|
||||
line-color = "ffffff";
|
||||
show-failed-attempts = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = let homeConfig = "home-files/.config/swaylock/config";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue