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

Enable swiching default VM between console and gui. (#86)

Edit `modules/vm.nix`

Closes #82

authored by oeiuwq.com and committed by

GitHub 0b4cbcd8 74b6ece6

+40 -17
+3 -3
templates/default/flake.lock
··· 22 22 }, 23 23 "den": { 24 24 "locked": { 25 - "lastModified": 1762857244, 26 - "narHash": "sha256-jv+YPHX9XZg8zri1LfbZo1uNLIxNwXpLgHS6yigfFWI=", 25 + "lastModified": 1763024281, 26 + "narHash": "sha256-H1gXc/wdj9J5WwZcTNk4UTFHKLcBXpmsr8eEp4rvM6o=", 27 27 "owner": "vic", 28 28 "repo": "den", 29 - "rev": "db007d3af41b6a03ccf0148727bc93c713b05096", 29 + "rev": "bab28b55a72d2801d1e91243ea44ae6d24cffd5b", 30 30 "type": "github" 31 31 }, 32 32 "original": {
+2 -1
templates/default/modules/aspects/defaults.nix
··· 37 37 # 38 38 # # Instead try to be explicit if a function is intended for ONLY { host }. 39 39 (den.lib.take.exactly ( 40 - { host }: 40 + # deadnix: skip 41 + { OS, host }: 41 42 { 42 43 nixos.networking.hostName = host.hostName; 43 44 }
+13 -5
templates/default/modules/aspects/eg/vm-bootable.nix
··· 1 + let 2 + installer = variant: { 3 + nixos = 4 + { modulesPath, ... }: 5 + { 6 + imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-${variant}.nix") ]; 7 + }; 8 + }; 9 + in 1 10 { 2 11 # make USB/VM installers. 3 - eg.vm-bootable.nixos = 4 - { modulesPath, ... }: 5 - { 6 - imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-graphical-base.nix") ]; 7 - }; 12 + eg.vm-bootable.provides = { 13 + tui = installer "minimal"; 14 + gui = installer "graphical-base"; 15 + }; 8 16 }
+15
templates/default/modules/aspects/eg/vm.nix
··· 1 + { eg, ... }: 2 + { 3 + eg.vm.provides = { 4 + gui.includes = [ 5 + eg.vm 6 + eg.vm-bootable._.gui 7 + eg.xfce-desktop 8 + ]; 9 + 10 + tui.includes = [ 11 + eg.vm 12 + eg.vm-bootable._.tui 13 + ]; 14 + }; 15 + }
-7
templates/default/modules/aspects/igloo.nix
··· 1 - { eg, ... }: 2 1 { 3 2 den.aspects.igloo = { 4 3 # igloo host provides some home-manager defaults to its users. ··· 10 9 { 11 10 environment.systemPackages = [ pkgs.hello ]; 12 11 }; 13 - 14 - # Include aspects from the eg namespace 15 - includes = [ 16 - eg.vm-bootable 17 - eg.xfce-desktop 18 - ]; 19 12 20 13 # <host>.provides.<user>, via eg/routes.nix 21 14 provides.alice =
+7 -1
templates/default/modules/vm.nix
··· 1 1 # enables `nix run .#vm`. it is very useful to have a VM 2 2 # you can edit your config an launch the VM to test stuff 3 3 # instead of having to reboot each time. 4 - { inputs, ... }: 4 + { inputs, eg, ... }: 5 5 { 6 + 7 + den.aspects.igloo.includes = [ 8 + eg.vm._.gui 9 + # eg.vm._.tui 10 + ]; 11 + 6 12 perSystem = 7 13 { pkgs, ... }: 8 14 {