rebuilding minimised nix files
This commit is contained in:
@@ -1,30 +1,9 @@
|
||||
#+begin_src nix :tangle home/desktop/wallpaper.nix :noweb tangle :mkdirp yes
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
let
|
||||
repoWallpaperDir = flakeRoot.outPath + "/assets/conf/desktop/wallpaper";
|
||||
repoWallpaperConf = flakeRoot.outPath + "/assets/conf/desktop/wallpaper/wallpaper.conf";
|
||||
userRelRoot = "nixos_conf/wallpaperstuff";
|
||||
userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}";
|
||||
userConfPath = "${userAbsRoot}/wallpaper.conf";
|
||||
# Exclude wallpaper.conf so HM does NOT manage it (avoids backup collisions)
|
||||
repoWallpapersOnly = lib.cleanSourceWith {
|
||||
src = repoWallpaperDir;
|
||||
filter = path: type: (builtins.baseNameOf path) != "wallpaper.conf";
|
||||
};
|
||||
userConfPath = "${config.home.homeDirectory}/nixos_conf/wallpaperstuff/wallpaper.conf";
|
||||
in
|
||||
{
|
||||
home.packages = [ pkgs.wpaperd ];
|
||||
# Sync everything *except* wallpaper.conf into ~/nixos_conf/wallpaperstuff
|
||||
home.file."${userRelRoot}" = {
|
||||
source = lib.mkForce repoWallpapersOnly;
|
||||
recursive = true;
|
||||
};
|
||||
# Now safely overwrite the config every activation (no HM collision)
|
||||
home.activation.wallpaperConfForce = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
set -euo pipefail
|
||||
mkdir -p "${userAbsRoot}"
|
||||
install -m 0644 "${repoWallpaperConf}" "${userConfPath}"
|
||||
'';
|
||||
systemd.user.services.wpaperd = {
|
||||
Unit = {
|
||||
Description = "wpaperd wallpaper daemon";
|
||||
|
||||
Reference in New Issue
Block a user