add dev flake pattern

This allows us to have dev dependencies which are not propagated to the user.
This commit is contained in:
Jörg Thalheim
2025-07-07 16:08:44 +02:00
committed by Mic92
parent 783b6a8b06
commit 9c37ef4cbe
7 changed files with 235 additions and 86 deletions

View File

@@ -35,19 +35,13 @@
};
};
# dependencies needed for nuschtos
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.systems.follows = "systems";
nuschtos.url = "github:NuschtOS/search";
nuschtos.inputs.nixpkgs.follows = "nixpkgs";
nuschtos.inputs.flake-utils.follows = "flake-utils";
};
outputs =
inputs@{
flake-parts,
nixpkgs,
systems,
flake-parts,
...
}:
let
@@ -56,10 +50,29 @@
optional
pathExists
;
loadDevFlake =
path:
let
flakeHash = nixpkgs.lib.fileContents "${toString path}.narHash";
flakePath = "path:${toString path}?narHash=${flakeHash}";
in
builtins.getFlake (builtins.unsafeDiscardStringContext flakePath);
devFlake =
if pathExists ./devFlake/private && builtins ? getFlake then
loadDevFlake ./devFlake/private
else
null;
privateInputs = if devFlake != null then devFlake.inputs else { };
in
flake-parts.lib.mkFlake { inherit inputs; } (
{ ... }:
{
_module.args = {
inherit privateInputs;
};
clan = {
meta.name = "clan-core";
inventory = {