Move some (all) files around
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
64
hosts/common/user/configs/gui/swww/default.nix
Normal file
64
hosts/common/user/configs/gui/swww/default.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user.name};
|
||||
themeSwww = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "theme-swww";
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
swww
|
||||
];
|
||||
text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\"";
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
home-manager.users.${user.name} = {
|
||||
home = {
|
||||
packages = with pkgs; [ swww ];
|
||||
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ];
|
||||
};
|
||||
|
||||
systemd.user.services.swww = {
|
||||
Unit = {
|
||||
Description = "Wallpaper daemon";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
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.extraConfig = lib.mkAfter "${themeSwww} &";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user