Skip to content

Commit

Permalink
[O] NixOS XDG path #255
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Apr 25, 2024
1 parent dbe657a commit 9292a60
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,15 @@ get_packages() {
# Other (Needs complex command)
has kpm-pkg && ((packages+=$(kpm --get-selections | grep -cv deinstall$)))

nix-user-pkgs() {
if [ -d ~/.nix-profile ]; then
nix-store -qR ~/.nix-profile
elif [ -d "$XDG_STATE_HOME/nix/profile" ]; then
nix-store -qR "$XDG_STATE_HOME/nix/profile"
fi
nix-store -qR /etc/profiles/per-user/"$USER"
}

# Separate system and user packages
if [[ $package_separate == on ]]; then
has guix && {
Expand All @@ -2177,10 +2186,6 @@ get_packages() {
}

has nix-store && {
nix-user-pkgs() {
nix-store -qR ~/.nix-profile
nix-store -qR /etc/profiles/per-user/"$USER"
}
manager=nix-system && tot nix-store -qR /run/current-system/sw
manager=nix-user && tot nix-user-pkgs
manager=nix-default && tot nix-store -qR /nix/var/nix/profiles/default
Expand All @@ -2202,8 +2207,7 @@ get_packages() {

has nix-store && {
nix-all() {
nix-store -qR ~/.nix-profile
nix-store -qR /etc/profiles/per-user/"$USER"
nix-user-pkgs
nix-store -qR /run/current-system/sw
nix-store -qR /nix/var/nix/profiles/default
}
Expand Down

0 comments on commit 9292a60

Please sign in to comment.