forked from jsha/minica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
42 lines (38 loc) · 1.27 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
{
description =
"microca: microca is a small, simple Certificate Authority tool.";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
lastModifiedDate =
self.lastModifiedDate or self.lastModified or "19700101";
version = builtins.substring 0 8 lastModifiedDate;
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
overlay = import ./overlay.nix { inherit self; };
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
microca = pkgs.buildGoModule {
pname = "microca";
inherit version;
src = ./.;
vendorHash = null;
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.microca);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
'';
nativeBuildInputs = with pkgs; [ git go gopls go-tools ];
};
});
};
}