use makefile instead of script in flake.nix

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-22 10:51:34 +03:00
parent 39de71b40e
commit 32b5ab3135
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 8 additions and 56 deletions

View file

@ -1,40 +1,6 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "root": {}
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1669045945,
"narHash": "sha256-BQxzijvZpLQ7R+KuQzCPcFgIS6OK0Onb29pYFe2pzJo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6b5019a48f876f3288efc626fa8b70ad0c64eb46",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
}, },
"root": "root", "root": "root",
"version": 7 "version": 7

View file

@ -1,24 +1,5 @@
{ {
inputs = { inputs = { };
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: outputs = { ... }: { lib = import ./lib.nix; };
{
lib = import ./lib.nix;
}
// flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
runTests = pkgs.writeShellScript "runTests" ''
nix eval --impure --expr 'import ./lib.test.nix {}'
'';
in
{
apps.tests = {
type = "app";
program = toString runTests;
};
});
} }

5
makefile Normal file
View file

@ -0,0 +1,5 @@
# Run all tests
test:
nix eval --impure --expr 'import ./lib.test.nix {}'