-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.in.nix
160 lines (151 loc) · 4.95 KB
/
flake.in.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
{
description = "ari's nice lil nix config :3";
nixConfig = {
extra-substituters = [
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
inputs =
let
followsNixpkgs = url: {
inherit url;
inputs.nixpkgs.follows = "nixpkgs";
};
in
{
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nur = followsNixpkgs "github:nix-community/NUR";
agenix = followsNixpkgs "github:ryantm/agenix";
home-manager = followsNixpkgs "github:nix-community/home-manager";
hypr-contrib = followsNixpkgs "github:hyprwm/contrib";
vscode-ext = followsNixpkgs "github:nix-community/nix-vscode-extensions";
beepy = followsNixpkgs "github:arilotter/nixos-beepy";
fido2-hid-bridge = followsNixpkgs "github:arilotter/fido2-hid-bridge";
fw-inputmodule = followsNixpkgs "github:caffineehacker/nix?dir=flakes/inputmodule-rs";
nixvim = followsNixpkgs "github:nix-community/nixvim";
lix-module = followsNixpkgs "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz";
stylix = followsNixpkgs "github:danth/stylix";
};
outputs =
{
self,
nur,
nixpkgs,
home-manager,
stylix,
agenix,
fido2-hid-bridge,
lix-module,
...
}@inputs:
let
sys = {
specialArgs = {
inherit inputs;
};
};
base-modules = [
lix-module.nixosModules.default
agenix.nixosModules.default
nur.modules.nixos.default
fido2-hid-bridge.nixosModule
home-manager.nixosModules.home-manager
{ home-manager.extraSpecialArgs = { inherit inputs; }; }
./nixos/all-systems-configuration.nix
];
tty-modules = base-modules ++ [
{
home-manager.users.ari = import ./home-manager/home.nix;
}
];
graphical-modules = base-modules ++ [
stylix.nixosModules.stylix
./nixos/graphical-configuration.nix
{
home-manager.users.ari = import ./home-manager/home-graphical.nix;
}
];
in
rec {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
nixosConfigurations = {
# desktop ~
"luna" = nixpkgs.lib.nixosSystem (
sys
// {
modules = graphical-modules ++ [
./nixos/luna/hardware-configuration.nix
./nixos/luna/configuration.nix
./nixos/mount-sol-samba-share.nix
];
}
);
# framework laptop
"hermes" = nixpkgs.lib.nixosSystem (
sys
// {
modules = graphical-modules ++ [
inputs.nixos-hardware.nixosModules.framework-16-7040-amd
./nixos/hermes/hardware-configuration.nix
./nixos/hermes/configuration.nix
./nixos/mount-sol-samba-share.nix
];
}
);
# kronos = saturn = cuz it rings ;)
# sd image: `nix build '.#kronos-sd'`
# from another pc: `NIX_SSHOPTS="-t" nixos-rebuild boot --flake .#kronos -L --target-host [email protected] --use-remote-sudo`
"kronos" = nixpkgs.lib.nixosSystem (
sys
// {
modules = tty-modules ++ [
inputs.beepy.nixosModule
./nixos/kronos/hardware-configuration.nix
./nixos/kronos/configuration.nix
./nixos/mount-sol-samba-share.nix
];
}
);
# server = sol
# locally: `sudo nixos-rebuild switch --flake .`
# from `another pc: `NIX_SSHOPTS="-t" nixos-rebuild switch --flake .#sol -L --target-host [email protected] --use-remote-sudo`
"sol" = nixpkgs.lib.nixosSystem (
sys
// {
modules = tty-modules ++ [
inputs.nixos-hardware.nixosModules.hardkernel-odroid-h3
./nixos/sol/hardware-configuration.nix
./nixos/sol/configuration.nix
];
}
);
"casey" = nixpkgs.lib.nixosSystem (
sys
// {
modules = tty-modules ++ [
inputs.nixos-hardware.nixosModules.hardkernel-odroid-h3
./nixos/casey/hardware-configuration.nix
./nixos/casey/configuration.nix
];
}
);
};
kronos-sd = nixosConfigurations.kronos.config.system.build.sdImage;
checks.x86_64-linux.checkNixpkgsVersions =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
pkgs.runCommand "check-nixpkgs-versions" { } ''
if grep -q "nixpkgs_2" ${self}/flake.lock; then
echo "Error: Found nixpkgs_2 in flake.lock"
echo "You should add followsNixpkgs to the input that uses nixpkgs_2."
exit 1
fi
touch $out
'';
};
}