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 41 lines 1.3 kB view raw
1{ 2 config, 3 # deadnix: skip # enable <den/brackets> syntax for demo. 4 __findFile ? __findFile, 5 den, 6 ... 7}: 8{ 9 # Lets also configure some defaults using aspects. 10 # These are global static settings. 11 den.default = { 12 darwin.system.stateVersion = 6; 13 nixos.system.stateVersion = "25.05"; 14 homeManager.home.stateVersion = "25.05"; 15 }; 16 17 # These are functions that produce configs 18 den.default.includes = [ 19 # ${user}.provides.${host} and ${host}.provides.${user} 20 <den/mutual-provider> 21 22 # Automatically set hostname 23 <den/hostname> 24 25 # Automatically create the user on host. 26 <den/define-user> 27 28 # Disable booting when running on CI on all NixOS hosts. 29 (if config ? _module.args.CI then <eg/ci-no-boot> else { }) 30 31 # NOTE: be cautious when adding fully parametric functions to defaults. 32 # defaults are included on EVERY host/user/home, and IF you are not careful 33 # you could be duplicating config values. For example: 34 # 35 # # This will append 42 into foo option for the {host} and for EVERY {host,user} 36 # ({ host, ... }: { nixos.foo = [ 42 ]; }) # DO-NOT-DO-THIS. 37 # 38 # # Instead try to be explicit if a function is intended for ONLY { host } 39 # den.lib.take.exactly ({ host }: { nixos.foo = [ 42 ]; }) 40 ]; 41}