Regenerated
This commit is contained in:
+322
-312
File diff suppressed because it is too large
Load Diff
+34
-24
@@ -2361,47 +2361,57 @@ Setting up wallpaper engine + wallpaper gui
|
|||||||
{ config, pkgs, lib, flakeRoot, ... }:
|
{ config, pkgs, lib, flakeRoot, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
username = config.defaultUser or "henrov";
|
username = config.users.users.defaultUser or "henrov";
|
||||||
homeDir = "/home/${username}";
|
homeDir = "/home/${username}";
|
||||||
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
||||||
wallpaperDst = "${homeDir}/Wallpapers";
|
wallpaperDst = "${homeDir}/Wallpapers";
|
||||||
scriptFile = "${homeDir}/copy-wallpapers.sh";
|
scriptFile = "${homeDir}/copy-wallpapers.sh";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
############################
|
||||||
# Ensure bash exists
|
# Ensure bash exists
|
||||||
|
############################
|
||||||
environment.systemPackages = [ pkgs.bash ];
|
environment.systemPackages = [ pkgs.bash ];
|
||||||
|
|
||||||
# Drop the script into home
|
############################
|
||||||
|
# Create the script in the user's home
|
||||||
|
############################
|
||||||
home-manager.users = {
|
home-manager.users = {
|
||||||
${username} = {
|
${username} = {
|
||||||
home.file."copy-wallpapers.sh".text = ''
|
home.file."copy-wallpapers.sh".text = ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
|
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
|
|
||||||
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
|
|
||||||
# Fix permissions
|
|
||||||
chown -R ${username}:${username} "${wallpaperDst}"
|
|
||||||
chmod -R u+rwx "${wallpaperDst}"
|
|
||||||
echo "Done copying wallpapers."
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# User service that runs the script
|
if [ ! -d "${wallpaperSrc}" ]; then
|
||||||
|
echo "ERROR: ${wallpaperSrc} does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${wallpaperDst}"
|
||||||
|
|
||||||
|
# Copy everything
|
||||||
|
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
|
||||||
|
|
||||||
|
# Fix permissions
|
||||||
|
chmod -R u+rwx "${wallpaperDst}"
|
||||||
|
|
||||||
|
echo "Done copying wallpapers."
|
||||||
|
'';
|
||||||
|
home.file."copy-wallpapers.sh".executable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
############################
|
||||||
|
# User systemd service that runs the script
|
||||||
|
############################
|
||||||
systemd.user.services.copyWallpapers = {
|
systemd.user.services.copyWallpapers = {
|
||||||
description = "Copy wallpapers from repo to ~/Wallpapers";
|
description = "Copy wallpapers from repo to ~/Wallpapers";
|
||||||
wants = [ "graphical-session.target" ];
|
wants = [ "graphical-session.target" ];
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.ExecStart = "${scriptFile}";
|
serviceConfig.ExecStart = scriptFile;
|
||||||
serviceConfig.Restart = "no";
|
serviceConfig.Restart = "no";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,57 @@
|
|||||||
{ config, pkgs, lib, flakeRoot, ... }:
|
{ config, pkgs, lib, flakeRoot, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
username = config.defaultUser or "henrov";
|
username = config.users.users.defaultUser or "henrov";
|
||||||
homeDir = "/home/${username}";
|
homeDir = "/home/${username}";
|
||||||
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
||||||
wallpaperDst = "${homeDir}/Wallpapers";
|
wallpaperDst = "${homeDir}/Wallpapers";
|
||||||
scriptFile = "${homeDir}/copy-wallpapers.sh";
|
scriptFile = "${homeDir}/copy-wallpapers.sh";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
############################
|
||||||
# Ensure bash exists
|
# Ensure bash exists
|
||||||
|
############################
|
||||||
environment.systemPackages = [ pkgs.bash ];
|
environment.systemPackages = [ pkgs.bash ];
|
||||||
|
|
||||||
# Drop the script into home
|
############################
|
||||||
|
# Create the script in the user's home
|
||||||
|
############################
|
||||||
home-manager.users = {
|
home-manager.users = {
|
||||||
${username} = {
|
${username} = {
|
||||||
home.file."copy-wallpapers.sh".text = ''
|
home.file."copy-wallpapers.sh".text = ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
echo "Copying wallpapers from ${wallpaperSrc} to ${wallpaperDst} ..."
|
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
|
|
||||||
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
|
|
||||||
# Fix permissions
|
|
||||||
chown -R ${username}:${username} "${wallpaperDst}"
|
|
||||||
chmod -R u+rwx "${wallpaperDst}"
|
|
||||||
echo "Done copying wallpapers."
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# User service that runs the script
|
if [ ! -d "${wallpaperSrc}" ]; then
|
||||||
|
echo "ERROR: ${wallpaperSrc} does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${wallpaperDst}"
|
||||||
|
|
||||||
|
# Copy everything
|
||||||
|
cp -r "${wallpaperSrc}/." "${wallpaperDst}/"
|
||||||
|
|
||||||
|
# Fix permissions
|
||||||
|
chmod -R u+rwx "${wallpaperDst}"
|
||||||
|
|
||||||
|
echo "Done copying wallpapers."
|
||||||
|
'';
|
||||||
|
home.file."copy-wallpapers.sh".executable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
############################
|
||||||
|
# User systemd service that runs the script
|
||||||
|
############################
|
||||||
systemd.user.services.copyWallpapers = {
|
systemd.user.services.copyWallpapers = {
|
||||||
description = "Copy wallpapers from repo to ~/Wallpapers";
|
description = "Copy wallpapers from repo to ~/Wallpapers";
|
||||||
wants = [ "graphical-session.target" ];
|
wants = [ "graphical-session.target" ];
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.ExecStart = "${scriptFile}";
|
serviceConfig.ExecStart = scriptFile;
|
||||||
serviceConfig.Restart = "no";
|
serviceConfig.Restart = "no";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user