-
Notifications
You must be signed in to change notification settings - Fork 17
/
flake.nix
48 lines (44 loc) · 1.4 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
# Run these two commands to update the inputs and run the tests:
#
# nix flake update
# nix build
#
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.opam-nix = {
url = "github:tweag/opam-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.opam-repository.follows = "opam-repository";
};
inputs.flake-utils = {
url = "github:numtide/flake-utils";
};
inputs.opam-repository = {
url = "github:ocaml/opam-repository";
flake = false;
};
outputs = { self, nixpkgs, opam-nix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (opam-nix.lib.${system}) buildOpamProject;
scope = buildOpamProject { } "albatross" ./. { ocaml-system = "*"; };
# Prevent unnecessary dependencies on the resulting derivation
albatross = scope.albatross.overrideAttrs (_: {
removeOcamlReferences = true;
doNixSupport = false;
});
in {
packages = { inherit albatross; };
defaultPackage = albatross;
}) // {
nixosModules.albatross = { pkgs, ... }:
let albatross = self.packages.${pkgs.system}.albatross;
in {
imports = [
(import packaging/nixos/albatross_service.nix albatross)
packaging/nixos/albatross_tls_endpoint.nix
];
};
};
}