-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
151 lines (115 loc) · 4.16 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-staging.url = "github:NixOS/nixpkgs/nixos-unstable-small"; # ?rev=493dfd5c25fefa57fe87d50aaa0341a47c673546
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
catppuccin.url = "github:catppuccin/nix";
nix-std.url = "github:chessai/nix-std";
flake-programs-sqlite.url = "github:wamserma/flake-programs-sqlite";
flake-programs-sqlite.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
adaptive-sharpen = {
url = "github:bacondither/Adaptive-sharpen";
flake = false;
};
};
outputs = { self, nixpkgs, nixpkgs-staging, nixpkgs-unstable, nixpkgs-stable, home-manager, impermanence,
catppuccin, nix-std, flake-programs-sqlite, stylix, chaotic, nixos-cosmic, adaptive-sharpen, ... }@attrs:
let
publicIP = "98.247.215.114";
serverLan = "10.0.0.125";
yggdrasilPort = 6901;
sharedConfig = hostname: inSettings@{ ... }:
let
# sets the default settings, which will be overwritten by any custom parameters
systemSettings = {
architecture = "x86_64-linux";
hdr = false;
scaling = "1";
nixpkgs = "unstable";
yggdrasilPeers = [];
publicIP = publicIP;
serverLan = serverLan;
yggdrasilPort = yggdrasilPort;
} // inSettings;
modules = rec {
system = systemSettings.architecture;
specialArgs = attrs // { inherit systemSettings; };
modules = [
./base
./${hostname}.nix
./hardware/${hostname}.nix
{ networking.hostName = hostname; }
{ nixpkgs.hostPlatform = systemSettings.architecture;
nixpkgs.config.pkgs = if systemSettings.nixpkgs == "staging"
then import nixpkgs-staging { inherit system; }
else import nixpkgs { inherit system; }; }
home-manager.nixosModules.home-manager
impermanence.nixosModule
{ home-manager.users.klaymore.imports = [
impermanence.nixosModules.home-manager.impermanence
catppuccin.homeManagerModules.catppuccin
]; }
catppuccin.nixosModules.catppuccin
flake-programs-sqlite.nixosModules.programs-sqlite
#stylix.nixosModules.stylix
chaotic.nixosModules.default
nixos-cosmic.nixosModules.default
{ nixpkgs.overlays = [
(final: prev: {
unstable = import nixpkgs-unstable {
system = systemSettings.architecture;
config.allowUnfree = true;
};
})
(final: prev: {
stable = import nixpkgs-stable {
system = systemSettings.architecture;
config.allowUnfree = true;
};
})
];}
];
};
in
if systemSettings.nixpkgs == "staging"
then nixpkgs-staging.lib.nixosSystem modules
else nixpkgs.lib.nixosSystem modules;
in
{
nixosConfigurations = {
pc = sharedConfig "pc" {
hdr = true;
scaling = "1.75";
#nixpkgs = "staging";
yggdrasilPeers = [
"tcp://${serverLan}:${toString yggdrasilPort}"
];
};
server = sharedConfig "server" {
yggdrasilPeers = [
"tls://44.234.134.124:443"
"tcp://nerdvm.mywire.org:65535"
];
};
laptop = sharedConfig "laptop" {
yggdrasilPeers = [ "tcp://${publicIP}:${toString yggdrasilPort}" ];
};
oldlaptop = sharedConfig "oldlaptop" {};
pimusic = sharedConfig "pimusic" {
architecture = "aarch64-linux";
};
};
};
}