summaryrefslogtreecommitdiff
path: root/release.nix
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-03-11 16:31:03 -0400
committerSeth Flynn <[email protected]>2025-03-11 17:57:46 -0400
commit336dc00a94e39337c64decd6d0f4f6e4a4d43187 (patch)
tree7e5cb2b56913e398afab4de495bed0401a16493f /release.nix
initial commitHEADmain
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/release.nix b/release.nix
new file mode 100644
index 0000000..d967759
--- /dev/null
+++ b/release.nix
@@ -0,0 +1,56 @@
+let
+ sources = import ./npins;
+in
+
+# Dogfood the library
+import ./default.nix { inherit sources; } (
+ { lib, pkgs, ... }:
+
+ let
+ src = lib.fileset.toSource {
+ root = ./.;
+ fileset = lib.fileset.gitTracked ./.;
+ };
+
+ # Check a minimal example
+ basicTest = import ./default.nix { inherit sources; } {
+ outputs = {
+ foo = "bar";
+ };
+ };
+
+ # Make sure extending outputs works
+ extendedTest = basicTest.extendCores (
+ { lib, ... }:
+
+ {
+ outputs.foo = lib.mkForce "baz";
+ }
+ );
+ in
+
+ assert basicTest.foo == "bar";
+ assert extendedTest.foo == "baz";
+
+ {
+ outputs = {
+ deadnix = pkgs.runCommand "check-deadnix" { nativeBuildInputs = [ pkgs.deadnix ]; } ''
+ deadnix --exclude ${src}/npins/default.nix --fail ${src}
+ touch $out
+ '';
+
+ nixfmt = pkgs.runCommand "check-nixfmt" { nativeBuildInputs = [ pkgs.nixfmt-rfc-style ]; } ''
+ nixfmt --check ${src}/**.nix
+ touch $out
+ '';
+
+ statix = pkgs.runCommand "check-statix" { nativeBuildInputs = [ pkgs.statix ]; } ''
+ statix check --ignore 'npins/default.nix' ${src}
+ touch $out
+ '';
+
+ # Make sure our demo works too
+ demo-hello = ((import ./demo/default.nix).extendCores { inherit sources; }).hello;
+ };
+ }
+)