- Notifications
You must be signed in to change notification settings - Fork100
And I say hey, what's going on?
License
hlissner/dotfiles
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Hey, you. You're finally awake. You were trying to configure your OSdeclaratively, right? Walked right into that NixOS ambush, same as us, and thosedotfiles over there.
Important
Disclaimer:This is not a "community framework" or "NixOS distribution".Please do not use it like one. It is an ongoing and haphazard experiment tofeel out NixOS for my own purposes, and is home to all manner of unspeakable,overly-opinionated hackery that make the other 9 circles of hell look liketropical beach resorts.
Until I can bend spoons with my Nix-fu, please divert your general Nix(OS)questionsto the NixOS discourse instead of my issuetracker. That said, I'm more than happyto hear input and discussideas, but be warned: I struggle to stay on top of Githubnotifications most of the time.
(screenshots coming soon)
Wayland | X11 | |
---|---|---|
Shell: | zsh + zgenom | " |
WM: | hyprland + waybar | lightdm + lightdm-mini-greeter + bspwm + polybar |
Editor: | Doom Emacs | " |
Terminal: | foot | st |
Launcher: | rofi | " |
Browser: | firefox | " |
Acquire or build a NixOS 24.05+ image:
# Yoink nixos-unstable from upstream$ wget -O nixos.iso https://channels.nixos.org/nixos-unstable/latest-nixos-minimal-x86_64-linux.iso
Write it to a USB drive:
# Replace /dev/sdX with the correct partition!$ cp nixos.iso /dev/sdX
Restart and boot into the installer.
Do your partitions and mount your root to
/mnt
(forexample).Clone these dotfiles somewhere:
$ git clone --recursive https://github.com/hlissner/dotfiles
Create a host config in
hosts/
(seeexisting ones for examples).Run the installer:
# The options are optional, but these are their default values, if you omit them.$ dotfiles/install.zsh\ --root /mnt \ --flake /mnt/etc/dotfiles \ --user"$USER" \ --host"$HOST" \ --dest /mnt/home/$USER/.config/dotfiles
Then reboot and you're good to go!
Warning
Don't forget to change yourroot
and$USER
passwords! They are set tonixos
by default.
And I say,bin/hey
,what's going on?.
SYNOPSIS: hey [-?|-??|-???|-!] [-h|--help] COMMAND [ARGS...]OPTIONS: -! -- Do a dry run. WARNING: It's up to called scripts to obey! -?,-??,-??? -- Enable debug (verbose) mode. -h,--help -- Display the documentation embedded in a target script's header.COMMANDS: - build|b -- Build nix images or recompile bin/hey - exec -- Dispatch to $DOTFILES_HOME/{,hosts/$HOST,config/$WM}/bin/shim.d $PATH - get|set -- Alias for hey vars {get,set} ... - gc -- Run garbage collection on the user's/system's profile - help|h -- Display documentation for the command - hook -- Trigger scripts associated with an event - host -- Dispatch to $DOTFILES_HOME/hosts/$HOST/bin - info -- Display information about current system (JSON) - path -- Display path to area of my dotfiles - profile -- Manage or analyze a system or user nix profile - pull -- Update flake inputs - reload -- Run reload hooks - repl -- Open a Janet, Nix, or nix-develop REPL - swap -- Swap nix-store symlinks with copies (and back) - sync|s -- Rebuild this flake (using nixos-rebuild) - test -- Run Hey and/or Nix test suites - which -- Print out the script's path (with arguments) w/o executing it - wm -- Dispatch to $DOTFILES_HOME/config/$WM/bin - vars -- Get or set session or persistent state in userspace. - @* -- Dispatch to $DOTFILES_HOME/config/${1#@}/bin - .* -- Tries to be smart. Looks for any executable under host, wm, then $DOTFILES_HOME/bin.
Why NixOS?
Because managing a fleet of servers, a hundred strong, is the tenth circle ofhell without a declarative, generational, and immutable single-source-of-truthconfiguration framework like NixOS.
Sure beats the nightmare of brittle capistrano/chef/puppet/ansible/shellscripts I left behind.
Should I use NixOS?
Short answer: no.
Long answer: no really. Don't.
Long long answer: I'm not kidding. Don't.
Unsigned long long answer: Alright alright. Here's why not:
- Its learning curve is steep.
- Youwill trial and error your way to enlightenment, if you survive thefrustration long enough.
- NixOS is unlike other Linux distros. Your issues will be unique anddifficult to google. A decent grasp of Linux and your chosen services is amust, if only to distinguish Nix(OS) issues from Linux (or upstream) issues-- as well as to debug them or report them to the correct authority (andcoherently).
- If words like "declarative", "generational", and "immutable" don't put yoursexuality in jeopardy, you're considering NixOS for the wrong reasons.
- The overhead of managing a NixOS config will rarely pay for itself with 3systems or fewer (perhaps another distro with nix on top would suit youbetter?).
- Official documentation for Nix(OS) is vast, but shallow. Unofficialresources and example configs are sparse and tend toward too simple or toocomplex (and most are outdated). Case in point: this repo.
- The Nix language is obtuse and its toolchain is not intuitive. Yourexperience will be infinitely worse if functional languages are alien toyou, however, learning Nix is a must to do even a fraction of what makesNixOS worth the trouble.
- If you need somebody else to tell you whether or not you need NixOS, youdon't need NixOS.
If you're not discouraged by this, then you didn't need my advice in the firstplace. Stop procrastinating and try NixOS!
How do you manage secrets?
Withagenix.
Why did you write bin/hey?
I envy Guix's CLI and want similar for NixOS, whose toolchain is spread acrossmany commands, none of which are as intuitive:
nix
,nix-collect-garbage
,nixos-rebuild
,nix-env
,nix-shell
, etc.I don't claim
hey
is the answer, but who doesn't like their own brew?How 2 flakes?
Would it be the NixOS experience if I gave you all the answers in one,convenient place?
No. Suffer my pain:
- A three-part tweag article that everyone's read.
- An overengineered config to scare off beginners.
- A minimalistic config for scared beginners.
- A nixos wiki page that spells out the format of flake.nix.
- Official documentation that nobody reads.
- Some great videos on general nixOS tooling and hackery.
- A couple flake configs that Imayhaveshamelesslyrummagedthrough.
- Some notes about using Nix
- What helped me figure out generators (for npm, yarn, python and haskell)
- Learn from someone else's descent into madness; this journals hisexperience digging into the NixOSecosystem
- What y'all will need when Nix drives you to drink.
And if all else fails, ask for help onthe NixOS Discourse.
About
And I say hey, what's going on?