by _query · 10y ago · 0 comments
Package customizations like a .vimrc is also handled by nix (I recently blogged about how I do this: https://www.mpscholten.de/nixos/2016/05/26/sharing-configura...).
The shell scripts together with the package customizations (e.g. my custom vimrc) are managed by git.
- System-wide packages, systemd services, users, cronjobs, etc. are managed by /etc/nixos/configuration.nix
- My user profile has one package installed, which depends on all of the tools I want to be generally available (emacs, firefox, etc.). By using a single meta-package like this, I can manage it using git and it makes updates/rollbacks easier
- Each project I work on maintains its own lists of dependencies (either directly in a .nix file, or converted automatically from other formats like .cabal), which are brought into scope by nix-shell
- I also have a bunch of scripts which use nix-shell shebangs, so their dependencies are fetched when invoked, and available for garbage collection once they're finished
# ~/.nixpkgs/config.nix
{
packageOverrides = defaultPkgs: with defaultPkgs; {
# To install below "pseudo-package", run:
# $ nix-env -i all
# or:
# $ nix-env -iA nixos.all
all = with pkgs; buildEnv {
name = "all";
paths = [
fpp wget iterm2 jekyll
ghc ruby nodejs composer php
];
};
};
}
and then keep only this one file in git. (Though still working on how to possibly also keep .inputrc, .bashrc, .profile, etc. in it.)