-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
81 lines (79 loc) · 2.38 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
inputs = {
javascript-nix.url = "github:nicknovitski/javascript-nix/v1";
make-shell.url = "github:nicknovitski/make-shell";
update-flake.url = "github:nicknovitski/update-flake";
gcloud-nix.url = "github:nicknovitski/gcloud-nix/v1";
};
outputs =
{
gcloud-nix,
javascript-nix,
make-shell,
update-flake,
...
}:
{
flakeModules.default =
{
inputs,
lib,
...
}:
{
imports = [
make-shell.flakeModules.default
update-flake.flakeModules.default
./flake-modules
];
# Default supported systems
systems = [
"aarch64-darwin" # Apple Silicon Laptops
"aarch64-linux" # Devcontainers
"x86_64-linux" # Cloud Services
];
perSystem =
{
pkgs,
system,
...
}:
{
# add expo options and defaults to all shells
make-shell.imports = [
gcloud-nix.shellModules.default
javascript-nix.shellModules.default
./shell-modules
];
# create update-flake package
update.enable = true;
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
# Permit installing certain packages with unfree software licenses
config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"graphite-cli"
"terraform"
];
overlays = [
(final: prev: {
lib = prev.lib.recursiveUpdate prev.lib {
fileset =
let
fs = prev.lib.fileset;
in
{
byRegex = root: regexes: fs.fromSource (prev.lib.sources.sourceByRegex root regexes);
excludeByRegex = root: excludes: fs.difference root (final.lib.fileset.byRegex root excludes);
};
};
})
];
};
# enable `nix fmt` command
formatter = pkgs.nixfmt-rfc-style;
};
};
};
}