-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
48 lines (46 loc) · 1.48 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 = "garnix example server with a typescript frontend and a go backend";
# Add your nix dependencies here.
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
garnix-lib.url = "github:garnix-io/garnix-lib";
flake-utils.url = "github:numtide/flake-utils";
npmlock2nix-repo = {
url = "github:nix-community/npmlock2nix";
flake = false;
};
};
outputs = inputs:
inputs.flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ]
(system:
let
pkgs = import inputs.nixpkgs { inherit system; };
in
{
# Here you can define packages that your flake outputs.
packages = {
# This imports `./frontend/default.nix` which defines a nix package
# that builds the frontend bundle. This will be served as static
# files by the server.
frontend-bundle = pkgs.callPackage ./frontend { self = inputs.self; };
backend = pkgs.callPackage ./backend { };
};
devShells.default = pkgs.mkShell
{
nativeBuildInputs = [ pkgs.nodejs pkgs.go pkgs.gopls ];
};
})
//
{
nixosConfigurations.server = inputs.nixpkgs.lib.nixosSystem {
modules = [
inputs.garnix-lib.nixosModules.garnix
{
_module.args = { self = inputs.self; };
}
# This is where the server is defined.
./hosts/server.nix
];
};
};
}