Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 2.39 KB

Readme.org

File metadata and controls

40 lines (32 loc) · 2.39 KB

Flake it till you make it!

The dots used to be managed by a custom script that I wrote, which was very much prone to breakages, so I took a flaky approach.

This is an experimental branch where I’m testing nix.

I wish to work with a single file mindset and see how far I can take it, that’s why I opted to not use home-manager and use GNU Stow instead for dotfiles symlink.

References

Installation

  • Get the list of packages to replace using brew leaves.
  • Install nix: curl -L https://nixos.org/nix/install | sh.

Set-up the packages

  • Create ./flake.nix
  • (Check *Macos exclusive stuff if you’re running darwin)

    Run nix --extra-experimental-features "nix-command flakes" profile install . --impure in the dotfiles directory.

  • Run stow <dir> to symlink the dotfiles. e.g.: stow nix (To not link and see what the stow command will do, run stow -nv linux)
  • To upgrade the packages, run nix flake update and then nix profile upgrade dotfiles --impure
  • To upgrade specific flake inputs nix flake update emacs-overlay
  • Remember to run nix-collect-garbage -d to clean up old generations and to save space.

Macos exclusive stuff

  • Most of the apps are installed using nix-homebrew and system configuration happens via nix-darwin
  • I have created two aliases for working with darwin, they are nix-update-mac and darwin-rebuild-mac respectively. These have to set the HOSTNAME envVar which is used in the flake file for darwinConfigurations.
alias nix-update-mac='HOSTNAME=$(hostname -s) nix build .#darwinConfigurations.$(hostname -s).system --impure'
alias darwin-rebuild-mac='HOSTNAME=$(hostname -s) ./result/sw/bin/darwin-rebuild switch --flake . --impure'