feat(hyprland): add random wallpaper service

This commit is contained in:
Moritz Böhme 2023-05-08 12:54:21 +02:00
parent f02b3ae0ea
commit f9fd542206
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
4 changed files with 70 additions and 42 deletions

View file

@ -4,21 +4,27 @@
with lib;
let
cfg = config.my.programs.wallpaper;
script = pkgs.writeShellApplication {
name = "wallpaper";
runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq fzf viu ];
text = builtins.readFile ./wallpaper.sh;
};
in
{
options.my.programs.wallpaper.enable = mkEnableOption "wallpaper";
options.my.programs.wallpaper = {
enable = mkEnableOption "wallpaper";
package = mkOption {
type = types.package;
default = script;
};
};
config = mkIf cfg.enable {
environment.systemPackages =
let
wallpaper = pkgs.writeShellApplication {
name = "wallpaper";
runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq fzf viu ];
text = builtins.readFile ./wallpaper.sh;
};
in
[
wallpaper
cfg.package
];
};
}