-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
101 lines (92 loc) · 2.28 KB
/
Copy pathflake.nix
File metadata and controls
101 lines (92 loc) · 2.28 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
98
99
100
101
{
description = "Expose HTTP/SSH/TCP services through SSH port forwarding";
outputs =
{ self, ... }@args:
let
inputs = (import ./.tack) {
overrides = args.tackOverrides or { };
};
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
eachSystem =
f:
(builtins.foldl' (
acc: system:
let
fSystem = f system;
in
builtins.foldl' (
acc': attr:
acc'
// {
${attr} = (acc'.${attr} or { }) // fSystem.${attr};
}
) acc (builtins.attrNames fSystem)
) { } systems);
in
{
nixosModules = {
default = self.nixosModules.sandhole;
sandhole =
{ lib, pkgs, ... }:
{
imports = [ ./nix/modules/sandhole.nix ];
services.sandhole.package = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.default;
};
sandhole-websites =
{ ... }:
{
imports = [ ./nix/modules/sandhole-websites.nix ];
};
};
overlays = {
default = self.overlays.sandhole;
sandhole = _: prev: {
sandhole = self.packages.${prev.stdenv.hostPlatform.system}.default;
};
};
}
// eachSystem (
system:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};
craneLib = (import inputs.crane { inherit pkgs; }).overrideToolchain (
p: p.rust-bin.stable.latest.default
);
inherit
(import ./nix {
inherit
system
pkgs
craneLib
;
})
packages
checks
shell
;
inherit (pkgs) lib;
in
{
packages.${system} = packages;
apps.${system}.default =
let
sandhole = self.packages.${system}.default;
in
{
type = "app";
program = lib.getExe sandhole;
inherit (sandhole) meta;
};
checks.${system} = checks;
devShells.${system}.default = shell;
}
);
}