Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/

readme examples

+54 -23
+54 -23
README.md
··· 49 49 50 50 Need more batteries? See [vic/denful](https://github.com/vic/denful). 51 51 52 + For real-world examples, see [`vic/vix`](https://github.com/vic/vix/tree/den) or this [GH search](https://github.com/search?q=vic%2Fden+language%3ANix&type=code). 53 + 54 + **❄️ Try it now!** 55 + 56 + Launch our template VM: 57 + 58 + ```console 59 + nix run github:vic/den 60 + ``` 61 + 62 + Or, initialize a project: 63 + 64 + ```console 65 + nix flake init -t github:vic/den 66 + nix flake update den 67 + nix run .#vm 68 + ``` 69 + 70 + Our [default template](templates/default) provides an annotated quick-start. 71 + 52 72 </div> 53 73 </td> 54 74 <td> ··· 80 100 81 101 ```nix 82 102 # modules/my-laptop.nix 83 - { den, ... }: { 103 + { den, inputs, ... }: { 104 + 105 + # Example: enhance the my-laptop aspect. 106 + # This can be done from any file, multiple times. 84 107 den.aspects.my-laptop = { 108 + 109 + # this aspect includes configurations 110 + # available from other aspects 85 111 includes = [ 112 + # your own parametric aspects 86 113 den.aspects.workplace-vpn 114 + # den's opt-in batteries includes. 87 115 den.provides.home-manager 88 116 ]; 89 - nixos = { /* NixOS options */ }; 90 - darwin = { /* nix-darwin options */ }; 117 + 118 + # any file can contribute to this module, so 119 + # best practice is to keep concerns separated 120 + # each on their own file, instead of huge 121 + # modules in here. 122 + 123 + # any NixOS configuration 124 + nixos = { 125 + # This is a nixos module, see nixos options. 126 + # import third-party NixOS modules 127 + imports = [ 128 + inputs.disko.nixosModules.disko 129 + ]; 130 + disko.devices = { /* ... */ }; 131 + }; 132 + # any nix-darwin configuration 133 + darwin = { 134 + # This is a nix-darwin module. 135 + # import third-party Darwin modules 136 + imports = [ 137 + inputs.nix-homebrew.darwinModules.nix-homebrew 138 + ]; 139 + nix-homebrew.enableRosetta = true; 140 + }; 91 141 # For all users of my-laptop 92 142 homeManager.programs.vim.enable = true; 143 + 93 144 }; 94 145 } 95 146 ··· 108 159 }; 109 160 } 110 161 ``` 111 - 112 - For real-world examples, see [`vic/vix`](https://github.com/vic/vix/tree/den) or this [GH search](https://github.com/search?q=vic%2Fden+language%3ANix&type=code). 113 - 114 - **❄️ Try it now!** 115 - 116 - Launch our template VM: 117 - 118 - ```console 119 - nix run github:vic/den 120 - ``` 121 - 122 - Or, initialize a project: 123 - 124 - ```console 125 - nix flake init -t github:vic/den 126 - nix flake update den 127 - nix run .#vm 128 - ``` 129 - 130 - Our [default template](templates/default) provides an annotated quick-start. 131 162 132 163 </td> 133 164 </tr>