-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
150 lines (134 loc) · 5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
description = "On the internet, nobody knows you're a dog.";
outputs = inputs @ {...}:
inputs.flake-parts.lib.mkFlake {inherit inputs;} ({flake-parts-lib, ...}: let
inherit (flake-parts-lib) importApply;
hiveBlockTypes = with inputs.hive.blockTypes;
with inputs.std.blockTypes; [
darwinConfigurations
homeConfigurations
(functions "homeProfiles")
(functions "lib")
];
flakeModules.hive = importApply ./hive-flake-module.nix {inherit (inputs) hive;};
in {
imports = [
flakeModules.hive
inputs.std.flakeModule
inputs.treefmt-nix.flakeModule
inputs.devenv.flakeModule
];
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
config,
system,
...
}: {
treefmt.programs.alejandra.enable = true;
treefmt.projectRootFile = ".git/config";
devenv.shells.default = {
pre-commit = {
hooks = {
shfmt.enable = true;
shellcheck.enable = true;
alejandra.enable = true;
deadnix.enable = false;
deadnix.excludes = ["cells/emacs/packages/epkgs/_sources/generated.nix"];
nil.enable = true;
black.enable = true;
commitizen.enable = true;
};
};
packages = [
config.treefmt.build.wrapper
inputs.std.packages.${system}.std
inputs.colmena.packages.${system}.colmena
inputs.nvfetcher.packages.${system}.default
];
};
};
std = {
grow = {
cellsFrom = ./cells;
cellBlocks =
hiveBlockTypes
++ (with inputs.std.blockTypes; [
(installables "packages" {ci.build = true;})
(functions "lib")
]);
nixpkgsConfig = {allowUnfree = true;};
};
harvest = {
packages = [
["emacs" "packages"]
["lib"]
];
};
};
hive.collect = [
"darwinConfigurations"
"homeConfigurations"
];
flake = {default = flakeModules.hive;};
});
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs-unstable";
nvfetcher.url = "github:berberman/nvfetcher";
nvfetcher.inputs.nixpkgs.follows = "nixpkgs";
nvfetcher.inputs.flake-utils.follows = "flake-utils";
emacs-overlay.url = "github:nix-community/emacs-overlay";
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs-unstable";
emacs-overlay.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
emacs-overlay.inputs.flake-utils.follows = "flake-utils";
};
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
haumea.url = "github:nix-community/haumea";
haumea.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
pre-commit-hooks.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
devenv.url = "github:cachix/devenv";
devenv.inputs.pre-commit-hooks.follows = "pre-commit-hooks";
devenv.inputs.nixpkgs.follows = "nixpkgs";
std.url = "github:divnix/std";
std.inputs.nixpkgs.follows = "nixpkgs";
colmena.url = "github:zhaofengli/colmena";
colmena.inputs.flake-utils.follows = "flake-utils";
hive.url = "github:divnix/hive";
hive.inputs.nixpkgs.follows = "nixpkgs";
hive.inputs.colmena.follows = "colmena";
hive.inputs.disko.follows = "disko";
home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixpkgs";
darwin.url = "github:LnL7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
nix2container.url = "github:nlewo/nix2container";
nix2container.inputs.nixpkgs.follows = "nixpkgs";
nix2container.inputs.flake-utils.follows = "flake-utils";
mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin";
};
nixConfig = {
extra-substituters = [
"https://numtide.cachix.org"
"https://nix-community.cachix.org"
"https://sielicki.cachix.org"
];
extra-trusted-public-keys = [
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"sielicki.cachix.org-1:zeCLX9Sp6858+YldvEY1gKB9Qd10Y/dK6YEQN+HsXZk="
];
};
}