Note if you are using anything here as a reference be aware I’m refactoring/rebuilding all of this gihugic hack using flake-parts etc…
Consider the primary branch as legacy and old and busted. Not all the new hotness is ready yet though while I rebuild this setup from the ground up to be a lot less sus based on my past few years of learning nix and flakes and finding out how I did things was.... less than optimal or plain up just “wrong”. Live and learn.
You’ve been warned!
So my goal with all this is to get as much into a NixOS layout for home. Now that Flakes are “kinda/sorta” out it seems the best time to convert everything over to flakes.
Because nix isn’t exactly a “common” thing to encounter as a programming language/package manager…
- https://nixos.org/guides/nix-pills/
- https://nix.dev/
- https://github.com/tazjin/nix-1p
- https://learnxinyminutes.com/docs/nix/
- https://teu5us.github.io/nix-lib.html
- https://ryantm.github.io/nixpkgs/functions/library/strings/
- https://wiki.nikitavoloboev.xyz/operating-systems/linux/nixos
- https://stephank.nl/p/2020-06-01-a-nix-primer-by-a-newcomer.html
- https://ertt.ca/nix/patch-nixpkgs/
- https://nixos.org/manual/nix/stable/introduction (reference guide to the language)
NixOS option search, for when you want to know what you can set. https://search.nixos.org/options https://nixos.org/manual/nix/stable/language/builtins.html?search=mkIf
Home-manager equivalent.
https://mipmip.github.io/home-manager-option-search/?query=
A nice cli that searches both is https://github.com/mlvzk/manix
So what in here is worth looking at exactly? Well this is a combined NixOS and x86 Macos setup with home manager. That is, while its incomplete I manage both my macos laptop and any/all NixOS nodes from this shared flake repo.
There is also iso generation and autoinstall setup as well, for that reference this autoinstall module. As well as the generators in flake.nix (search for iso).
My current setup is basically build an iso that will autoinstall nixos onto a system then poweroff/reboot and from there I can pivot that install into this install via deploy-rs.
On the deploy-rs note, the flake file also has those.
So the flake has deploy targets setup already for deploy-rs, to update/rebuild all NixOS nodes run:
clear; nix flake check --show-trace && nix run github:serokell/deploy-rs -- -s .
Or use the wrapper function+script in lib.sh and rebuild script:
wtf rebuild
To run a deploy without running nix flake check:
CHECK=anyvalue wtf rebuild
And should be good to go. Caveats on how/where deploy-rs can deploy to aside. Aka that without builder setup cannot deploy to a macos system from linux. This is on my TODO list to fix at some point.
Since I’m trying to document things a bit more a bit of layout convention explanation:
- bin Simply a directory for any pertinent scripts that use this repo. Note none of these scripts end up in /nix/store.
- src Source for stuff in bin.
- hosts Host specific data, e.g. mostly generated nix configuration files.
- img Nixos specific directory where iso or disk image outputs get dumped.
- modules General directory for any modules for nixos, nix-darwin, and home-manager. Should be intended to encompass “stuff with options”. Also includes the img autoinstall module used for iso builds.
- patches Any patch files that may be needed for things like CVE’s that might not yet be upstream yet in nixpkgs or anywhere else.
- secrets Any secret related data for age and/or git-transcrypt. Basically “private junk hiding in plain sight”.
- static Bucket for any static files, which generally amounts to either fragments or full bits of files like say .profile that the rest of the flake will use.
Nice lists of open source stuff to poke at someday. https://github.com/serhii-londar/open-source-mac-os-apps https://github.com/jaywcjlove/awesome-mac
Try out more patches from here? https://tdodge.consulting/blog/living-the-emacs-garbage-collection-dream
Some interesting org packages here. https://github.com/chrisbarrett/nursery
Some interesting macos integration ideas. https://xenodium.com/emacs-macos-sharing-dwim-style-improved/ https://github.com/xenodium/dwim-shell-command/commit/20e782b4bf1ea01fecfce3cc8ac4c5a74518cd80
Need to try out xwidget support and nov-xwidget on macos https://macowners.club/posts/using-xwidgets-on-macos/ and https://github.com/chenyanming/nov-xwidget
Also need to start abusing anki+org notes for cards https://yiufung.net/post/anki-org/
And explore this for org notes to auto get graphviz images into docs. https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-dot.html
Set this up? https://en.liujiacai.net/2022/11/26/oh-my-github-1-0/
Add or try em?
https://input.djr.com/info/ https://www.fontget.com/font/among-us https://www.fontget.com/font/among-us-filled/ https://www.monolisa.dev/ https://github.com/intel/intel-one-mono https://www.fontbolt.com/font/barbie-2023-font/
Need to get vps using nix as well now that 22.11 has image build support.
https://github.com/Vanilla-s-Lab/linode-nix/tree/master
Refs:
Need to get pipewire tested again, probably via this to do things simple first to see if newer pipewire is less fiddly:
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
socketActivation = true;
};
programs.dconf.enable = true;
services.gnome.at-spi2-core.enable = true;
Might be fun to look into for a pi4 k8s cluster or something.
https://github.com/DeterminateSystems/nix-netboot-serve
Cause I forget and this is a readme so why not stick it here:
List out nixos generations as root:
nix-env --list-generations --profile /nix/var/nix/profiles/system
Switch/rollback to prior generation, also as root:
nixos-rebuild switch --rollback
Cause sometimes nixos-rebuild switch –rollback isn’t enough or you have multiple generations that are no good.
nix-env --switch-generation $GENERATION --profile /nix/var/nix/profiles/system
/nix/var/nix/profiles/system/bin/switch-to-configuration switch