From 4907087ff4a1c27826c1f12a077cdab527d5961d Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Thu, 19 Mar 2026 06:52:10 +0000 Subject: [PATCH] Working on reshuffling --- Droidnix/README.org | 49 ++++++++++++------- .../modules/desktop/rotating_wallpaper.nix | 49 ++++++++++++------- 2 files changed, 62 insertions(+), 36 deletions(-) diff --git a/Droidnix/README.org b/Droidnix/README.org index 288c64db3..2834ee330 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -672,28 +672,41 @@ rotating_wallpaper.nix installs wpaperd and deploys your wallpaper files from th You can edit assets/hyprland/wallpaperstuff/wallpaper.toml to change settings Finally, it creates a systemd user service (wpaperd.service) that automatically starts wpaperd at login and keeps it running, using your override config so wallpapers rotate according to your settings. #+BEGIN_SRC nix :tangle generated/modules/desktop/rotating_wallpaper.nix :noweb tangle :mkdirp yes :eval never-html -{ config, pkgs, lib, flakeRoot, ... }: +{ lib, ... }: -let - # Pad naar de wallpaper config in de flake - wallpaperConf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.toml"; -in { - # Installeer wpaperd voor de gebruiker - home.packages = [ pkgs.wpaperd ]; + flake.nixosModules.rotating-wallpaper = { config, pkgs, lib, ... }: - # Plaats wallpaper.toml automatisch in $HOME/.config/wpaperd - home.file.".config/wpaperd/wallpaper.toml".source = wallpaperConf; + let + wallpaperConf = ../../../assets/hyprland/wallpaperstuff/wallpaper.toml; + in + { + options.mySystem.desktop.wallpaper.enable = + lib.mkEnableOption "Enable rotating wallpaper via wpaperd"; - # Systemd user service - systemd.user.services.wpaperd = { - description = "wpaperd wallpaper daemon"; - wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.wpaperd}/bin/wpaperd --config ${config.home.homeDirectory}/.config/wpaperd/wallpaper.toml"; - Restart = "on-failure"; - RestartSec = 1; + config = lib.mkIf (config.mySystem.desktop.wallpaper.enable or false) { + + # Home Manager context + home-manager.users.henrov = { + + home.packages = [ pkgs.wpaperd ]; + + home.file.".config/wpaperd/wallpaper.toml".source = + wallpaperConf; + + systemd.user.services.wpaperd = { + description = "wpaperd wallpaper daemon"; + wantedBy = [ "default.target" ]; + + serviceConfig = { + Type = "simple"; + ExecStart = + "${pkgs.wpaperd}/bin/wpaperd --config ~/.config/wpaperd/wallpaper.toml"; + Restart = "on-failure"; + RestartSec = 1; + }; + }; + }; }; }; } diff --git a/Droidnix/generated/modules/desktop/rotating_wallpaper.nix b/Droidnix/generated/modules/desktop/rotating_wallpaper.nix index 0929b45af..0a862e6b0 100644 --- a/Droidnix/generated/modules/desktop/rotating_wallpaper.nix +++ b/Droidnix/generated/modules/desktop/rotating_wallpaper.nix @@ -1,25 +1,38 @@ -{ config, pkgs, lib, flakeRoot, ... }: +{ lib, ... }: -let - # Pad naar de wallpaper config in de flake - wallpaperConf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.toml"; -in { - # Installeer wpaperd voor de gebruiker - home.packages = [ pkgs.wpaperd ]; + flake.nixosModules.rotating-wallpaper = { config, pkgs, lib, ... }: - # Plaats wallpaper.toml automatisch in $HOME/.config/wpaperd - home.file.".config/wpaperd/wallpaper.toml".source = wallpaperConf; + let + wallpaperConf = ../../../assets/hyprland/wallpaperstuff/wallpaper.toml; + in + { + options.mySystem.desktop.wallpaper.enable = + lib.mkEnableOption "Enable rotating wallpaper via wpaperd"; - # Systemd user service - systemd.user.services.wpaperd = { - description = "wpaperd wallpaper daemon"; - wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.wpaperd}/bin/wpaperd --config ${config.home.homeDirectory}/.config/wpaperd/wallpaper.toml"; - Restart = "on-failure"; - RestartSec = 1; + config = lib.mkIf (config.mySystem.desktop.wallpaper.enable or false) { + + # Home Manager context + home-manager.users.henrov = { + + home.packages = [ pkgs.wpaperd ]; + + home.file.".config/wpaperd/wallpaper.toml".source = + wallpaperConf; + + systemd.user.services.wpaperd = { + description = "wpaperd wallpaper daemon"; + wantedBy = [ "default.target" ]; + + serviceConfig = { + Type = "simple"; + ExecStart = + "${pkgs.wpaperd}/bin/wpaperd --config ~/.config/wpaperd/wallpaper.toml"; + Restart = "on-failure"; + RestartSec = 1; + }; + }; + }; }; }; }