-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
202 lines (176 loc) · 6.09 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
{
description = "Dune universe";
nixConfig = {
extra-experimental-features = "nix-command flakes";
extra-substituters = "https://nix-community.cachix.org https://cache.iog.io";
extra-trusted-public-keys = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=";
trusted-substituters = "http://hydra.nixos.org";
allow-import-from-derivation = true;
};
inputs =
{
nixos.url = "github:nixos/nixpkgs/nixos-unstable";
latest.url = "github:nixos/nixpkgs/nixos-unstable";
digga.url = "github:divnix/digga";
digga.inputs.nixpkgs.follows = "nixos";
digga.inputs.nixlib.follows = "nixos";
digga.inputs.home-manager.follows = "home";
home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixos";
extra-container.url = "github:erikarvstedt/extra-container";
extra-container.inputs.nixpkgs.follows = "nixos";
extra-container.inputs.flake-utils.follows = "digga/flake-utils-plus/flake-utils";
emacs.url = "github:nix-community/emacs-overlay";
emacs.inputs.flake-utils.follows = "digga/flake-utils-plus/flake-utils";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixpkgs-wayland.inputs.nixpkgs.follows = "nixos";
deploy.follows = "digga/deploy";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "latest";
mobile-nixos.url = "github:zhaofengli/mobile-nixos/pp-keyboard";
mobile-nixos.flake = false;
nur.url = "github:nix-community/nur";
nvfetcher.url = "github:berberman/nvfetcher";
nvfetcher.inputs.nixpkgs.follows = "latest";
nvfetcher.inputs.flake-compat.follows = "digga/deploy/flake-compat";
nvfetcher.inputs.flake-utils.follows = "digga/flake-utils-plus/flake-utils";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "latest";
nixos-hardware.url = "github:nixos/nixos-hardware";
};
outputs =
{ self
, digga
, nixos
, home
, extra-container
, nixos-hardware
, nur
, agenix
, nvfetcher
, deploy
, emacs
, nixpkgs-wayland
, ...
} @ inputs:
digga.lib.mkFlake
{
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
imports = [ (digga.lib.importOverlays ./overlays) ];
overlays = [
#digga.overlays.patchedNix
nur.overlay
agenix.overlays.default
nvfetcher.overlays.default
deploy.overlay
emacs.overlay
#nixpkgs-wayland.overlay
./pkgs/default.nix
];
};
latest = {
overlays = [
deploy.overlay
];
};
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
nixos = {
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
imports = [ (digga.lib.importExportableModules ./modules) ];
modules = [
{ lib.our = self.lib; }
digga.nixosModules.bootstrapIso
digga.nixosModules.nixConfig
home.nixosModules.home-manager
# extra-container.nixosModule
agenix.nixosModules.age
#bud.nixosModules.bud
({ pkgs, ... }:
let
nur-no-pkgs = import nur {
nurpkgs = import nixos { system = "x86_64-linux"; };
};
in
{
imports = [
# nur-no-pkgs.repos.emmanuelrosa.modules.protonvpn
];
})
];
};
imports = [ (digga.lib.importHosts ./machines) ];
hosts = {
/* set host specific properties here */
NixOS = { };
ithaca = {
system = "x86_64-linux";
modules = [
#mobile-nixos.nixosModules.pine64-pinephone
];
};
sietch-tabr = {
system = "x86_64-linux";
modules = [
];
};
};
importables = rec {
profiles = digga.lib.rakeLeaves ./profiles // {
users = digga.lib.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core users.tgunnoe users.root ];
workstation = [ develop ssh virt base print ];
shell = [ core develop ssh virt users.root ];
graphics = workstation ++ [ graphical ];
mobile = graphics ++ [ laptop ];
play = graphics ++ [
games
#misc.disable-mitigations
];
goPlay = play ++ [ laptop ];
};
};
};
home = {
imports = [ (digga.lib.importExportableModules ./users/modules) ];
modules = [ ];
importables = rec {
profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; rec {
base = [ direnv git ];
develop = base ++ [
profiles.emacs
profiles.zsh
];
noemacs = base ++ [ profiles.zsh ];
graphics = develop ++ [ kitty sway ];
};
};
users = {
nixos = { suites, ... }: { imports = suites.base; };
tgunnoe = { suites, ... }: {
imports = suites.graphics;
};
}; # digga.lib.importers.rakeLeaves ./users/hm;
};
devshell = ./shell;
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
}
;
}