-
Notifications
You must be signed in to change notification settings - Fork 7
/
flake.nix
48 lines (45 loc) · 1.51 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
{
description = "Convert SSH Ed25519 keys to age keys";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:/hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
};
outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
systems = [
"aarch64-linux"
"x86_64-linux"
"riscv64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages = {
ssh-to-age = (pkgs.callPackage ./default.nix { });
default = config.packages.ssh-to-age;
};
checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
{
cross-build = self'.packages.ssh-to-age.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gox ];
buildPhase = ''
runHook preBuild
HOME=$TMPDIR gox -verbose -osarch '!darwin/386' ./cmd/ssh-to-age/
runHook postBuild
'';
doCheck = false;
installPhase = ''
runHook preBuild
touch $out
runHook postBuild
'';
});
} // packages // devShells;
};
});
}