Regenerated

This commit is contained in:
2026-03-29 15:00:33 +00:00
parent b176bed95a
commit eba32e9fde
3 changed files with 390 additions and 384 deletions
+322 -320
View File
File diff suppressed because it is too large Load Diff
+34 -32
View File
@@ -2358,61 +2358,63 @@ workspace {
** =generated/modules/traveldroid/desktop/wallpaper.nix=
Setting up wallpaper engine + wallpaper gui
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/desktop/wallpaper.nix :noweb yes :mkdirp yes :eval never
{ config, pkgs, lib, flakeRoot, ... }:
{ lib, config, pkgs, flakeRoot, ... }:
let
username = config.users.users.defaultUser or "henrov";
username = config.defaultUser or "henrov";
homeDir = "/home/${username}";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
wallpaperDst = "${homeDir}/Wallpapers";
scriptFile = "${homeDir}/copy-wallpapers.sh";
in
{
############################
# Ensure bash exists
############################
# Make bash available
environment.systemPackages = [ pkgs.bash ];
############################
# Create the script in the user's home
############################
# Create the copy script using Home Manager, following Waybar style
home-manager.users = {
${username} = {
home.file."copy-wallpapers.sh".text = ''
#!/usr/bin/env bash
set -e
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
home.file = {
"copy-wallpapers.sh" = {
text = ''
#!/usr/bin/env bash
set -e
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
if [ ! -d "${wallpaperSrc}" ]; then
echo "ERROR: ${wallpaperSrc} does not exist"
exit 1
fi
if [ ! -d "${wallpaperSrc}" ]; then
echo "ERROR: ${wallpaperSrc} does not exist"
exit 1
fi
mkdir -p "${wallpaperDst}"
mkdir -p "${wallpaperDst}"
# Copy everything
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
# Simple copy, overwrite everything
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
# Fix permissions
chmod -R u+rwx "${wallpaperDst}"
# Fix permissions
chmod -R u+rwx "${wallpaperDst}"
echo "Done copying wallpapers."
'';
home.file."copy-wallpapers.sh".executable = true;
echo "Done copying wallpapers."
'';
executable = true;
force = true;
};
};
};
};
############################
# User systemd service that runs the script
############################
# User service to run the script
systemd.user.services.copyWallpapers = {
description = "Copy wallpapers from repo to ~/Wallpapers";
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = scriptFile;
serviceConfig.Restart = "no";
serviceConfig = {
Type = "oneshot";
ExecStart = "${homeDir}/copy-wallpapers.sh";
Restart = "no";
};
wantedBy = [ "default.target" ];
};
}
#+END_SRC
@@ -1,57 +1,59 @@
{ config, pkgs, lib, flakeRoot, ... }:
{ lib, config, pkgs, flakeRoot, ... }:
let
username = config.users.users.defaultUser or "henrov";
username = config.defaultUser or "henrov";
homeDir = "/home/${username}";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
wallpaperDst = "${homeDir}/Wallpapers";
scriptFile = "${homeDir}/copy-wallpapers.sh";
in
{
############################
# Ensure bash exists
############################
# Make bash available
environment.systemPackages = [ pkgs.bash ];
############################
# Create the script in the user's home
############################
# Create the copy script using Home Manager, following Waybar style
home-manager.users = {
${username} = {
home.file."copy-wallpapers.sh".text = ''
#!/usr/bin/env bash
set -e
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
home.file = {
"copy-wallpapers.sh" = {
text = ''
#!/usr/bin/env bash
set -e
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
if [ ! -d "${wallpaperSrc}" ]; then
echo "ERROR: ${wallpaperSrc} does not exist"
exit 1
fi
if [ ! -d "${wallpaperSrc}" ]; then
echo "ERROR: ${wallpaperSrc} does not exist"
exit 1
fi
mkdir -p "${wallpaperDst}"
mkdir -p "${wallpaperDst}"
# Copy everything
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
# Simple copy, overwrite everything
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
# Fix permissions
chmod -R u+rwx "${wallpaperDst}"
# Fix permissions
chmod -R u+rwx "${wallpaperDst}"
echo "Done copying wallpapers."
'';
home.file."copy-wallpapers.sh".executable = true;
echo "Done copying wallpapers."
'';
executable = true;
force = true;
};
};
};
};
############################
# User systemd service that runs the script
############################
# User service to run the script
systemd.user.services.copyWallpapers = {
description = "Copy wallpapers from repo to ~/Wallpapers";
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = scriptFile;
serviceConfig.Restart = "no";
serviceConfig = {
Type = "oneshot";
ExecStart = "${homeDir}/copy-wallpapers.sh";
Restart = "no";
};
wantedBy = [ "default.target" ];
};
}