diff options
-rw-r--r-- | flake.nix | 9 | ||||
-rw-r--r-- | templates/desktop/boot.nix | 10 | ||||
-rw-r--r-- | templates/desktop/flake.nix | 47 | ||||
-rw-r--r-- | templates/desktop/host.nix | 11 | ||||
-rw-r--r-- | templates/desktop/tinc.nix | 16 |
5 files changed, 93 insertions, 0 deletions
@@ -194,6 +194,15 @@ | |||
194 | }; | 194 | }; |
195 | }; | 195 | }; |
196 | 196 | ||
197 | templates = { | ||
198 | desktop = { | ||
199 | path = ./templates/desktop; | ||
200 | description = "Flake template for a new desktop machine"; | ||
201 | }; | ||
202 | }; | ||
203 | |||
204 | defaultTemplate = self.templates.desktop; | ||
205 | |||
197 | hydraJobs = | 206 | hydraJobs = |
198 | let | 207 | let |
199 | # Use the nixpkgs configuration of the testDefault machine, so that it | 208 | # Use the nixpkgs configuration of the testDefault machine, so that it |
diff --git a/templates/desktop/boot.nix b/templates/desktop/boot.nix new file mode 100644 index 0000000..ad4a186 --- /dev/null +++ b/templates/desktop/boot.nix | |||
@@ -0,0 +1,10 @@ | |||
1 | { ... }: | ||
2 | |||
3 | { | ||
4 | boot.loader.systemd-boot = { | ||
5 | enable = true; | ||
6 | editor = false; | ||
7 | }; | ||
8 | |||
9 | boot.cleanTmpDir = true; | ||
10 | } | ||
diff --git a/templates/desktop/flake.nix b/templates/desktop/flake.nix new file mode 100644 index 0000000..e0b2e40 --- /dev/null +++ b/templates/desktop/flake.nix | |||
@@ -0,0 +1,47 @@ | |||
1 | { | ||
2 | description = "Flake for the myHostname host"; | ||
3 | |||
4 | inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; | ||
5 | inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs"; | ||
6 | inputs.nixos-config-reborn = { | ||
7 | url = "git+https://git.huh.gdn/NixOS/nixos-config-reborn"; | ||
8 | inputs = { | ||
9 | nixpkgs.follows = "nixpkgs"; | ||
10 | nixpkgs-unstable.follows = "nixpkgs-unstable"; | ||
11 | }; | ||
12 | }; | ||
13 | inputs.nixos-hardware.url = "github:NixOS/nixos-hardware"; | ||
14 | |||
15 | outputs = inputs @ { self, nixpkgs, nixos-config-reborn, nixos-hardware, ... }: { | ||
16 | |||
17 | nixosConfigurations.myHostname = nixpkgs.lib.nixosSystem { | ||
18 | system = "x86_64-linux"; | ||
19 | modules = (with nixos-hardware.nixosModules; [ | ||
20 | common-cpu-intel | ||
21 | common-pc-ssd | ||
22 | ]) ++ (with nixos-config-reborn.nixosModules; [ | ||
23 | default | ||
24 | profiles.desktop | ||
25 | |||
26 | usecases.desktop.development | ||
27 | usecases.desktop.graphical.gaming | ||
28 | usecases.desktop.graphical.kodi | ||
29 | usecases.desktop.networkManager | ||
30 | ]) ++ [ | ||
31 | ./hardware-configuration.nix | ||
32 | |||
33 | ./boot.nix | ||
34 | ./host.nix | ||
35 | ./tinc.nix | ||
36 | |||
37 | ({ ... }: { | ||
38 | home-manager.users.minijackson.home.stateVersion = "21.05"; | ||
39 | home-manager.users.root.home.stateVersion = "21.05"; | ||
40 | |||
41 | system.stateVersion = "21.05"; | ||
42 | }) | ||
43 | ]; | ||
44 | }; | ||
45 | |||
46 | }; | ||
47 | } | ||
diff --git a/templates/desktop/host.nix b/templates/desktop/host.nix new file mode 100644 index 0000000..e775db8 --- /dev/null +++ b/templates/desktop/host.nix | |||
@@ -0,0 +1,11 @@ | |||
1 | { config, ... }: | ||
2 | |||
3 | { | ||
4 | networking.hostName = "myHostname"; | ||
5 | |||
6 | theme.colors = with config.theme.colors; { | ||
7 | dominantName = "green"; | ||
8 | dominant = neutralGreen; | ||
9 | dimDominant = fadedGreen; | ||
10 | }; | ||
11 | } | ||
diff --git a/templates/desktop/tinc.nix b/templates/desktop/tinc.nix new file mode 100644 index 0000000..9f4b365 --- /dev/null +++ b/templates/desktop/tinc.nix | |||
@@ -0,0 +1,16 @@ | |||
1 | { config, ... }: | ||
2 | |||
3 | { | ||
4 | topology.mainVpn = { | ||
5 | currentNodeIP = "<VPN IPv6 address>"; | ||
6 | }; | ||
7 | |||
8 | networking.interfaces."${config.topology.mainVpn.interfaceName}" = { | ||
9 | virtual = true; | ||
10 | virtualType = "tun"; | ||
11 | ipv6.addresses = [ { | ||
12 | address = config.topology.mainVpn.currentNodeIP; | ||
13 | prefixLength = 64; | ||
14 | } ]; | ||
15 | }; | ||
16 | } | ||