-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflake.nix
216 lines (190 loc) · 7.13 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
description = "ragons nix/nixos configs";
inputs = {
# base imports
utils.url = "github:numtide/flake-utils";
## nixos/nix-darwin dependencies
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
agenix.url = "github:ryantm/agenix/main";
agenix.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
quadlet-nix.url = "github:SEIAROTg/quadlet-nix";
quadlet-nix.inputs.nixpkgs.follows = "nixpkgs";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
# programs
xynoblog.url = "github:thexyno/blog";
xynoblog.inputs.nixpkgs.follows = "nixpkgs";
x.url = "github:thexyno/x";
x.inputs.nixpkgs.follows = "nixpkgs";
helix.url = "github:SofusA/helix-pull-diagnostics/pull-diagnostics";
wired.inputs.nixpkgs.follows = "nixpkgs";
wired.url = "github:Toqozz/wired-notify";
roslyn-language-server.url = "github:sofusa/roslyn-language-server";
roslyn-language-server.inputs.nixpkgs.follows = "nixpkgs";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
kmonad = {
url = "git+https://github.com/jokesper/kmonad?dir=nix&ref=feat-tap-overlap";
inputs.nixpkgs.follows = "nixpkgs";
};
## editor stuff
# nixd.url = "github:nix-community/nixd";
# nixd.inputs.nixpkgs.follows = "nixpkgs";
## vim
# nnn-nvim.url = "github:luukvbaal/nnn.nvim";
# nnn-nvim.flake = false;
# notify-nvim.url = "github:rcarriga/nvim-notify";
# notify-nvim.flake = false;
# noice-nvim.url = "github:folke/noice.nvim";
# noice-nvim.flake = false;
# ## zsh
# zsh-completions.url = "github:zsh-users/zsh-completions";
# zsh-completions.flake = false;
# zsh-syntax-highlighting.url = "github:zsh-users/zsh-syntax-highlighting/master";
# zsh-syntax-highlighting.flake = false;
# zsh-vim-mode.url = "github:softmoth/zsh-vim-mode";
# zsh-vim-mode.flake = false;
# agkozak-zsh-prompt.url = "github:agkozak/agkozak-zsh-prompt";
# agkozak-zsh-prompt.flake = false;
# ## xonsh
# xonsh-fish-completer.url = "github:xonsh/xontrib-fish-completer";
# xonsh-fish-completer.flake = false;
# xonsh-direnv.url = "github:74th/xonsh-direnv";
# xonsh-direnv.flake = false;
## hammerspoon
miro.url = "github:miromannino/miro-windows-manager";
miro.flake = false;
spoons.url = "github:Hammerspoon/Spoons";
spoons.flake = false;
#other dependencies
pandoc-latex-template.url = "github:Wandmalfarbe/pandoc-latex-template";
pandoc-latex-template.flake = false;
};
outputs =
inputs @ { self
, nixpkgs
, nixpkgs-darwin
, nixpkgs-master
, agenix
, home-manager
, impermanence
, darwin
, utils
, xynoblog
# , lolpizza
, lix-module
, kmonad
, wired
, x
, ...
}:
let
extraSystems = [ ];
lib = nixpkgs.lib.extend (self: super: {
my = import ./lib { inherit inputs; lib = self; };
});
overlays = [
self.overlays.default
wired.overlays.default
];
genPkgsWithOverlays = system: import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
genDarwinPkgsWithOverlays = system: import nixpkgs-darwin {
inherit system overlays;
config.allowUnfree = true;
};
rev = if (lib.hasAttrByPath [ "rev" ] self.sourceInfo) then self.sourceInfo.rev else "Dirty Build";
nixosSystem = system: extraModules: hostName:
let
pkgs = genPkgsWithOverlays system;
in
nixpkgs.lib.nixosSystem
rec {
inherit system;
specialArgs = { inherit lib inputs; };
modules = [
lix-module.nixosModules.default
agenix.nixosModules.age
impermanence.nixosModules.impermanence
home-manager.nixosModules.home-manager
kmonad.nixosModules.default
xynoblog.nixosModule
# lolpizza.nixosModule
x.nixosModule
({ config, ... }: lib.mkMerge [{
nixpkgs.pkgs = pkgs;
nixpkgs.overlays = overlays;
networking.hostName = hostName;
system.configurationRevision = rev;
services.getty.greetingLine =
"<<< Welcome to ${config.system.nixos.label} @ ${rev} - Please leave \\l >>>";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
}])
./nixos-common.nix
] ++ extraModules;
};
darwinSystem = system: extraModules: hostName:
let
pkgs = genDarwinPkgsWithOverlays system;
in
darwin.lib.darwinSystem
{
inherit system;
specialArgs = { inherit lib inputs self darwin; };
modules = [
home-manager.darwinModules.home-manager
{
nixpkgs.overlays = overlays;
networking.hostName = hostName;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs pkgs; };
}
./darwin-common.nix
lix-module.nixosModules.default
] ++ extraModules;
};
processConfigurations = lib.mapAttrs (n: v: v n);
in
{
lib = lib.my;
overlays.default = final: prev: {
unstable = import nixpkgs-master {
system = prev.system;
config.allowUnfree = true;
};
my = self.packages."${prev.system}";
};
# nixosModules = lib.my.mapModulesRec ./nixos-modules import;
# darwinModules = lib.my.mapModulesRec ./darwin-modules import;
nixosConfigurations = processConfigurations {
picard = nixosSystem "x86_64-linux" [ ./hosts/picard/default.nix ];
ds9 = nixosSystem "x86_64-linux" [ ./hosts/ds9/default.nix ];
voyager = nixosSystem "x86_64-linux" [ ./hosts/voyager/default.nix ];
theseus = nixosSystem "x86_64-linux" [ ./hosts/theseus/default.nix ];
};
darwinConfigurations = processConfigurations {
daedalus = darwinSystem "aarch64-darwin" [ ./hosts/daedalus/default.nix ];
};
} // utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ lefthook nixpkgs-fmt inputs.agenix.packages.${system}.agenix ];
};
packages = lib.my.mapModules ./packages (p: pkgs.callPackage p { inputs = inputs; });
});
}