Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ den.oeiuwq.com
configurations den dendritic nix aspect oriented
at main 38 lines 1.0 kB view raw
1{ den, lib, ... }: 2{ 3 4 den.hosts.x86_64-linux.server.microvm.guests = [ 5 den.hosts.x86_64-linux.guest-microvm 6 ]; 7 8 den.hosts.x86_64-linux.guest-microvm = { 9 intoAttr = [ ]; # dont produce Guest nixosConfiguration at flake output 10 }; 11 12 den.aspects.no-boot.nixos = { 13 boot.loader.grub.enable = false; 14 fileSystems."/".device = "/dev/null"; 15 }; 16 17 den.aspects.server = { 18 # USER TODO: remove this on real bootable server 19 includes = [ den.aspects.no-boot ]; 20 21 # NOTE: no microvm class exist for Host, only for Guests 22 nixos.microvm.host.startupTimeout = 300; 23 }; 24 25 den.aspects.guest-microvm = { 26 # resolved with: `(den.ctx.host = { host = guest-microvm }).resolve { class = "nixos" }` 27 # resulting nixos-module is set at server: microvm.vms.<name>.config 28 nixos = 29 { pkgs, ... }: 30 { 31 environment.systemPackages = [ pkgs.cowsay ]; 32 }; 33 34 # microvm class is for Guests!, forwarded into server: nixos.microvm.vms.<name> 35 microvm.autostart = true; 36 }; 37 38}