Skip to content

Instantly share code, notes, and snippets.

@ottidmes
Created December 11, 2018 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottidmes/3a0c4adf976c283671619edc18925aaf to your computer and use it in GitHub Desktop.
Save ottidmes/3a0c4adf976c283671619edc18925aaf to your computer and use it in GitHub Desktop.
lspkgs() {
local user_name
user_name=$(id --user --name) &&
nix-instantiate --eval --strict --json --expr \
'map (pkg: pkg.name) (let config = (import <nixpkgs/nixos> { }).config; in config.environment.systemPackages ++ config.users.users."'"$user_name"'".packages)' |
jq --raw-output 'unique | sort_by(ascii_downcase) | .[]'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment