{ config, lib, pkgs, ... }: { system.activationScripts.applications.text = let appsSrc = config.system.build.applications + /Applications; baseDir = "/Applications/Nix Apps"; in pkgs.lib.mkForce '' echo 'Setting up /Applications/Nix Apps...' >&2 appsSrc="${appsSrc}" if [ -d "$appsSrc" ]; then baseDir="${baseDir}" rsyncFlags=( --archive --checksum --chmod=-w --copy-unsafe-links --delete --no-group --no-owner ) $DRY_RUN_CMD mkdir -p "$baseDir" $DRY_RUN_CMD ${lib.getBin pkgs.rsync}/bin/rsync \ ''${VERBOSE_ARG:+-v} "''${rsyncFlags[@]}" "$appsSrc/" "$baseDir" fi ''; # nix auto garbage collection nix.gc = { automatic = true; interval = { Weekday = 0; Hour = 0; Minute = 0; }; options = "--delete-older-than 7d"; }; # changing this might break system.stateVersion = 5; }