Skip to content

Instantly share code, notes, and snippets.

@arianvp
Last active March 5, 2023 10:34
Show Gist options
  • Save arianvp/f6b3c45ae73dad3c5e031aa801e96278 to your computer and use it in GitHub Desktop.
Save arianvp/f6b3c45ae73dad3c5e031aa801e96278 to your computer and use it in GitHub Desktop.
Declaratively manage packages without NixOS or home-manager
# add your package set to your existing environment (together with the things you installed imperatively)
$ nix-env -i -f ./packages.nix
# More declarative: _replace_ your environment with _exactly_ what is in ./packages.nix
$ nix-env --set -f ./packages.nix
# Show previous versions
$ nix-env --list-generations
# Rollback
$ nix-env --rollback
{ pkgs ? import <nixpkgs> {} }:
pkgs.buildEnv {
name = "user-environment";
paths = with pkgs; [
ag
firefox
fzf
git
gnupg
htop
libreoffice
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment