new wallpaperthingie
This commit is contained in:
@@ -1,26 +1,35 @@
|
|||||||
{ lib, config, pkgs, flakeRoot, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
flakeRoot,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# Define source and destination paths
|
# Define source and destination paths
|
||||||
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
||||||
destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff";
|
destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff";
|
||||||
wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.wallpaper.enable {
|
config = lib.mkIf config.wallpaper.enable {
|
||||||
# Ensure the destination directory exists
|
# Ensure the destination directory exists
|
||||||
|
home-manager.users.${config.home.username}.home.file."${destination_path}".source = null;
|
||||||
home-manager.users.${config.home.username}.home.file."${destination_path}".createDir = true;
|
home-manager.users.${config.home.username}.home.file."${destination_path}".createDir = true;
|
||||||
|
|
||||||
# Use a script to copy all files from source to destination
|
# Use a script to copy all files from source to destination
|
||||||
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".text = ''
|
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".text =
|
||||||
#!${pkgs.bash}/bin/bash
|
''
|
||||||
mkdir -p "${destination_path}"
|
#!${pkgs.bash}/bin/bash
|
||||||
cp -r "${source_path}"/* "${destination_path}/"
|
cp -r "${source_path}"/* "${destination_path}/"
|
||||||
'';
|
'';
|
||||||
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".executable = true;
|
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".executable =
|
||||||
|
true;
|
||||||
|
|
||||||
# Run the script on activation
|
# Run the script on activation
|
||||||
home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = ''
|
home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = ''
|
||||||
@@ -31,6 +40,7 @@ in {
|
|||||||
home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ];
|
home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ];
|
||||||
|
|
||||||
# Configure wpaperd
|
# Configure wpaperd
|
||||||
home-manager.users.${config.home.username}.home.file."${config.home.homeDirectory}/.config/wpaperd/config.toml".text = builtins.readFile wallpaper_conf;
|
home-manager.users.${config.home.username}.home.file."${config.home.homeDirectory}/.config/wpaperd/config.toml".text =
|
||||||
|
builtins.readFile wallpaper_conf;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user