diff options
| author | seth <[email protected]> | 2024-08-26 23:51:17 -0400 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-03-05 04:36:03 -0500 |
| commit | b229a37e59b9720b7017e72a6d159b869ff36458 (patch) | |
| tree | 829090d2236ac707d5670c496781a4a888a0b700 /release.nix | |
[skip ci] initial commit
Diffstat (limited to 'release.nix')
| -rw-r--r-- | release.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/release.nix b/release.nix new file mode 100644 index 0000000..7b0524b --- /dev/null +++ b/release.nix @@ -0,0 +1,48 @@ +# nix-build release.nix -A <system> +# i.e., nix-build release.nix -A x86_64-linux +{ + lib ? import <nixpkgs/lib>, +}: + +let + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.gitTracked ./.; + }; + + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; +in + +lib.genAttrs systems ( + system: + + let + pkgs = import <nixpkgs> { + inherit system; + config = { }; + overlays = [ ]; + }; + + mkCheck = + name: deps: script: + pkgs.runCommand name { nativeBuildInputs = deps; } '' + ${script} + touch $out + ''; + + packages = lib.mapAttrs (lib.const lib.recurseIntoAttrs) (import ./default.nix { inherit pkgs; }); + + checks = { + deadnix = mkCheck "check-deadnix" [ pkgs.deadnix ] "deadnix --fail ${src}"; + nixfmt = mkCheck "check-nixfmt" [ pkgs.nixfmt-rfc-style ] "nixfmt --check ${src}"; + statix = mkCheck "check-statix" [ pkgs.statix ] "statix check ${src}"; + }; + in + + checks // packages // { shell = import ./shell.nix { inherit pkgs; }; } +) |
