linux-wallpaperengine: fix evaluation error when passing null (#7161)
This commit is contained in:
parent
d800d198b8
commit
214f9bd3a6
4 changed files with 34 additions and 4 deletions
|
|
@ -19,7 +19,8 @@ in
|
|||
package = lib.mkPackageOption pkgs "linux-wallpaperengine" { };
|
||||
|
||||
assetsPath = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = "Path to the assets directory.";
|
||||
};
|
||||
|
||||
|
|
@ -104,6 +105,10 @@ in
|
|||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.linux-wallpaperengine" pkgs lib.platforms.linux)
|
||||
({
|
||||
assertion = cfg.wallpapers != null;
|
||||
message = "linux-wallpaperengine: You must set at least one wallpaper";
|
||||
})
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
|
@ -135,8 +140,8 @@ in
|
|||
Service = {
|
||||
ExecStart =
|
||||
lib.getExe cfg.package
|
||||
+ " --assets-dir ${cfg.assetsPath} "
|
||||
+ "--clamping ${cfg.clamping} "
|
||||
+ (lib.optionalString (cfg.assetsPath != null) " --assets-dir ${cfg.assetsPath} ")
|
||||
+ (lib.optionalString (cfg.clamping != null) "--clamping ${cfg.clamping} ")
|
||||
+ (lib.strings.concatStringsSep " " args);
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
{ linux-wallpaperengine-basic-configuration = ./basic-configuration.nix; }
|
||||
{
|
||||
linux-wallpaperengine-basic-configuration = ./basic-configuration.nix;
|
||||
linux-wallpaperengine-null-options = ./null-options.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@linux-wallpaperengine@/bin/linux-wallpaperengine
|
||||
Restart=on-failure
|
||||
|
||||
[Unit]
|
||||
After=graphical-session.target
|
||||
Description=Implementation of Wallpaper Engine on Linux
|
||||
PartOf=graphical-session.target
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
services.linux-wallpaperengine = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/linux-wallpaperengine.service \
|
||||
${./null-options-expected.service}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue