diff --git a/modules/hyprlock/hm.nix b/modules/hyprlock/hm.nix index 74c54a9c8..8c59fa387 100644 --- a/modules/hyprlock/hm.nix +++ b/modules/hyprlock/hm.nix @@ -11,9 +11,7 @@ mkTarget { ( { cfg, image }: { - programs.hyprlock.settings.background.path = lib.mkIf cfg.useWallpaper "${ - image - }"; + programs.hyprlock.settings.background.path = lib.mkIf cfg.useWallpaper image; } ) ( diff --git a/modules/hyprpaper/hm.nix b/modules/hyprpaper/hm.nix index 7e6ee8984..4bb027916 100644 --- a/modules/hyprpaper/hm.nix +++ b/modules/hyprpaper/hm.nix @@ -5,7 +5,7 @@ mkTarget { { services.hyprpaper.settings.wallpaper = lib.singleton { monitor = ""; - path = toString image; + path = image; }; }; } diff --git a/stylix/palette.nix b/stylix/palette.nix index 44e339f12..260f850f4 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -28,10 +28,8 @@ in }; image = lib.mkOption { - type = lib.types.nullOr lib.types.path; # Ensure the path is copied to the store - apply = - value: if value == null || lib.isDerivation value then value else "${value}"; + type = with lib.types; nullOr (coercedTo path (src: "${src}") pathInStore); description = '' Wallpaper image. @@ -80,12 +78,10 @@ in # and not anything indirect such as filling a template, otherwise # the output of the palette generator will not be protected from # garbage collection. - default = pkgs.runCommand "palette.json" { } '' - ${lib.getExe cfg.paletteGenerator} \ - "${cfg.polarity}" \ - ${lib.escapeShellArg cfg.image} \ - "$out" - ''; + default = pkgs.runCommand "palette.json" { + inherit (cfg) image polarity; + nativeBuildInputs = [ cfg.paletteGenerator ]; + } ''palette-generator "$polarity" "$image" "$out"''; }; palette = lib.mkOption {