-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
97 lines (88 loc) · 2.46 KB
/
Copy pathflake.nix
File metadata and controls
97 lines (88 loc) · 2.46 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
description = "Container PID 1 and process runner for Nix Modular Services";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nix2container = {
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ nixpkgs, nix2container, ... }:
let
inherit (nixpkgs) lib;
overlay =
final: _prev:
let
inherit (final.stdenv.hostPlatform) system;
in
{
nimi = final.callPackage ./nix/package.nix {
inherit (nix2container.packages.${system}) nix2container;
};
inherit nix2container;
};
systems = [
"x86_64-darwin"
"aarch64-darwin"
"x86_64-linux"
"aarch64-linux"
];
eachSystem =
fn:
lib.genAttrs systems (
system:
(fn rec {
inherit system;
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
overlay
];
inherit (pkgs) callPackage;
})
);
in
{
packages = eachSystem (
{ pkgs, system, ... }:
import ./default.nix {
inherit pkgs;
inherit (nix2container.packages.${system}) nix2container;
}
);
devShells = eachSystem (
{ pkgs, ... }:
{
default = import ./shell.nix { inherit pkgs; };
}
);
checks = eachSystem (
{ callPackage, ... }:
let
checksFromDir =
directory:
lib.packagesFromDirectoryRecursive {
inherit callPackage directory;
};
in
(checksFromDir ./examples) // (checksFromDir ./nix/checks)
);
formatter = eachSystem ({ callPackage, ... }: callPackage ./nix/formatter.nix { });
overlays.default = overlay;
nixosModules.default = lib.modules.importApply ./nix/modules/nixos.nix {
inherit nix2container;
};
homeModules.default = lib.modules.importApply ./nix/modules/home-manager.nix {
inherit nix2container;
};
flakeModules.default = lib.modules.importApply ./nix/modules/flake-parts.nix {
inherit nix2container;
};
modules.nimi.default = import ./nix/modules/nimi.nix;
};
nixConfig = {
extra-substituters = [
"https://weyl-ai.cachix.org"
];
extra-trusted-public-keys = [
"weyl-ai.cachix.org-1:cR0SpSAPw7wejZ21ep4SLojE77gp5F2os260eEWqTTw="
];
};
}