2023-05-07 13:53:31 +02:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.my.programs.wallpaper;
|
2023-05-08 12:54:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
script = pkgs.writeShellApplication {
|
|
|
|
name = "wallpaper";
|
|
|
|
runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq fzf viu ];
|
|
|
|
text = builtins.readFile ./wallpaper.sh;
|
|
|
|
};
|
2023-05-07 13:53:31 +02:00
|
|
|
in
|
|
|
|
{
|
2023-05-08 12:54:21 +02:00
|
|
|
options.my.programs.wallpaper = {
|
|
|
|
enable = mkEnableOption "wallpaper";
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = script;
|
|
|
|
};
|
|
|
|
};
|
2023-05-07 13:53:31 +02:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages =
|
|
|
|
[
|
2023-05-08 12:54:21 +02:00
|
|
|
cfg.package
|
2023-05-07 13:53:31 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|