fork/home-manager
git clone https://git.julia.blue/fork/home-manager
7ac2cd01
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . systemd . user . tmpfiles ; 8 9in { 10meta . maintainers = [ maintainers . dawidsowa ]; 11 12options . systemd . user . tmpfiles . rules = mkOption { 13type = types . listOf types . str ; 14default = [ ]; 15example = [ "L /home/user/Documents - - - - /mnt/data/Documents" ]; 16description = '' 17Rules for creating and cleaning up temporary files 18automatically. See 19{manpage}`tmpfiles.d(5)` 20for the exact format. 21'' ; 22}; 23 24config = mkIf ( cfg . rules != [ ]) { 25assertions = [ 26( hm . assertions . assertPlatform "systemd.user.tmpfiles" pkgs 27platforms . linux ) 28]; 29 30xdg . configFile = { 31"user-tmpfiles.d/home-manager.conf" = { 32text = '' 33# This file is created automatically and should not be modified. 34# Please change the option ‘systemd.user.tmpfiles.rules’ instead. 35${ concatStringsSep "\n" cfg . rules } 36'' ; 37onChange = " ${ pkgs . systemd } /bin/systemd-tmpfiles --user --create" ; 38}; 39"systemd/user/basic.target.wants/systemd-tmpfiles-setup.service" . source = 40" ${ pkgs . systemd } /example/systemd/user/systemd-tmpfiles-setup.service" ; 41"systemd/user/systemd-tmpfiles-setup.service" . source = 42" ${ pkgs . systemd } /example/systemd/user/systemd-tmpfiles-setup.service" ; 43"systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer" . source = 44" ${ pkgs . systemd } /example/systemd/user/systemd-tmpfiles-clean.timer" ; 45"systemd/user/systemd-tmpfiles-clean.service" . source = 46" ${ pkgs . systemd } /example/systemd/user/systemd-tmpfiles-clean.service" ; 47}; 48}; 49}