-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathflake.nix
More file actions
42 lines (41 loc) · 1.22 KB
/
Copy pathflake.nix
File metadata and controls
42 lines (41 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane.url = "github:ipetkov/crane";
};
outputs = {
self,
nixpkgs,
crane,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
craneLib = crane.mkLib pkgs;
# Crane filters source files, so that mods to eg README.md don't
# trigger a rebuild. srcFilter adds css, js, sql, and woff2 files to
# the filtered source files.
srcFilter = path: _type: builtins.match ".*css$|.*js$|.*sql$|.*woff2$|.*png$" path != null;
allSrcFilter = path: type:
(srcFilter path type) || (craneLib.filterCargoSources path type);
in {
packages.default = craneLib.buildPackage {
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = allSrcFilter;
# Be reproducible, regardless of the directory name :
name = "source";
};
# Do not run cargo tests on build, because cargo takes so
# long anyway :
doCheck = false;
buildInputs = with pkgs; [
sqlite
openssl
];
nativeBuildInputs = with pkgs; [
pkg-config
];
};
});
}