-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
45 lines (41 loc) · 1.13 KB
/
flake.nix
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
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
};
outputs = { self, nixpkgs, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk' = pkgs.callPackage naersk { };
in
{
packages = rec {
# For `nix build .#ip_rs`
ip_rs = naersk'.buildPackage {
src = ./.;
};
# For `nix build .#ociImage` and then `podman image load ./result`
ociImage = pkgs.dockerTools.buildLayeredImage {
name = "registry.fly.io/iprs";
tag = "latest";
contents = [ pkgs.coreutils ip_rs ];
config = {
Cmd = [ "${ip_rs}/bin/ip-rs" ];
};
};
};
# For `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cargo
clippy
flyctl
rust-analyzer
rustc
rustfmt
];
};
});
}