Regenerated

This commit is contained in:
2026-03-26 11:02:06 +00:00
parent 7611b24984
commit 5f20fa88e0
2 changed files with 211 additions and 0 deletions
@@ -0,0 +1,103 @@
{ lib, config, pkgs, flakeRoot, ... }:
let
username = config.defaultUser or "henrov";
homeDir = "/home/${username}";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/copy_2_home/wallpaperstuff";
wallpaperDst = "${homeDir}/wallpaperstuff";
in
{
#################################
# System packages (global)
#################################
environment.systemPackages = [
pkgs.swww
pkgs.waypaper
pkgs.rsync
];
#################################
# Copy editable wallpaper folder
#################################
systemd.services.copyWallpaperStuff = {
description = "Copy wallpaper assets to user home";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
};
script = ''
if [ ! -d "${wallpaperDst}" ]; then
mkdir -p "${wallpaperDst}"
cp -r ${wallpaperSrc}/* "${wallpaperDst}/"
fi
chown -R ${username}:${username} "${wallpaperDst}"
chmod -R u+rwx "${wallpaperDst}"
'';
};
#################################
# Home Manager integration
#################################
_module.args.hmUsers = {
${username} = {
#################################
# User packages
#################################
home.packages = [
pkgs.swww
pkgs.waypaper
];
#################################
# swww daemon
#################################
systemd.user.services.swww-daemon = {
Unit = {
Description = "swww wallpaper daemon";
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.swww}/bin/swww-daemon";
Restart = "on-failure";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
#################################
# Set initial wallpaper
#################################
systemd.user.services.swww-init = {
Unit = {
Description = "Initialize wallpaper with swww";
After = [ "swww-daemon.service" ];
};
Service = {
Type = "oneshot";
ExecStart = ''
${pkgs.swww}/bin/swww img ${wallpaperDst}/* --transition-type any
'';
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
};
}