chore(dev): add nix-unit

This commit is contained in:
Robert Hensing 2026-05-02 15:54:21 +01:00
parent 5250617bff
commit 331d896666
4 changed files with 74 additions and 0 deletions

View file

@ -4,6 +4,7 @@
imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.hercules-ci-effects.flakeModule # herculesCI attr
inputs.nix-unit.modules.flake.default
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
@ -21,6 +22,7 @@
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
config.nix-unit.package
pkgs.nixpkgs-fmt
pkgs.hci
];
@ -40,6 +42,10 @@
let tests = import ./tests/eval-tests.nix { flake-parts = self; };
in tests.runTests pkgs.emptyFile // { internals = tests; };
# nix-unit evaluates the flake, which triggers the dev partition via
# flake-compat, requiring network to fetch dev inputs.
nix-unit.allowNetwork = true;
};
flake = {
# for repl exploration / debug

65
dev/flake.lock generated
View file

@ -76,6 +76,49 @@
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"nix-unit",
"nixpkgs"
]
},
"locked": {
"lastModified": 1737420293,
"narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-unit": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1777114263,
"narHash": "sha256-vZfRXBDC9FTO2Vpz8TroVMqOYqp+hcVk6Nwx6+kRN1Q=",
"owner": "nix-community",
"repo": "nix-unit",
"rev": "02e6597889281382303cbb7973748f04f2940e1a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-unit",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1775710090,
@ -132,9 +175,31 @@
"root": {
"inputs": {
"hercules-ci-effects": "hercules-ci-effects",
"nix-unit": "nix-unit",
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nix-unit",
"nixpkgs"
]
},
"locked": {
"lastModified": 1775636079,
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

View file

@ -10,6 +10,8 @@
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
nix-unit.url = "github:nix-community/nix-unit";
nix-unit.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { ... }: