Personal-use NixOS configuration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Guest account cleanup POC

encode42 d362a7f9 05be66bd

+24
+24
hosts/prospect/users/guest.nix
··· 17 17 isNormalUser = true; 18 18 19 19 description = "Guest"; 20 + 21 + password = ""; 20 22 }; 21 23 22 24 home-manager.users.guest = { ··· 26 28 ]; 27 29 28 30 home.stateVersion = "25.05"; 31 + }; 32 + 33 + systemd.services.clean-guest-home = { 34 + description = "Perform guest account cleanup"; 35 + wantedBy = [ "halt.target" "reboot.target" ]; 36 + before = [ "halt.target" "reboot.target" ]; 37 + 38 + serviceConfig = { 39 + Type = "oneshot"; 40 + 41 + ExecStart = pkgs.writeShellScript "clean-guest-home" '' 42 + find ${home-manager.users.guest.homeDirectory} \ 43 + -mindepth 1 \ 44 + -not -path "$HOME/.nix-profile" \ 45 + -not -path "$HOME/.nix-profile/*" \ 46 + -not -path "$HOME/.config" \ 47 + -not -path "$HOME/.config/*" \ 48 + -not -path "$HOME/.local" \ 49 + -not -path "$HOME/.local/*" \ 50 + -exec echo {} + 51 + ''; 52 + }; 29 53 }; 30 54 }