-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
170 lines (167 loc) · 6.27 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
{
description = "Robert's NixOs flake configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = { url = "github:nix-community/impermanence"; };
jules.url = "git+ssh://[email protected]/robert-elles/jules?ref=main";
jules_local = { url = "/home/robert/code/jules"; };
# mynixos-private = {
# url = "git+ssh://[email protected]/robert-elles/mynixos-private";
# inputs.nixpkgs.follows = "nixpkgs";
# };
};
outputs = { self, nixpkgs, nixos-hardware, agenix, impermanence, home-manager, jules, jules_local, ... }@inputs:
let
system_repo_root = "/home/robert/Nextcloud/code/mynixos";
system_x86 = "x86_64-linux";
patchedPkgs = nixpkgs.legacyPackages.x86_64-linux.applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [
# ./patches/immich_244803.patch # https://github.com/NixOS/nixpkgs/pull/244803/files
];
};
nixosSystem = import (patchedPkgs + "/nixos/lib/eval-config.nix");
common_modules = [
agenix.nixosModules.default
({ lib, ... }: {
options = {
system_repo_root = {
type = lib.types.path;
default = /home/robert/code/mynixos;
};
};
})
({ ... }: {
nixpkgs.config.permittedInsecurePackages = [
"electron-24.8.6"
];
environment.systemPackages = [ agenix.packages.${system_x86}.default ];
environment.sessionVariables.FLAKE = "${system_repo_root}";
# After that you can refer to the system version of nixpkgs as <nixpkgs> even without any channels configured.
# Also, legacy package stuff like the ability to do nix-shell -p netcat just works.
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
environment =
{
etc = {
"nix/channels/nixpkgs".source = nixpkgs;
"nix/channels/home-manager".source = home-manager;
};
};
})
./nixconfig/hosts-blacklist
(import ./nixconfig/laptop.nix system_repo_root)
(import ./dotfiles/dotfiles.nix system_repo_root)
./nixconfig/common.nix
./nixconfig/pyenv.nix
];
in
{
nixosConfigurations = {
panther = nixosSystem rec {
system = system_x86;
specialArgs = inputs;
modules = common_modules ++ [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t495
./machines/t495.nix
./nixconfig/kuelap/kuelap.nix
jules_local.nixosModules.${system}.default
({ ... }: {
jules.services.renaissance.enable = false;
systemd.additionalUpstreamSystemUnits = [ "debug-shell.service" ];
# virtualisation.oci-containers.containers = {
# renaissance = {
# # image = "docker.io/robertelles/renaissance:latest";
# image = "renaissance:0.1.11";
# ports = [ "7600:8080" ];
# extraOptions = [ "--network=host" ];
# # memoryLimit = "1G";
# # cpuQuota = 100000;
# # cpuPeriod = 100000;
# # restartPolicy = "always";
# # bindMounts = [
# # { hostPath = "/home/robert/code/renaissance"; mountPath = "/renaissance"; }
# # ];
# };
# };
})
({ ... }: {
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 8080 ];
# networking.firewall.allowedUDPPorts = [ ... ];
networking.firewall.enable = false;
networking.extraHosts = ''
192.168.178.69 falcon
'';
})
];
};
falcon = nixosSystem rec {
system = system_x86;
specialArgs = inputs;
modules = common_modules ++ [
nixos-hardware.nixosModules.dell-xps-13-9360
./machines/xps13.nix
jules.nixosModules.${system}.default
({ ... }: {
jules.services.jupyter = {
enable = true;
password = "argon2:$argon2id$v=19$m=10240,t=10,p=8$uZibffn4smeNyJJJCaycEA$ccK5+/+/LfpHfwydNYAGTkYDd8Zd2tGobE0j0xXgAJk";
user = "robert";
group = "users";
notebookDir = "/home/robert/code/jules";
};
jules.timers.crawlers.enable = true;
jules.services.mercury.enable = true;
})
./nixconfig/server/disks.nix
./nixconfig/server/agenix.nix
({ ... }: {
security.sudo.wheelNeedsPassword = false;
networking.firewall.enable = false;
services.xserver.displayManager.autoLogin = {
enable = true;
user = "robert";
};
})
./nixconfig/server/postgres.nix
./nixconfig/server/acmeproxy.nix
./nixconfig/server/nextcloud.nix
./nixconfig/server/nfs.nix
./nixconfig/server/samba.nix
./nixconfig/server/services.nix
./nixconfig/server/paperless.nix
./nixconfig/server/torrent.nix
./nixconfig/server/audiobookshelf.nix
./nixconfig/server/calibre-web.nix
./nixconfig/server/bluetooth_speaker
./nixconfig/server/spotifyd.nix
];
};
bear = nixosSystem {
system = system_x86;
specialArgs = inputs;
modules = common_modules ++ [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t495
./machines/bear.nix
({ ... }: {
networking.firewall.enable = false;
networking.extraHosts = ''
192.168.178.69 falcon
'';
})
];
};
};
};
}