Regenerated
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
{ config, pkgs, flakeRoot, ... }:
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
username = config.users.users.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ bash coreutils ];
|
||||
environment.systemPackages = [ pkgs.bash pkgs.coreutils ];
|
||||
|
||||
systemd.user.services.copyWallpapers = {
|
||||
description = "Copy wallpapers from repo to ~/Wallpapers";
|
||||
@@ -17,10 +17,26 @@ in
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
serviceConfig.ExecStart = ''
|
||||
${pkgs.bash}/bin/bash -c "
|
||||
mkdir -p '${wallpaperDst}'
|
||||
cp -r '${wallpaperSrc}/.' '${wallpaperDst}/'
|
||||
"
|
||||
/bin/sh -c '
|
||||
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
|
||||
|
||||
if [ ! -d "${wallpaperSrc}" ]; then
|
||||
echo "ERROR: ${wallpaperSrc} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${wallpaperDst}"
|
||||
chown -R ${username}:${username} "${wallpaperDst}"
|
||||
|
||||
# Copy everything from source to destination
|
||||
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
|
||||
|
||||
# Fix permissions just in case
|
||||
chown -R ${username}:${username} "${wallpaperDst}"
|
||||
chmod -R u+rwx "${wallpaperDst}"
|
||||
|
||||
echo "Done copying wallpapers."
|
||||
'
|
||||
'';
|
||||
|
||||
serviceConfig.Restart = "no";
|
||||
|
||||
Reference in New Issue
Block a user