1 { pkgs, lib, config, nixosConfig, ... }:
3 programs.home-manager.enable = true;
7 ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86_64 [
10 # Keep only the last generation of the home-manager profile
11 home.activation.delete-generations = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
12 if [ "$(${pkgs.coreutils}/bin/id -u)" = 0 ]
13 then profile="''${NIX_STATE_DIR:-/nix/var/nix}/profiles/per-user/$USER"
14 else profile="''${XDG_STATE_HOME:-$HOME/.local/state}"/nix/profiles
16 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile "$profile"/home-manager