top-level configurations for all my NixOS machines
Go to file
Colin 2ff4df069e nix update: nixpkgs: 2023-04-13 -> 2023-04-16 (nixos-unstable)
```
• Updated input 'nixpkgs-unpatched':
    'github:nixos/nixpkgs/915c0fab841cc88045e00778b8e7fbdbdbd7d1aa' (2023-04-13)
  → 'github:nixos/nixpkgs/f294325aed382b66c7a188482101b0f336d1d7db' (2023-04-16)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/00d5fd73756d424de5263b92235563bc06f2c6e1' (2023-04-11)
  → 'github:Mic92/sops-nix/de6514f8fe1b3c2b57307569a0898bc4be9ae1c5' (2023-04-17)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/e45cc0138829ad86e7ff17a76acf2d05e781e30a' (2023-04-09)
  → 'github:NixOS/nixpkgs/1040ce5f652b586da95dfd80d48a745e107b9eac' (2023-04-16)
```
2023-04-18 21:40:17 +00:00
hosts Merge branch 'master' of git.uninsane.org:colin/nix-files 2023-04-18 06:10:47 +00:00
modules Merge branch 'master' of git.uninsane.org:colin/nix-files 2023-04-18 06:10:47 +00:00
nixpatches nix update: nixpkgs: 2023-04-13 -> 2023-04-16 (nixos-unstable) 2023-04-18 21:40:17 +00:00
overlays moby: ship jellyfin (and it runs!) 2023-04-07 22:55:02 +00:00
pkgs sane-deadlines: fix threshold/date parsing 2023-04-13 10:02:53 +00:00
scripts bluetooth: accept that LinkKeys are device/host-specific and stop trying to share them across machines 2023-01-07 11:31:35 +00:00
secrets sane-scripts: add sane-bt-show to get info about previously added torrents 2023-03-22 22:43:30 +00:00
templates/python-data python-data template: add requests module 2022-12-26 09:29:23 +00:00
.gitignore move secrets to a subdirectory, for improved overrides 2022-05-26 23:52:08 -07:00
.sops.yaml moby: enable a statically-assigned but encrypted password 2022-10-24 07:39:50 -07:00
flake.lock nix update: nixpkgs: 2023-04-13 -> 2023-04-16 (nixos-unstable) 2023-04-18 21:40:17 +00:00
flake.nix nix update: nixpkgs: 2023-04-13 -> 2023-04-16 (nixos-unstable) 2023-04-18 21:40:17 +00:00
readme.md readme: fix typo in moby-cross -> cross-moby 2023-03-02 07:50:11 +00:00

readme.md

to deploy:

nixos-rebuild --flake ".#servo" {build,switch}

if the target is the same as the host, nix will grab the hostname automatically:

nixos-rebuild --flake . {build,switch}

more options (like building packages defined in this repo):

nix flake show

secrets

i use sops for secrets. see hosts/common/secrets.nix for some tips.

building images

to build a distributable image (GPT-formatted image with rootfs and /boot partition):

nix build ./#imgs.lappy

this can then be dd'd onto a disk and directly booted from a EFI system. there's some post-processing to do before running a rebuild on the deployed system (deploying ssh keys, optionally changing fs UUIDs, etc). refer to flake.nix for more details.

remote deployment

some of my systems support cross compilation (i.e. building from x86-64 for an aarch64 host without using emulation).

  • nixos-rebuild --flake '.#cross-moby' build
  • sudo nix sign-paths -r -k /run/secrets/nix_serve_privkey $(readlink ./result)
  • nixos-rebuild --flake '.#cross-moby' switch --target-host colin@moby --use-remote-sudo

building packages

build anything with

nix build .#<pkgname>

specifically, i pass the full package closure to the legacyPackages flake output. that includes both my own packages and upstream packages.

on the other hand the packages output contains only my own packages.

in addition, my packages are placed into both the global scope and a sane scope. so use the scoped path when you want to be explicit.

nix build sane.linux-megous

to build a package precisely how a specific host would see it (in case the host's config customizes it):

nix build '.#host-pkgs.moby-cross.xdg-utils'

using this repo in your own config

this should be a pretty "standard" flake. just reference it, and import either

  • nixosModules.sane (for the modules)
  • overlays.pkgs (for the packages)

nixosModules.sane corresponds to everything in the modules/ directory. it's a mix of broad and narrow scope options. e.g. sane.fs is a completely standalone thing, whereas sane.web-browser is highly personalized and doesn't really make sense to export. regardless of scope, i do try to ensure that everything in modules/ is hidden behind some enable flag so that the disorganization isn't that critical.

contact

if you want to contact me for questions, or collaborate to split something useful into a shared repo, etc, you can reach me via any method listed here.