This repository is a Nix Flake. To use it, your Nix usage should have the experimental features nix-command and flakes enabled. See the wiki for more details.
- If you're on NixOS already there's not much else needed regarding applying system-level configs. Run
sudo nixos-rebuild switch --flake .#<HOSTNAME>to apply the desired system configuration. To install NixOS, see the instructions on the official site. - (Non-NixOS), install Nix by going to https://nixos.org/download/ and following instructions for your platform.
- (macOS) If you want to use the
nix-darwinconfigurations, installnix-darwinvia switching to one of the existing configs directly withsudo nix --extra-experimental-features "nix-command flakes" run nix-darwin/master#darwin-rebuild -- switch --flake .#<HOSTNAME>.- If there's no config you desire to apply just yet, follow the instructions to do a basic installation at the
nix-darwinrepo.
- If there's no config you desire to apply just yet, follow the instructions to do a basic installation at the
- To use the
home-managerconfigurations, installhome-managervia switching to one of the existing configs directly withnix --extra-experimental-features "nix-command flakes" run home-manager/master -- switch --flake .#<USER>@<HOSTNAME>.- If you do not have an existing config that is applicable, follow the instructions to do a basic installation at the
home-managerrepo.
- If you do not have an existing config that is applicable, follow the instructions to do a basic installation at the
- Enjoy!
To speed up the build processes, you can use my binary cache as substituter. If using cachix, you can enable it quickly with cachix use davsanchez, this would modify your local ~/.config/nix/nix.conf adding my cache URL and public key.
You might want to get rid of the configs and the programs that manage it, either for temporary maintenance reasons (e.g. perhaps you were bit by macOS Sequoia stepping over the builder users created by Nix, so you want to start from scratch to avoid any issues) or maybe because you just don't want to use Nix anymore. In any case, you can uninstall everything by going through these steps.
-
(macOS) Uninstall
nix-darwinwithnix --extra-experimental-features "nix-command flakes" run nix-darwin#darwin-uninstaller. -
After running the command above you might run into problems regarding SSL CA certs. With an error like this one:
error: unable to download 'https://cache.nixos.org/d9l4i5phhrwy8f0yjp5yj4ri65z9cxzb.narinfo': Problem with the SSL CA cert (path? access rights?) (77)
To fix this issue, restore the old link to
/etc/ssl/certs/ca-certificates.crt:# Check that it exists with ls -la /etc/ssl/certs/ca-certificates.crt # Remove it and restore it sudo rm /etc/ssl/certs/ca-certificates.crt sudo ln -s /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
-
Uninstall
home-managervianix --extra-experimental-features "nix-command flakes" run home-manager/master -- uninstall. -
(Non-NixOS) Uninstall Nix altogether, following the uninstallation instructions in the Nix Reference Manual.
The cool thing of Nix is that, any time you want to come back, you can get the exact same configs you last used (same program versions, everything) by repeating the installation commands above this section. Cool!
Mainly the nix-starter-configs templates, but the repo might have diverged from it as of now. It's always interesting to check other people's configs though, after all you're checking mine :)