]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/nix.nix
oignon: add games
[julm/julm-nix.git] / home-manager / profiles / nix.nix
1 { pkgs, lib, config, nixosConfig, ... }:
2 {
3 programs.home-manager.enable = true;
4 home.packages = [
5 pkgs.home-manager
6 pkgs.nix-du
7 pkgs.nix-tree
8 ];
9 # Keep only the last generation of the home-manager profile
10 home.activation.delete-generations = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
11 if [ "$(${pkgs.coreutils}/bin/id -u)" = 0 ]
12 then profile="''${NIX_STATE_DIR:-/nix/var/nix}/profiles/per-user/$USER"
13 else profile="''${XDG_STATE_HOME:-$HOME/.local/state}"/nix/profiles
14 fi
15 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile "$profile"/home-manager
16 '';
17 }