-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
57 lines (53 loc) · 1.53 KB
/
Copy pathflake.nix
File metadata and controls
57 lines (53 loc) · 1.53 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
{
description = "friendly network";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
nara = pkgs.callPackage ./pkgs/nara.nix { };
in
{
packages = {
default = nara;
nara = nara;
docker = pkgs.dockerTools.buildImage {
name = "nara";
tag = "latest";
contents = [ nara pkgs.cacert ];
config = {
Cmd = [ "${nara}/bin/nara" "-serve-ui" "-http-addr" ":8080" ];
Env = [ "HTTP_ADDR=:8080" ];
ExposedPorts = {
"8080/tcp" = { };
};
};
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
esbuild
nodejs
];
shellHook = ''
echo "nara dev shell"
echo " make build-web - build JS assets"
echo " make watch-web - watch JS assets (dev mode)"
echo " make build - build Go binary (includes JS)"
echo " make run - run nara locally"
'';
};
}) // {
nixosModules.default = self.nixosModules.nara;
nixosModules.nara = import ./nara.nix;
};
}