I prefer maximizing control over my system whenever possible. The top priorities for my Linux Desktop include Accessibility, Ease of Use, Reproducibility, and Stability.
And speaking of control, Iβve realized I should start documenting my processes. I mean, who knows, my wisdom might just go six feet under with me, and Iβve got a boatload of know-how tucked away up in this brain of mine. Plus, you know what they say about active externalism β itβs all about making sure your knowledge doesnβt end with you.
Iβve experimented with different tools over time ranging from shell scripts, makefiles, ansible/puppet/chef (check out the git tags) in order to enforce and sync configuration. But as the system evolves, things tend to deteriorate and everything becomes a giant mess.
Nix appears to tackle these issues, albeit in an extreme manner - less convenient and sensible, but quite effective - prioritizing correctness over flexibility. Most importantly it guarentees reproducibility, which means I can sit back and relax; if something worked, itβll keep working unless changed.
Before anything, you can view my configuration at:
Additionally, Iβve described nix extensively in my notes over here.
This is root repository to my linux system configuration, managed by nix flake.
Iβve primarily used home-manager with snowfall-lib for installation & configuration of most packages. For native stuffs (display drivers / virtualization that requires dkms kernel integrations / service management) Iβve used Puppet RAL.
So in most cases this config should be applicable to fit wide variety of distros, including various service managers (systemd/runit/openrc/etc).
Justfile has following recipes set up.
just --list --unsortedAvailable recipes:
build
dry-run
switch
list-generations
treeview arg='.' # Shows treeview of given folder (also used in generation of README)
nvfetcher # Update all dependencies in nvfetcher.toml
bundix # Update all gems in packages/**
Main command you should remember is,
just switch && stow -t $HOME stow/TODO: Document stow folder
Autogenerated by running C-c C-v b in emacs. Be sure to load the shell module if you havenβt.
homes
βββ x86_64-linux
βββ animesh@framework
βββ default.nix
My primary config is at homes/x86_64-linux/animesh@framework/default.nix.
modules
βββ home
βββ apps
βΒ Β βββ brave
βΒ Β βββ default.nix
βββ cli
βΒ Β βββ bat
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ fish
βΒ Β βΒ Β βββ default.nix
βΒ Β βΒ Β βββ functions.nix
βΒ Β βββ git
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ inxi
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ just
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ kitty
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ nix
βΒ Β βΒ Β βββ default.nix
βΒ Β βΒ Β βββ pin-inputs.nix
βΒ Β βΒ Β βββ setup-comma.nix
βΒ Β βββ ranger
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ starship
βΒ Β βββ default.nix
βββ desktop
βΒ Β βββ eww
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ fonts
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ gtk
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ herbstluftwm
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ xorg
βΒ Β βββ default.nix
βββ editors
βΒ Β βββ emacs
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ nvim
βΒ Β βββ default.nix
βββ languages
βΒ Β βββ android
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ go
βΒ Β βΒ Β βββ default.nix
βΒ Β βββ ruby
βΒ Β βββ default.nix
βββ modules
βΒ Β βββ puppet
βΒ Β βββ default.nix
βΒ Β βββ etc.nix
βββ system
βββ acpi-handler
βΒ Β βββ default.nix
βββ auto-cpufreq
βΒ Β βββ default.nix
βββ fstrim
βΒ Β βββ default.nix
βββ sysctl
βββ default.nix
packages
βββ emacs-chdir
βΒ Β βββ default.nix
βββ emacs-pcre
βΒ Β βββ default.nix
βββ phosphor-icons
βΒ Β βββ default.nix
βββ puppet
βββ default.nix
βββ gemset.nix
overlays
βββ nvfetcher
βββ default.nix
To cleanup older generations:
pushd ~/.local/state/nix/profiles && ls | awk "!/$(readlink home-manager)/ && /home-manager-/" | xargs rm && popd
nix-collect-garbage --delete-old
nix store gc --debugSometimes mmap files prevent gc, reboot + same thing may clear even more!
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
For more information, please refer to <http://unlicense.org/>Special thanks to these as my configuration have been extremely inspired by them,
- snowfallorg and https://github.com/YaroKasear/flakes providing ideal structure
- https://sourcegraph.com/github.com/jpetrucciani/nix/-/blob/mods/pog.nix shows pog module
- https://github.com/NobbZ/nixos-config/ great nix uses
- https://github.com/matklad/config & https://github.com/notusknot/dotfiles-nix (not so sure if I took something from them)
