Generate flake.nix from module options. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ dendrix.oeiuwq.com/Dendritic.html
dendritic nix inputs

update locks

+75 -89
+9 -10
templates/nixlock/default.nix
··· 1 1 let 2 - with-inputs = import sources.with-inputs; 3 - locals = { 2 + with-inputs = import sources.with-inputs sources { 4 3 # uncomment for local checkout on CI 5 4 # flake-file = import ./../../modules; 6 5 }; 6 + 7 + outputs = 8 + inputs: 9 + (inputs.nixpkgs.lib.evalModules { 10 + modules = [ (inputs.import-tree ./modules) ]; 11 + specialArgs = { inherit inputs; }; 12 + }).config; 7 13 8 14 sources = builtins.mapAttrs ( 9 15 _n: v: ··· 15 21 }; 16 22 } 17 23 ) (import ./nixlock.lock.nix); 18 - 19 - outputs = 20 - inputs: 21 - (inputs.nixpkgs.lib.evalModules { 22 - modules = [ (inputs.import-tree ./modules) ]; 23 - specialArgs = { inherit inputs; }; 24 - }).config; 25 24 in 26 - with-inputs sources locals outputs 25 + with-inputs outputs
+4 -4
templates/nixlock/nixlock.lock.nix
··· 1 1 { 2 2 "flake-file" = { 3 3 "lock" = { 4 - "hash" = "sha256-mVVAJ+QnmA/gbQmbPEi3RFtLJwWCjNslVxv1bhVRB2c="; 5 - "url" = "https://github.com/vic/flake-file/archive/b0477cfb25e745dfd4e10a5a6b81ab4c4ad5c0f8.tar.gz"; 4 + "hash" = "sha256-5FB/FQ+gCvFbEuyMxydkUHuMCe0UEgMra5jI2D6SAQU="; 5 + "url" = "https://github.com/vic/flake-file/archive/cdb4abe76b3ff0b611343514f584faa2688a12af.tar.gz"; 6 6 }; 7 7 "meta" = { 8 8 "ref" = "HEAD"; ··· 34 34 }; 35 35 "with-inputs" = { 36 36 "lock" = { 37 - "hash" = "sha256-5TOTPl8CYewaDoV5O7zvezQeA/NrXx3tzjstOMc2oN8="; 37 + "hash" = "sha256-WFCkvOrArY0rhIPLESqitQHDpl1NFBCK4/7/z6c1040="; 38 38 "url" = 39 - "https://github.com/vic/with-inputs/archive/8eeec49f4d349ddee87aa6a60ba7f8b25781f747.tar.gz"; 39 + "https://github.com/vic/with-inputs/archive/ca62018475be1999e57fbfa7ec14ebea7c6e483d.tar.gz"; 40 40 }; 41 41 "meta" = { 42 42 "ref" = "HEAD";
+2 -4
templates/npins/default.nix
··· 1 1 let 2 2 sources = import ./npins; 3 - with-inputs = import sources.with-inputs; 4 - 5 - locals ={ 3 + with-inputs = import sources.with-inputs sources { 6 4 # uncomment on CI for local checkout 7 5 # flake-file = import ./../../modules; 8 6 }; ··· 17 15 }; 18 16 }).config; 19 17 in 20 - with-inputs sources locals outputs 18 + with-inputs outputs
+3 -3
templates/npins/npins/sources.json
··· 9 9 }, 10 10 "branch": "main", 11 11 "submodules": false, 12 - "revision": "b0477cfb25e745dfd4e10a5a6b81ab4c4ad5c0f8", 13 - "url": "https://github.com/vic/flake-file/archive/b0477cfb25e745dfd4e10a5a6b81ab4c4ad5c0f8.tar.gz", 14 - "hash": "sha256-mVVAJ+QnmA/gbQmbPEi3RFtLJwWCjNslVxv1bhVRB2c=" 12 + "revision": "cdb4abe76b3ff0b611343514f584faa2688a12af", 13 + "url": "https://github.com/vic/flake-file/archive/cdb4abe76b3ff0b611343514f584faa2688a12af.tar.gz", 14 + "hash": "sha256-5FB/FQ+gCvFbEuyMxydkUHuMCe0UEgMra5jI2D6SAQU=" 15 15 }, 16 16 "import-tree": { 17 17 "type": "Git",
+6 -12
templates/unflake/default.nix
··· 1 1 let 2 + sources = import ./unflake.nix; 3 + with-inputs = import sources.with-inputs sources { 4 + # uncomment to use local checkout on CI 5 + # flake-file = import ./../../modules; 6 + }; 2 7 3 8 outputs = 4 9 inputs: ··· 6 11 modules = [ (inputs.import-tree ./modules) ]; 7 12 specialArgs = { inherit inputs; }; 8 13 }).config; 9 - 10 - withInputs = 11 - inputs: outputs: 12 - outputs ( 13 - inputs 14 - // { 15 - # uncomment to use local checkout on CI 16 - # flake-file = import ./../../modules; 17 - } 18 - ); 19 - 20 14 in 21 - (import ./unflake.nix withInputs) outputs 15 + with-inputs outputs
+3 -1
templates/unflake/modules/default.nix
··· 5 5 flake-file.inputs = { 6 6 flake-file.url = "github:vic/flake-file"; 7 7 import-tree.url = "github:vic/import-tree"; 8 - nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; 8 + with-inputs.url = "github:vic/with-inputs"; 9 + with-inputs.flake = false; 10 + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 9 11 }; 10 12 }
+48 -55
templates/unflake/unflake.nix
··· 1 1 # @generated by https://codeberg.org/goldstein/unflake 2 2 let 3 3 deps = rec { 4 + unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable = builtins.fetchTree { 5 + type = "github"; 6 + owner = "nixos"; 7 + repo = "nixpkgs"; 8 + rev = "c0f3d81a7ddbc2b1332be0d8481a672b4f6004d6"; 9 + lastModified = 1772173633; 10 + narHash = "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4="; 11 + }; 4 12 unflake_github_vic_flake-file = builtins.fetchTree { 5 13 type = "github"; 6 14 owner = "vic"; 7 15 repo = "flake-file"; 8 - rev = "9d89918faacdbd2ce26d0aa7298da0fecad8b437"; 9 - lastModified = 1771017549; 10 - narHash = "sha256-n68HeYEQJ67hMH2LPI0cERD2pkpNe5dyeOGg11uZ7rc="; 16 + rev = "cdb4abe76b3ff0b611343514f584faa2688a12af"; 17 + lastModified = 1772337812; 18 + narHash = "sha256-5FB/FQ+gCvFbEuyMxydkUHuMCe0UEgMra5jI2D6SAQU="; 11 19 }; 12 20 unflake_github_vic_import-tree = builtins.fetchTree { 13 21 type = "github"; 14 22 owner = "vic"; 15 23 repo = "import-tree"; 16 - rev = "c968d3b54d12cf5d9c13f16f7c545a06c9d1fde6"; 17 - lastModified = 1771045967; 18 - narHash = "sha256-oYO4poyw0Sb/db2PigqugMlDwsvwLg6CSpFrMUWxA3Q="; 24 + rev = "205675fa599ff8a74b6c8c2cc5149cdaeac76f5f"; 25 + lastModified = 1772263719; 26 + narHash = "sha256-4TRO+jUycfR3g4KAbyK0wQEEJ7Xcmid2Ry+tWv4HPLw="; 19 27 }; 20 - unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz = builtins.fetchTree { 21 - type = "tarball"; 22 - url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; 23 - lastModified = 1771482645; 24 - narHash = "sha256-5xZ8rQTzV4cSAPMvIZpVpF05p5iwUnEuONeelwseA4g="; 28 + unflake_github_vic_with-inputs = builtins.fetchTree { 29 + type = "github"; 30 + owner = "vic"; 31 + repo = "with-inputs"; 32 + rev = "ca62018475be1999e57fbfa7ec14ebea7c6e483d"; 33 + lastModified = 1772342380; 34 + narHash = "sha256-WFCkvOrArY0rhIPLESqitQHDpl1NFBCK4/7/z6c1040="; 25 35 }; 36 + unflake_github_vic_with-inputs_flake_false = unflake_github_vic_with-inputs; 26 37 }; 27 38 universe = rec { 28 - unflake_github_vic_flake-file = 29 - ((import "${deps.unflake_github_vic_flake-file.outPath}/flake.nix").outputs { 30 - self = unflake_github_vic_flake-file; 31 - }) 32 - // deps.unflake_github_vic_flake-file 33 - // { 34 - _flake = true; 35 - outPath = "${deps.unflake_github_vic_flake-file.outPath}"; 36 - sourceInfo = deps.unflake_github_vic_flake-file; 37 - }; 38 - unflake_github_vic_import-tree = 39 - ((import "${deps.unflake_github_vic_import-tree.outPath}/flake.nix").outputs { 40 - self = unflake_github_vic_import-tree; 41 - }) 42 - // deps.unflake_github_vic_import-tree 43 - // { 44 - _flake = true; 45 - outPath = "${deps.unflake_github_vic_import-tree.outPath}"; 46 - sourceInfo = deps.unflake_github_vic_import-tree; 47 - }; 48 - unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz = 49 - ( 50 - (import "${deps.unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz.outPath}/flake.nix") 51 - .outputs 52 - { 53 - self = unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz; 54 - } 55 - ) 56 - // deps.unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz 57 - // { 58 - _flake = true; 59 - outPath = "${deps.unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz.outPath 60 - }"; 61 - sourceInfo = deps.unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz; 62 - }; 39 + unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable = ((import "${deps.unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable.outPath}/flake.nix").outputs { 40 + self = unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable; 41 + }) // deps.unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable // { 42 + _flake = true; 43 + outPath = "${deps.unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable.outPath}"; 44 + sourceInfo = deps.unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable; 45 + }; 46 + unflake_github_vic_flake-file = ((import "${deps.unflake_github_vic_flake-file.outPath}/flake.nix").outputs { 47 + self = unflake_github_vic_flake-file; 48 + }) // deps.unflake_github_vic_flake-file // { 49 + _flake = true; 50 + outPath = "${deps.unflake_github_vic_flake-file.outPath}"; 51 + sourceInfo = deps.unflake_github_vic_flake-file; 52 + }; 53 + unflake_github_vic_import-tree = ((import "${deps.unflake_github_vic_import-tree.outPath}/flake.nix").outputs { 54 + self = unflake_github_vic_import-tree; 55 + }) // deps.unflake_github_vic_import-tree // { 56 + _flake = true; 57 + outPath = "${deps.unflake_github_vic_import-tree.outPath}"; 58 + sourceInfo = deps.unflake_github_vic_import-tree; 59 + }; 60 + unflake_github_vic_with-inputs_flake_false = deps.unflake_github_vic_with-inputs_flake_false; 63 61 }; 64 62 inputs = { 65 63 flake-file = universe.unflake_github_vic_flake-file; 66 64 import-tree = universe.unflake_github_vic_import-tree; 67 - nixpkgs = universe.unflake_tarball_https---channels-nixos-org-nixpkgs-unstable-nixexprs-tar-xz; 65 + nixpkgs = universe.unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable; 66 + with-inputs = universe.unflake_github_vic_with-inputs_flake_false; 68 67 self = throw "to use inputs.self, write `import ./unflake.nix (inputs: ...)`"; 69 - withInputs = 70 - outputs: 71 - let 72 - self = outputs (inputs // { inherit self; }); 73 - in 74 - self; 68 + withInputs = outputs: let self = outputs (inputs // { inherit self; }); in self; 75 69 __functor = self: self.withInputs; 76 70 }; 77 - in 78 - inputs 71 + in inputs