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

Provide a module with flake-aspects and den as dependencies. (#109)

flake-file's dendritic module no longer includes den nor flake-aspects. We now provide our own flakeModules.dendritic that does so.

Fixes #59

authored by oeiuwq.com and committed by

GitHub 8164e0d8 7c04e8a8

+97 -238
+1 -16
flake.nix
··· 1 1 { 2 - outputs = _: { 3 - flakeModule = ./nix/flakeModule.nix; 4 - templates = { 5 - default.path = ./templates/default; 6 - default.description = "Batteries included"; 7 - minimal.path = ./templates/minimal; 8 - minimal.description = "Minimalistic den"; 9 - examples.path = ./templates/examples; 10 - examples.description = "API examples and CI"; 11 - bogus.path = ./templates/bogus; 12 - bogus.description = "For bug reproduction"; 13 - }; 14 - packages = import ./nix/template-packages.nix; 15 - namespace = import ./nix/namespace.nix; 16 - lib = import ./nix/lib.nix; 17 - }; 2 + outputs = _: import ./nix; 18 3 }
+22
nix/default.nix
··· 1 + let 2 + flakeModules.default = ./flakeModule.nix; 3 + flakeModules.dendritic = ./dendritic.nix; 4 + in 5 + { 6 + flakeModule = flakeModules.default; 7 + inherit flakeModules; 8 + modules.flake = flakeModules; 9 + templates = { 10 + default.path = ../templates/default; 11 + default.description = "Batteries included"; 12 + minimal.path = ../templates/minimal; 13 + minimal.description = "Minimalistic den"; 14 + examples.path = ../templates/examples; 15 + examples.description = "API examples and CI"; 16 + bogus.path = ../templates/bogus; 17 + bogus.description = "For bug reproduction"; 18 + }; 19 + packages = import ./template-packages.nix; 20 + namespace = import ./namespace.nix; 21 + lib = import ./lib.nix; 22 + }
+11
nix/dendritic.nix
··· 1 + { inputs, lib, ... }: 2 + { 3 + 4 + flake-file.inputs.flake-aspects.url = lib.mkDefault "github:vic/flake-aspects"; 5 + flake-file.inputs.den.url = lib.mkDefault "github:vic/den"; 6 + 7 + imports = [ 8 + (inputs.den.flakeModule or { }) 9 + ]; 10 + 11 + }
+7 -49
templates/bogus/flake.lock
··· 38 38 }, 39 39 "flake-aspects": { 40 40 "locked": { 41 - "lastModified": 1763284357, 42 - "narHash": "sha256-mPMHkhpOIsj2lg+KIcapFd4uj2N/9mZZ6RZBo/p5O1c=", 41 + "lastModified": 1763697753, 42 + "narHash": "sha256-2Qo/CgWi5bCIK85XEJHovw10gunl8NGNIrynaBhDqZI=", 43 43 "owner": "vic", 44 44 "repo": "flake-aspects", 45 - "rev": "6a6d47f531ad57ac854cee689e84f2e28861ec49", 45 + "rev": "c929345a7ee18abbee098a706adba5a6a6ccfc2b", 46 46 "type": "github" 47 47 }, 48 48 "original": { ··· 53 53 }, 54 54 "flake-file": { 55 55 "locked": { 56 - "lastModified": 1762466468, 57 - "narHash": "sha256-OTAbN2Vmdn6Km2AYN+G6QrCdQUtbqaJKAJATP0tGkB8=", 56 + "lastModified": 1763706734, 57 + "narHash": "sha256-kR1Rrh9evfiJaTb6ufWCSk6GMtrnPKFydqQUV0Bb4Eg=", 58 58 "owner": "vic", 59 59 "repo": "flake-file", 60 - "rev": "6a7da81583a42ba339a06aed2d0f3ee4a164f265", 60 + "rev": "9af20d5e62c94b658b4d0671829393c1b8bb0b3e", 61 61 "type": "github" 62 62 }, 63 63 "original": { ··· 121 121 "type": "github" 122 122 } 123 123 }, 124 - "nix-auto-follow": { 125 - "inputs": { 126 - "nixpkgs": [ 127 - "nixpkgs" 128 - ] 129 - }, 130 - "locked": { 131 - "lastModified": 1754073254, 132 - "narHash": "sha256-CQp/v2HQ7AtGJQqFGRZLHt4MZAK3NF94I6GDaRyhbsc=", 133 - "owner": "fzakaria", 134 - "repo": "nix-auto-follow", 135 - "rev": "5baa00b79d4cc46523da0b8b3532c5163d151be4", 136 - "type": "github" 137 - }, 138 - "original": { 139 - "owner": "fzakaria", 140 - "repo": "nix-auto-follow", 141 - "type": "github" 142 - } 143 - }, 144 124 "nix-unit": { 145 125 "inputs": { 146 126 "flake-parts": [ ··· 190 170 "flake-parts": "flake-parts", 191 171 "home-manager": "home-manager", 192 172 "import-tree": "import-tree", 193 - "nix-auto-follow": "nix-auto-follow", 194 173 "nix-unit": "nix-unit", 195 174 "nixpkgs": "nixpkgs", 196 175 "nixpkgs-lib": [ 197 176 "nixpkgs" 198 177 ], 199 - "systems": "systems", 200 - "treefmt-nix": "treefmt-nix_2" 178 + "systems": "systems" 201 179 } 202 180 }, 203 181 "systems": { ··· 216 194 } 217 195 }, 218 196 "treefmt-nix": { 219 - "inputs": { 220 - "nixpkgs": [ 221 - "nixpkgs" 222 - ] 223 - }, 224 - "locked": { 225 - "lastModified": 1762410071, 226 - "narHash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg=", 227 - "owner": "numtide", 228 - "repo": "treefmt-nix", 229 - "rev": "97a30861b13c3731a84e09405414398fbf3e109f", 230 - "type": "github" 231 - }, 232 - "original": { 233 - "owner": "numtide", 234 - "repo": "treefmt-nix", 235 - "type": "github" 236 - } 237 - }, 238 - "treefmt-nix_2": { 239 197 "inputs": { 240 198 "nixpkgs": [ 241 199 "nixpkgs"
+12 -58
templates/bogus/flake.nix
··· 6 6 7 7 inputs = { 8 8 darwin = { 9 - inputs = { 10 - nixpkgs = { 11 - follows = "nixpkgs"; 12 - }; 13 - }; 9 + inputs.nixpkgs.follows = "nixpkgs"; 14 10 url = "github:nix-darwin/nix-darwin"; 15 11 }; 16 - den = { 17 - url = "github:vic/den/main"; 18 - }; 19 - flake-aspects = { 20 - url = "github:vic/flake-aspects"; 21 - }; 22 - flake-file = { 23 - url = "github:vic/flake-file"; 24 - }; 12 + den.url = "github:vic/den/main"; 13 + flake-aspects.url = "github:vic/flake-aspects"; 14 + flake-file.url = "github:vic/flake-file"; 25 15 flake-parts = { 26 - inputs = { 27 - nixpkgs-lib = { 28 - follows = "nixpkgs-lib"; 29 - }; 30 - }; 16 + inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 31 17 url = "github:hercules-ci/flake-parts"; 32 18 }; 33 19 home-manager = { 34 - inputs = { 35 - nixpkgs = { 36 - follows = "nixpkgs"; 37 - }; 38 - }; 20 + inputs.nixpkgs.follows = "nixpkgs"; 39 21 url = "github:nix-community/home-manager"; 40 22 }; 41 - import-tree = { 42 - url = "github:vic/import-tree"; 43 - }; 44 - nix-auto-follow = { 45 - inputs = { 46 - nixpkgs = { 47 - follows = "nixpkgs"; 48 - }; 49 - }; 50 - url = "github:fzakaria/nix-auto-follow"; 51 - }; 23 + import-tree.url = "github:vic/import-tree"; 52 24 nix-unit = { 53 25 inputs = { 54 - flake-parts = { 55 - follows = "flake-parts"; 56 - }; 57 - nixpkgs = { 58 - follows = "nixpkgs"; 59 - }; 26 + flake-parts.follows = "flake-parts"; 27 + nixpkgs.follows = "nixpkgs"; 60 28 }; 61 29 url = "github:nix-community/nix-unit"; 62 30 }; 63 - nixpkgs = { 64 - url = "github:nixos/nixpkgs/nixpkgs-unstable"; 65 - }; 66 - nixpkgs-lib = { 67 - follows = "nixpkgs"; 68 - }; 69 - systems = { 70 - url = "github:nix-systems/default"; 71 - }; 72 - treefmt-nix = { 73 - inputs = { 74 - nixpkgs = { 75 - follows = "nixpkgs"; 76 - }; 77 - }; 78 - url = "github:numtide/treefmt-nix"; 79 - }; 31 + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 32 + nixpkgs-lib.follows = "nixpkgs"; 33 + systems.url = "github:nix-systems/default"; 80 34 }; 81 35 82 36 }
+3 -1
templates/bogus/modules/dendritic.nix
··· 1 1 { inputs, lib, ... }: 2 2 { 3 3 flake-file.inputs.flake-file.url = lib.mkDefault "github:vic/flake-file"; 4 + flake-file.inputs.den.url = lib.mkDefault "github:vic/den"; 4 5 imports = [ 5 - inputs.flake-file.flakeModules.dendritic 6 + (inputs.flake-file.flakeModules.dendritic or { }) 7 + (inputs.den.flakeModules.dendritic or { }) 6 8 ]; 7 9 }
+6 -6
templates/default/flake.lock
··· 37 37 }, 38 38 "flake-aspects": { 39 39 "locked": { 40 - "lastModified": 1763284357, 41 - "narHash": "sha256-mPMHkhpOIsj2lg+KIcapFd4uj2N/9mZZ6RZBo/p5O1c=", 40 + "lastModified": 1763697753, 41 + "narHash": "sha256-2Qo/CgWi5bCIK85XEJHovw10gunl8NGNIrynaBhDqZI=", 42 42 "owner": "vic", 43 43 "repo": "flake-aspects", 44 - "rev": "6a6d47f531ad57ac854cee689e84f2e28861ec49", 44 + "rev": "c929345a7ee18abbee098a706adba5a6a6ccfc2b", 45 45 "type": "github" 46 46 }, 47 47 "original": { ··· 52 52 }, 53 53 "flake-file": { 54 54 "locked": { 55 - "lastModified": 1762732765, 56 - "narHash": "sha256-sVxN4q4V8jhIAF44aPSMULIJMJ5eG5HtzcQgbr2UEBg=", 55 + "lastModified": 1763706734, 56 + "narHash": "sha256-kR1Rrh9evfiJaTb6ufWCSk6GMtrnPKFydqQUV0Bb4Eg=", 57 57 "owner": "vic", 58 58 "repo": "flake-file", 59 - "rev": "7b037ae446102d3ccc5e23d3c52d5ada8e0fc4f3", 59 + "rev": "9af20d5e62c94b658b4d0671829393c1b8bb0b3e", 60 60 "type": "github" 61 61 }, 62 62 "original": {
+10 -36
templates/default/flake.nix
··· 6 6 7 7 inputs = { 8 8 darwin = { 9 - inputs = { 10 - nixpkgs = { 11 - follows = "nixpkgs"; 12 - }; 13 - }; 9 + inputs.nixpkgs.follows = "nixpkgs"; 14 10 url = "github:nix-darwin/nix-darwin"; 15 11 }; 16 - den = { 17 - url = "github:vic/den"; 18 - }; 19 - flake-aspects = { 20 - url = "github:vic/flake-aspects"; 21 - }; 22 - flake-file = { 23 - url = "github:vic/flake-file"; 24 - }; 12 + den.url = "github:vic/den"; 13 + flake-aspects.url = "github:vic/flake-aspects"; 14 + flake-file.url = "github:vic/flake-file"; 25 15 flake-parts = { 26 - inputs = { 27 - nixpkgs-lib = { 28 - follows = "nixpkgs-lib"; 29 - }; 30 - }; 16 + inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 31 17 url = "github:hercules-ci/flake-parts"; 32 18 }; 33 19 home-manager = { 34 - inputs = { 35 - nixpkgs = { 36 - follows = "nixpkgs"; 37 - }; 38 - }; 20 + inputs.nixpkgs.follows = "nixpkgs"; 39 21 url = "github:nix-community/home-manager"; 40 22 }; 41 - import-tree = { 42 - url = "github:vic/import-tree"; 43 - }; 44 - nixpkgs = { 45 - url = "github:nixos/nixpkgs/nixpkgs-unstable"; 46 - }; 47 - nixpkgs-lib = { 48 - follows = "nixpkgs"; 49 - }; 50 - systems = { 51 - url = "github:nix-systems/default"; 52 - }; 23 + import-tree.url = "github:vic/import-tree"; 24 + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 25 + nixpkgs-lib.follows = "nixpkgs"; 26 + systems.url = "github:nix-systems/default"; 53 27 }; 54 28 55 29 }
+5 -2
templates/default/modules/dendritic.nix
··· 1 - { inputs, ... }: 1 + { inputs, lib, ... }: 2 2 { 3 + flake-file.inputs.flake-file.url = lib.mkDefault "github:vic/flake-file"; 4 + flake-file.inputs.den.url = lib.mkDefault "github:vic/den"; 3 5 imports = [ 4 - inputs.flake-file.flakeModules.dendritic 6 + (inputs.flake-file.flakeModules.dendritic or { }) 7 + (inputs.den.flakeModules.dendritic or { }) 5 8 ]; 6 9 }
+3 -3
templates/examples/flake.lock
··· 52 52 }, 53 53 "flake-file": { 54 54 "locked": { 55 - "lastModified": 1761535278, 56 - "narHash": "sha256-OPZ7XpG778i9CIJfchAwgrZGZ9z1dWJzfN18VFxCyS4=", 55 + "lastModified": 1763706734, 56 + "narHash": "sha256-kR1Rrh9evfiJaTb6ufWCSk6GMtrnPKFydqQUV0Bb4Eg=", 57 57 "owner": "vic", 58 58 "repo": "flake-file", 59 - "rev": "57b2a65831ae49e4f9218dbba1c2dc9700f6cd68", 59 + "rev": "9af20d5e62c94b658b4d0671829393c1b8bb0b3e", 60 60 "type": "github" 61 61 }, 62 62 "original": {
+14 -66
templates/examples/flake.nix
··· 6 6 7 7 inputs = { 8 8 darwin = { 9 - inputs = { 10 - nixpkgs = { 11 - follows = "nixpkgs"; 12 - }; 13 - }; 9 + inputs.nixpkgs.follows = "nixpkgs"; 14 10 url = "github:nix-darwin/nix-darwin"; 15 11 }; 16 - den = { 17 - url = "github:vic/den"; 18 - }; 19 - flake-aspects = { 20 - url = "github:vic/flake-aspects"; 21 - }; 22 - flake-file = { 23 - url = "github:vic/flake-file"; 24 - }; 12 + den.url = "github:vic/den"; 13 + flake-aspects.url = "github:vic/flake-aspects"; 14 + flake-file.url = "github:vic/flake-file"; 25 15 flake-parts = { 26 - inputs = { 27 - nixpkgs-lib = { 28 - follows = "nixpkgs-lib"; 29 - }; 30 - }; 16 + inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 31 17 url = "github:hercules-ci/flake-parts"; 32 18 }; 33 19 home-manager = { 34 - inputs = { 35 - nixpkgs = { 36 - follows = "nixpkgs"; 37 - }; 38 - }; 20 + inputs.nixpkgs.follows = "nixpkgs"; 39 21 url = "github:nix-community/home-manager"; 40 22 }; 41 23 home-manager-stable = { 42 - inputs = { 43 - nixpkgs = { 44 - follows = "nixpkgs-stable"; 45 - }; 46 - }; 24 + inputs.nixpkgs.follows = "nixpkgs-stable"; 47 25 url = "github:nix-community/home-manager/release-25.05"; 48 26 }; 49 - import-tree = { 50 - url = "github:vic/import-tree"; 51 - }; 52 - nix-auto-follow = { 53 - inputs = { 54 - nixpkgs = { 55 - follows = "nixpkgs"; 56 - }; 57 - }; 58 - url = "github:fzakaria/nix-auto-follow"; 59 - }; 27 + import-tree.url = "github:vic/import-tree"; 60 28 nixos-wsl = { 61 29 inputs = { 62 - flake-compat = { 63 - follows = ""; 64 - }; 65 - nixpkgs = { 66 - follows = "nixpkgs-stable"; 67 - }; 30 + flake-compat.follows = ""; 31 + nixpkgs.follows = "nixpkgs-stable"; 68 32 }; 69 33 url = "github:nix-community/nixos-wsl"; 70 34 }; 71 - nixpkgs = { 72 - url = "github:nixos/nixpkgs/nixpkgs-unstable"; 73 - }; 74 - nixpkgs-lib = { 75 - follows = "nixpkgs"; 76 - }; 77 - nixpkgs-stable = { 78 - url = "github:nixos/nixpkgs/release-25.05"; 79 - }; 80 - systems = { 81 - url = "github:nix-systems/default"; 82 - }; 83 - treefmt-nix = { 84 - inputs = { 85 - nixpkgs = { 86 - follows = "nixpkgs"; 87 - }; 88 - }; 89 - url = "github:numtide/treefmt-nix"; 90 - }; 35 + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 36 + nixpkgs-lib.follows = "nixpkgs"; 37 + nixpkgs-stable.url = "github:nixos/nixpkgs/release-25.05"; 38 + systems.url = "github:nix-systems/default"; 91 39 }; 92 40 93 41 }
+3 -1
templates/examples/modules/dendritic.nix
··· 1 1 { inputs, lib, ... }: 2 2 { 3 3 flake-file.inputs.flake-file.url = lib.mkDefault "github:vic/flake-file"; 4 + flake-file.inputs.den.url = lib.mkDefault "github:vic/den"; 4 5 imports = [ 5 - inputs.flake-file.flakeModules.dendritic 6 + (inputs.flake-file.flakeModules.dendritic or { }) 7 + (inputs.den.flakeModules.dendritic or { }) 6 8 ]; 7 9 }