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

update noflake to use with-inputs

+33 -55
+3 -1
templates/noflake/README.md
··· 2 2 3 3 This template provides an example Den setup with stable Nix (no-flakes), no flake-parts and nix-maid instead of home-manager. 4 4 5 - It configures a NixOS host with one user. 5 + It uses [npins](https://github.com/andir/npins) to lock dependencies and [with-inputs](https://github.com/vic/with-inputs) to provide flakes-like inputs resolution. 6 + 7 + It configures a single NixOS host with one user. 6 8 7 9 Try it with: 8 10
+3 -1
templates/noflake/default.nix
··· 1 1 let 2 + sources = import ./npins; 3 + with-inputs = import sources.with-inputs sources { }; 2 4 3 5 outputs = 4 6 inputs: ··· 11 13 }).config; 12 14 13 15 in 14 - import ./with-inputs.nix outputs 16 + with-inputs outputs
+27 -11
templates/noflake/npins/sources.json
··· 9 9 }, 10 10 "branch": "main", 11 11 "submodules": false, 12 - "revision": "0c108ece5371a78e576b28d7b36369ed15e6d059", 13 - "url": "https://github.com/vic/den/archive/0c108ece5371a78e576b28d7b36369ed15e6d059.tar.gz", 14 - "hash": "sha256-6MjNHGtaIUBlc45g7ZJm9/xRWdBgGkpn8MQPU0Ozsn4=" 12 + "revision": "1589b0a3cc727e8f208945f9acb7d8e92f097d7b", 13 + "url": "https://github.com/vic/den/archive/1589b0a3cc727e8f208945f9acb7d8e92f097d7b.tar.gz", 14 + "hash": "sha256-Gk5ZJVGffwflZsflgjXF4TzwKbji+a+4+y2+H2zylqo=" 15 15 }, 16 16 "flake-aspects": { 17 17 "type": "Git", ··· 22 22 }, 23 23 "branch": "main", 24 24 "submodules": false, 25 - "revision": "8297f3bc41ad79b9f01d56d0dd92f7aac51bacfb", 26 - "url": "https://github.com/vic/flake-aspects/archive/8297f3bc41ad79b9f01d56d0dd92f7aac51bacfb.tar.gz", 27 - "hash": "sha256-bcCOG2CW23/Eww/zULJf1xd0Shz2zS4c2AJWwLALyJ8=" 25 + "revision": "88bac0fd89f3d9ce8f157debc57875ca470535e8", 26 + "url": "https://github.com/vic/flake-aspects/archive/88bac0fd89f3d9ce8f157debc57875ca470535e8.tar.gz", 27 + "hash": "sha256-enmt9g1FJGIBVzPcLa208nLP9QTUbRrJUXWT40GTQho=" 28 28 }, 29 29 "import-tree": { 30 30 "type": "Git", ··· 35 35 }, 36 36 "branch": "main", 37 37 "submodules": false, 38 - "revision": "3c23749d8013ec6daa1d7255057590e9ca726646", 39 - "url": "https://github.com/vic/import-tree/archive/3c23749d8013ec6daa1d7255057590e9ca726646.tar.gz", 40 - "hash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=" 38 + "revision": "205675fa599ff8a74b6c8c2cc5149cdaeac76f5f", 39 + "url": "https://github.com/vic/import-tree/archive/205675fa599ff8a74b6c8c2cc5149cdaeac76f5f.tar.gz", 40 + "hash": "sha256-4TRO+jUycfR3g4KAbyK0wQEEJ7Xcmid2Ry+tWv4HPLw=" 41 41 }, 42 42 "nix-maid": { 43 43 "type": "Git", ··· 55 55 "nixpkgs": { 56 56 "type": "Channel", 57 57 "name": "nixpkgs-unstable", 58 - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre937085.6308c3b21396/nixexprs.tar.xz", 59 - "hash": "sha256-RuGWBqXVEsZwwBvRGS/nRrA6PQyOQwVaAu139Z853Bk=" 58 + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre955350.c0f3d81a7ddb/nixexprs.tar.xz", 59 + "hash": "sha256-BHKMR414WpfUddNyUtx2GR1VPl0R9sWGQs/opgYm9rc=" 60 + }, 61 + "with-inputs": { 62 + "type": "GitRelease", 63 + "repository": { 64 + "type": "GitHub", 65 + "owner": "vic", 66 + "repo": "with-inputs" 67 + }, 68 + "pre_releases": false, 69 + "version_upper_bound": null, 70 + "release_prefix": null, 71 + "submodules": false, 72 + "version": "v0.1.0", 73 + "revision": "8eeec49f4d349ddee87aa6a60ba7f8b25781f747", 74 + "url": "https://api.github.com/repos/vic/with-inputs/tarball/refs/tags/v0.1.0", 75 + "hash": "sha256-5TOTPl8CYewaDoV5O7zvezQeA/NrXx3tzjstOMc2oN8=" 60 76 } 61 77 }, 62 78 "version": 7
-42
templates/noflake/with-inputs.nix
··· 1 - # adapted from https://github.com/vic/dendritic-unflake 2 - let 3 - sources = (import ./npins) // { 4 - # uncomment for using local den checkout 5 - # den.outPath = ./../..; 6 - }; 7 - selfInputs = builtins.mapAttrs (name: value: mkInputs name value) sources; 8 - mkInputs = 9 - name: sourceInfo: 10 - let 11 - flakePath = sourceInfo.outPath + "/flake.nix"; 12 - isFlake = sources.${name}.flake or true; 13 - in 14 - if isFlake && builtins.pathExists flakePath then 15 - let 16 - flake = import (sourceInfo.outPath + "/flake.nix"); 17 - inputs = builtins.mapAttrs (name: _value: selfInputs.${name}) (flake.inputs or { }); 18 - outputs = flake.outputs (inputs // { inherit self; }); 19 - self = 20 - sourceInfo 21 - // outputs 22 - // { 23 - _type = "flake"; 24 - inherit inputs sourceInfo; 25 - }; 26 - in 27 - self 28 - else 29 - sourceInfo 30 - // { 31 - inherit sourceInfo; 32 - }; 33 - in 34 - selfInputs 35 - // { 36 - __functor = 37 - selfInputs: outputs: 38 - let 39 - self = outputs (selfInputs // { inherit self; }); 40 - in 41 - self; 42 - }