nix-dotfiles/modules/desktop/swww.nix

28 lines
No EOL
710 B
Nix

{ lib, config, inputs, system, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.swww;
img = ../../assets/wallpaper.png;
in {
options.modules.desktop.swww = {
enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes";
package = mkOption {
type = types.package;
default = pkgs.swww;
example = "pkgs.swww";
};
startScript = mkOption {
type = types.package;
default = pkgs.writeScript "swww-start" ''
${cfg.package}/bin/swww-daemon &
${lib.getExe cfg.package} img "${img}" --transition-type none
'';
};
};
config = mkIf cfg.enable {
modules.desktop.execOnStart = [ "${cfg.startScript}" ];
};
}