-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflake.nix
53 lines (51 loc) · 1.53 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
{
description = "A flake for connet project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
{
nixosModules.default = ./nix/client-module.nix;
nixosModules.server = ./nix/server-module.nix;
nixosModules.control-server = ./nix/control-server-module.nix;
nixosModules.relay-server = ./nix/relay-server-module.nix;
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
formatter = pkgs.nixpkgs-fmt;
packages = {
default = pkgs.callPackage ./nix/package.nix { };
docker = pkgs.callPackage ./nix/docker.nix { };
};
devShells.default = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
go
gopls
golangci-lint
fd
manifest-tool
protobuf
protoc-gen-go
process-compose
skopeo
(pkgs.writeShellScriptBin "gen-local-certs" ''
set -euo pipefail
cd .direnv
${minica}/bin/minica -domains localhost -ip-addresses 127.0.0.1
cd ..
'')
(writeShellScriptBin "clean-local-certs" ''
set -euo pipefail
rm -rf .direnv/localhost
rm .direnv/minica.pem
rm .direnv/minica-key.pem
'')
];
};
});
}