Reorganize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
68
hosts/common/configs/user/gui/swww/default.nix
Normal file
68
hosts/common/configs/user/gui/swww/default.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
utils,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
themeSwww = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "theme-swww";
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
swww
|
||||
];
|
||||
text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\"";
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.cache/swww" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ swww ];
|
||||
|
||||
systemd.user.services.swww = {
|
||||
Unit = {
|
||||
Description = "Wallpaper daemon";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/swww".mount
|
||||
];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "forking";
|
||||
|
||||
ExecStart = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "init-swww";
|
||||
runtimeInputs = with pkgs; [ swww ];
|
||||
text = "exec swww init";
|
||||
}
|
||||
);
|
||||
|
||||
ExecStartPost = themeSwww;
|
||||
|
||||
ExecStop = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "kill-swww";
|
||||
runtimeInputs = with pkgs; [ swww ];
|
||||
text = "exec swww kill";
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
theme.reloadExtraConfig = "${themeSwww} &";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user