Last active
October 17, 2024 05:13
-
-
Save arianvp/f6b3c45ae73dad3c5e031aa801e96278 to your computer and use it in GitHub Desktop.
Declaratively manage packages without NixOS or home-manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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