-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (77 loc) · 2.17 KB
/
flake.nix
File metadata and controls
82 lines (77 loc) · 2.17 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
description = "Age plugin utilizing gpg-agent";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-25.05";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
shelly.url = "github:CertainLach/shelly";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake
{
inherit inputs;
}
{
imports = [ inputs.shelly.flakeModule ];
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem =
{
config,
system,
pkgs,
self,
inputs',
...
}:
let
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rust;
sharedDependencies = with pkgs; [ nettle ];
sharedBuildDependencies = with pkgs; [
pkg-config
rustPlatform.bindgenHook
];
in
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.rust-overlay.overlays.default ];
};
packages =
let
age-plugin-gpg = craneLib.buildPackage {
src = ./.;
buildInputs = sharedDependencies;
nativeBuildInputs = sharedBuildDependencies;
};
in
{
inherit age-plugin-gpg;
default = age-plugin-gpg;
};
shelly.shells.default = {
factory = craneLib.devShell;
packages =
with pkgs;
[
nettle
rust
rage
]
++ sharedDependencies
++ sharedBuildDependencies;
shellHook = ''
export PATH=$PATH:$PWD/target/debug
'';
};
};
};
}