-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
33 lines (32 loc) · 1.34 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
{
inputs = {
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
flake-utils.url = "github:numtide/flake-utils";
gomod2nix.url = "github:tweag/gomod2nix";
nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
nixpkgs.url = "github:nixos/nixpkgs/release-23.11";
};
outputs = { self, nixpkgs, nixpkgs-lib, flake-utils, gomod2nix, ... }: flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system; overlays = [ gomod2nix.overlays.default ];
config.allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) ["nomad"];
};
in {
packages.default = self.packages.${system}.generator;
packages.generator = pkgs.callPackage ./generator {};
packages.docs = pkgs.callPackage ./docs { inherit self; };
devShells.default = pkgs.callPackage ./shell.nix {};
checks.hello = self.lib.mkNomadJobs {
inherit system;
config = [ ./examples/hello.nix ./examples/goodbye.nix ./examples/docs.nix ];
};
}) // {
lib = import ./lib/without-pkgs.nix { inherit self nixpkgs nixpkgs-lib; };
overlays.default = final: prev: {
lib = prev.lib
// (import ./lib/without-pkgs.nix { inherit self nixpkgs nixpkgs-lib; })
// (import ./lib/with-pkgs.nix { inherit (prev) lib; pkgs = final; });
};
};
}