mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
darkman: allow no configuration
Closes #4779 Signed-off-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
1c2c5e4cab
commit
eb869521cb
3 changed files with 43 additions and 2 deletions
|
@ -52,6 +52,7 @@ in {
|
|||
|
||||
settings = mkOption {
|
||||
type = types.submodule { freeformType = yamlFormat.type; };
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
lat = 52.3;
|
||||
|
@ -96,7 +97,7 @@ in {
|
|||
Documentation = "man:darkman(1)";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
X-Restart-Triggers =
|
||||
X-Restart-Triggers = mkIf (cfg.settings != { })
|
||||
[ "${config.xdg.configFile."darkman/config.yaml".source}" ];
|
||||
};
|
||||
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
{ darkman-basic-configuration = ./basic-configuration.nix; }
|
||||
{
|
||||
darkman-basic-configuration = ./basic-configuration.nix;
|
||||
darkman-no-configuration = ./no-configuration.nix;
|
||||
}
|
||||
|
|
37
tests/modules/services/darkman/no-configuration.nix
Normal file
37
tests/modules/services/darkman/no-configuration.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
services.darkman.enable = true;
|
||||
|
||||
test.stubs = {
|
||||
python = { };
|
||||
darkman = { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/darkman.service)
|
||||
|
||||
assertFileExists $serviceFile
|
||||
assertFileContent $serviceFile ${
|
||||
builtins.toFile "expected" ''
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
||||
[Service]
|
||||
BusName=nl.whynothugo.darkman
|
||||
ExecStart=@darkman@/bin/dummy run
|
||||
Restart=on-failure
|
||||
Slice=background.slice
|
||||
TimeoutStopSec=15
|
||||
Type=dbus
|
||||
|
||||
[Unit]
|
||||
BindsTo=graphical-session.target
|
||||
Description=Darkman system service
|
||||
Documentation=man:darkman(1)
|
||||
PartOf=graphical-session.target
|
||||
''
|
||||
}
|
||||
assertPathNotExists home-files/.local/share/dark-mode.d/color-scheme-dark
|
||||
assertPathNotExists home-files/.local/share/light-mode.d/color-scheme-light
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in a new issue