-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
58 lines (50 loc) · 1.7 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
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "An age plugin for using SSH keys from 1Password";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.flake-compat.url = "github:edolstra/flake-compat";
inputs.wrapper-manager.url = "github:viperML/wrapper-manager";
inputs.wrapper-manager.inputs.nixpkgs.follows = "nixpkgs";
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem = { self', pkgs, lib, ... }: {
packages.age = (inputs.wrapper-manager.lib {
inherit pkgs;
modules = [
{
wrappers.age = {
basePackage = pkgs.age;
pathAdd = [ self'.packages.age-plugin-1p ];
};
}
];
}).config.wrappers.age.wrapped;
packages.age-plugin-1p = pkgs.buildGoModule {
pname = "age-plugin-1p";
version = "0.1.0";
src = ./.;
vendorHash = "sha256-WrdwhlaqciVEB2L+Dh/LEeSE7I3+PsOTW4c+0yOKzKY=";
};
packages.default = pkgs.buildEnv {
name = "age-with-plugins";
paths = builtins.attrValues {
inherit (self'.packages) age age-plugin-1p;
};
meta.mainProgram = "age-plugin-1p";
};
devShells.default = pkgs.mkShell {
buildInputs = builtins.attrValues {
inherit (pkgs) go gopls go-tools;
inherit (self'.packages) age age-plugin-1p;
};
};
};
};
}