blob: 0dbaee0ac0a1d73cfd7992466b06aa258fac2c73 (
plain) (
blame)
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
61
|
{
description = "A CLI to display information about x509 certificates.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
naersk.url = "github:nmattia/naersk";
};
outputs =
{ self
, flake-utils
, nixpkgs
, naersk
, rust-overlay
}:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rust-toolchain =
(pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
extensions = [ "rust-src" ];
};
naersk-lib = naersk.lib."${system}".override {
rustc = rust-toolchain;
};
in
rec
{
packages.x509-info = naersk-lib.buildPackage {
pname = "x509-info";
root = ./.;
buildInputs = with pkgs; [ ];
};
defaultPackage = packages.x509-info;
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rust-toolchain
cargo-audit
cargo-deny
cargo-cross
rust-analyzer
] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ cargo-watch ]);
shellHook = ''
cargo --version
'';
};
})
// {
overlay = final: prev: {
x509-info = self.defaultPackage.${prev.system};
};
};
}
|