Skip to content

rtluckie/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hey, you. You're finally awake. You were trying to configure your OS declaratively, right? Walked right into that nix ambush, same as us, and those dotfiles over there.

Disclaimer: This is not a community framework or distribution. It's a private configuration and an ongoing experiment to feel out nix. I make no guarantees that it will work out of the box for anyone but myself. It may also change drastically and without warning.

Until I can bend spoons with my nix-fu, please don't treat me like an authority or expert in the nix space. Seek help on the NixOS discourse instead.


WARNING: Use at your own risk

I cannot stress this enough... **Use at your own risk **

  • Adopting this approach to manage your system will require some effort.

  • nix is a interesting language but it can be frustrating at times and difficult to debug.

  • I am still very much a nix novice but I know just enough to be dangerous ;)

  • Try it out on a VM or a spare machine if you have one around.

  • For best experience use on a fresh, clean macOS install.

  • Currently only macOS is support I plan to support linux and nixos eventually.


Background

I've used several different tools (stow, dotbot, custom shell script, rcm, yadm, chezmoi) to manage my system configuration and dotfiles over the years. Each of them has their strengths and weaknesses but none accomplished what I was looking for.

Requirements for "ideal" dotfiles/system management tool

  • Declarative definition of system
  • Deterministic/idempotent output
  • Reusable components
  • Support for templating
  • Support for macOS and *nix
  • Ability to completely provision a new machine (or fresh os install) in >90m
  • Support installation and configuration of apps
  • Dependency management
  • Easy for others to fork, use and contribute back.
  • Based on OSS
  • Support for encryption of sensitive values (keys, etc)

Granted, the approach implemented in this repo is a bit overkill but

Before You Start

Read through the learning links

Initial Setup

  1. Fork this repo and clone

  2. Update relevant values in nix/modules/options.nix

  3. Update relevant values in hack/bootstrap.sh

  4. Run hack/set_sudo_nopassword.sh

    bash -c "$(curl -fsSL https://raw.githubusercontent.com/rtluckie/dotfiles/main/hack/set_sudo_nopassword.sh)"

  5. cp nix/hosts/example to a different location and update hostname in default.nix

    cp -pr nix/hosts/example nix/hosts/newhost; sed -i 's|example|newhost|g' nix/hosts/newhost

  6. Add reference to new host and update system arch if necesary (look for system = "aarch64-darwin") in flake.nix

    sed -i 's|example|newhost|g' nix/hosts/newhost flake.nix

  7. update enabled modules in your new host config file in nix/hosts

  8. Add and commit your changes and push to remote.

  9. review operation in dotfiles/main/hack/bootstrap.sh

  10. execute dotfiles/main/hack/bootstrap.sh

    • WARNING: the first run take a long time depending on your connection speed and machine. Let it finish...

Daily Workflow

  1. Make config changes, add modules, etc.
  2. commit & push
  3. Apply changes (replace YOUR_HOST_NAME with hostname from above.)

make nix/all-nocommit/YOUR_HOST_NAME

Roadmap

  • install emacs in a cleaner fashion
  • doomemacs
  • encrypted secrets

Links

Learning

Reference

Inspiration

Dotfiles

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published