feat: added nix flake #5

Merged
cafkafk merged 8 commits from dev into main 2023-06-18 20:02:36 +02:00
2 changed files with 2 additions and 31 deletions
Showing only changes of commit cab7f72e28 - Show all commits

View file

@ -134,8 +134,7 @@
"crane": "crane", "crane": "crane",
"fenix": "fenix", "fenix": "fenix",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"test-directory": "test-directory"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -192,18 +191,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"test-directory": {
"flake": false,
"locked": {
"narHash": "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=",
"type": "file",
"url": "file:///home/ces/org/src/git/gg"
},
"original": {
"type": "file",
"url": "file:///home/ces/org/src/git/gg"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -21,14 +21,9 @@
url = "github:rustsec/advisory-db"; url = "github:rustsec/advisory-db";
flake = false; flake = false;
}; };
test-directory = {
url = "file:///home/ces/org/src/git/gg";
flake = false;
};
}; };
outputs = { self, nixpkgs, crane, fenix, flake-utils, advisory-db, test-directory, ... }: outputs = { self, nixpkgs, crane, fenix, flake-utils, advisory-db, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
@ -39,8 +34,6 @@
craneLib = crane.lib.${system}; craneLib = crane.lib.${system};
#src = craneLib.cleanCargoSource (craneLib.path ./.);
# When filtering sources, we want to allow assets other than .rs files # When filtering sources, we want to allow assets other than .rs files
src = lib.cleanSourceWith { src = lib.cleanSourceWith {
src = ./.; # The original, unfiltered source src = ./.; # The original, unfiltered source
@ -54,13 +47,6 @@
; ;
}; };
# src = pkgs.lib.cleanSourceWith {
# src = craneLib.path ./.; # original, unfiltered source
# filter = path: type:
# (builtins.match ".*yaml" path != null) # include JSONC files
# || (craneLib.filterCargoSources path type);
# };
# Common arguments can be set here to avoid repeating them later # Common arguments can be set here to avoid repeating them later
commonArgs = { commonArgs = {
inherit src; inherit src;
@ -93,7 +79,6 @@
# artifacts from above. # artifacts from above.
my-crate = craneLib.buildPackage (commonArgs // { my-crate = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts; inherit cargoArtifacts;
# doCheck = false; # NOTE remove me
}); });
in in
{ {
@ -129,7 +114,6 @@
# Run tests with cargo-nextest # Run tests with cargo-nextest
# Consider setting `doCheck = false` on `my-crate` if you do not want # Consider setting `doCheck = false` on `my-crate` if you do not want
# the tests to run twice # the tests to run twice
# NOTE enable this part
my-crate-nextest = craneLib.cargoNextest (commonArgs // { my-crate-nextest = craneLib.cargoNextest (commonArgs // {
inherit cargoArtifacts; inherit cargoArtifacts;
partitions = 1; partitions = 1;