-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (58 loc) · 1.86 KB
/
Copy pathflake.nix
File metadata and controls
60 lines (58 loc) · 1.86 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
description = "Limmat: Local Immediate Automated Testing";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
self,
nixpkgs,
flake-utils,
...
}:
let
# Other systems probably work too, I just don't have them to test. Feel
# free to add them if you test them.
supportedSystems = [ "x86_64-linux" ];
in
flake-utils.lib.eachSystem supportedSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
naersk = pkgs.callPackage inputs.naersk { };
in
rec {
formatter = pkgs.nixfmt-tree;
packages = rec {
limmat = naersk.buildPackage {
src = ./.;
};
# Limmat is hard-coded to depend on some external tools. This is fine
# in the real world but in testing scenarios it can be handy to have a
# Nix package that just works even in a very pure Nix environment. So
# this adds those dependencies explicitly. PATH is suffixed so the
# user's version of the tools take precedence.
limmat-wrapped = pkgs.stdenv.mkDerivation {
pname = "limmat-wrapped";
version = limmat.version;
src = ./.;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
makeWrapper ${limmat}/bin/limmat $out/bin/limmat \
--suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.git pkgs.bash ]}
'';
};
default = limmat;
};
devShells.default = pkgs.mkShell {
inputsFrom = [ packages.limmat] ;
packages = (with pkgs; [ clippy rustfmt ]);
};
}
);
}