-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
60 lines (52 loc) · 1.72 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
54
55
56
57
58
59
60
{
description = "Go modules for inter-vm communication with gRPC.";
# Inputs
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
};
outputs = inputs@{ self, flake-utils, devshell, nixpkgs }:
let
# Generate a user-friendly version number
# to work with older version of flakes
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
version = builtins.substring 0 8 lastModifiedDate;
systems = with flake-utils.lib.system; [
x86_64-linux
aarch64-linux
];
in
flake-utils.lib.eachSystem systems (system: {
# Packages
packages =
let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.callPackage ./nixos/packages/default.nix {};
givc-app = pkgs.callPackage ./nixos/packages/givc-app.nix {};
};
# DevShells
devShells =
let
pkgs = nixpkgs.legacyPackages.${system}.extend( devshell.overlays.default );
in {
default = pkgs.devshell.mkShell {
imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
};
};
}) // {
# NixOS Modules
nixosModules =
{
admin = import ./nixos/modules/admin.nix;
host = import ./nixos/modules/host.nix;
sysvm = import ./nixos/modules/sysvm.nix;
appvm = import ./nixos/modules/appvm.nix;
};
# Overlays
overlays.default = (final: prev:{
givc-app = prev.callPackage ./nixos/packages/givc-app.nix { pkgs=prev; };
});
};
}