summaryrefslogtreecommitdiff
path: root/machines
diff options
context:
space:
mode:
Diffstat (limited to 'machines')
-rw-r--r--machines/feneri.nix76
-rw-r--r--machines/iso.nix5
-rw-r--r--machines/natest.nix92
-rw-r--r--machines/radon/default.nix8
-rw-r--r--machines/radon/pxeboot.nix52
-rw-r--r--machines/t1.nix38
6 files changed, 176 insertions, 95 deletions
diff --git a/machines/feneri.nix b/machines/feneri.nix
index 2f3878b..edd0922 100644
--- a/machines/feneri.nix
+++ b/machines/feneri.nix
@@ -1,12 +1,12 @@
-{ flake, modulesPath, ... }:
+{ config, modulesPath, ... }:
{
imports = [
- flake.outputs.nixosModules.disk
- flake.outputs.nixosModules.network
(modulesPath + "/profiles/qemu-guest.nix")
+ (modulesPath + "/virtualisation/qemu-guest-agent.nix")
];
+ services.qemuGuest.enable = true;
nixpkgs.hostPlatform.system = "x86_64-linux";
depot.disk = {
@@ -14,11 +14,77 @@
# device = "/dev/vda";
};
+ xnet = {
+ nginx.enable = true;
+ gitServer = {
+ enable = true;
+ path = "/var/lib/gitsrv";
+ gitweb.enable = true;
+ };
+ };
+
depot.net = {
sshd.enable = true;
};
- services.getty.autologinUser = "root";
+ systemd.network = {
+ enable = true;
+ networks."30-wan" = {
+ matchConfig = {
+ Type = "ether";
+ MACAddress = "8a:33:83:f4:b1:80";
+ };
+ linkConfig.RequiredForOnline = true;
+ networkConfig.Description = "WAN";
+ address = [ "152.53.193.118/22" "2a0a:4cc0:2000:bfbf::1/64" ];
+ routes = [
+ { Gateway = "152.53.192.1"; }
+ { Gateway = "fe80::1"; }
+ ];
+ };
+ };
+
+ security.acme = {
+ acceptTerms = true;
+ defaults.email = "certs@4kb.net";
+ certs."4kb.net" = {
+ dnsProvider = "porkbun";
+ environmentFile = "/var/secrets/porkbun";
+ extraDomainNames = [
+ "*.4kb.net"
+ "*.web.4kb.net"
+ ];
+ group = "nginx";
+ reloadServices = [ "nginx.service" ];
+ };
+ };
+
+ services.hydra = {
+ enable = true;
+ hydraURL = "https://hydra.web.4kb.net";
+ notificationSender = "hydra@localhost";
+ buildMachinesFiles = [];
+ useSubstitutes = true;
+ };
+
+ services.nginx.virtualHosts."hydra.web.4kb.net" = {
+ useACMEHost = "4kb.net";
+ forceSSL = true;
+
+ locations."/".proxyPass = "http://localhost:${toString config.services.hydra.port}";
+ };
+
+ nix.settings.allowed-uris = [
+ "git+https://github.com/NixOS/nixpkgs/"
+ "https://channels.nixos.org/"
+ "https://releases.nixos.org/nixos/"
+ ];
+
+ systemd.services.hydra-notify.enable = false;
- networking.hostName = "feneri";
+ networking = {
+ hostName = "feneri";
+ domain = "4kb.net";
+ useDHCP = false;
+ };
}
diff --git a/machines/iso.nix b/machines/iso.nix
index d3ca992..5550841 100644
--- a/machines/iso.nix
+++ b/machines/iso.nix
@@ -6,7 +6,10 @@
nixpkgs.hostPlatform.system = "x86_64-linux";
nix.settings = {
- experimental-features = [ "nix-command" "flakes" ];
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ ];
};
environment.systemPackages = with pkgs; [
diff --git a/machines/natest.nix b/machines/natest.nix
index fa8f1d5..c4937d6 100644
--- a/machines/natest.nix
+++ b/machines/natest.nix
@@ -1,4 +1,10 @@
-{ config, modulesPath, pkgs, lib, ... }:
+{
+ config,
+ modulesPath,
+ pkgs,
+ lib,
+ ...
+}:
{
imports = [
@@ -19,7 +25,11 @@
fileSystems = {
"/" = {
fsType = "tmpfs";
- options = [ "defaults" "mode=755" "size=2G" ];
+ options = [
+ "defaults"
+ "mode=755"
+ "size=2G"
+ ];
};
"/boot" = {
device = "/dev/disk/by-partlabel/boot";
@@ -43,54 +53,52 @@
let
inherit (pkgs.stdenv.hostPlatform) efiArch;
in
- {
- name = "image";
- partitions.esp = {
- repartConfig = {
- Format = "vfat";
- Label = "boot";
- SizeMinBytes = "256M";
- Type = "esp";
- };
- contents = {
- "/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source =
- "${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi";
+ {
+ name = "image";
+ partitions.esp = {
+ repartConfig = {
+ Format = "vfat";
+ Label = "boot";
+ SizeMinBytes = "256M";
+ Type = "esp";
+ };
+ contents = {
+ "/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source =
+ "${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi";
- # "/EFI/Linux/${config.system.boot.loader.ukiFile}".source =
- # "${config.system.build.uki}/${config.system.boot.loader.ukiFile}";
+ # "/EFI/Linux/${config.system.boot.loader.ukiFile}".source =
+ # "${config.system.build.uki}/${config.system.boot.loader.ukiFile}";
- "/EFI/nixos/${config.system.boot.loader.kernelFile}.efi".source =
- "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}";
+ "/EFI/nixos/${config.system.boot.loader.kernelFile}.efi".source =
+ "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}";
- "/EFI/nixos/${config.system.boot.loader.initrdFile}.efi".source =
- "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";
+ "/EFI/nixos/${config.system.boot.loader.initrdFile}.efi".source =
+ "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";
- "/loader/entries/nixos.conf".source =
- pkgs.writeText "default-entry.conf" ''
- title Coolio
- linux /EFI/nixos/${config.system.boot.loader.kernelFile}.efi
- initrd /EFI/nixos/${config.system.boot.loader.initrdFile}.efi
- options init=${config.system.build.toplevel}/init root=fstab loglevel=4
- '';
+ "/loader/entries/nixos.conf".source = pkgs.writeText "default-entry.conf" ''
+ title Coolio
+ linux /EFI/nixos/${config.system.boot.loader.kernelFile}.efi
+ initrd /EFI/nixos/${config.system.boot.loader.initrdFile}.efi
+ options init=${config.system.build.toplevel}/init root=fstab loglevel=4
+ '';
- "/loader/loader.conf".source =
- pkgs.writeText "loader.conf" ''
- timeout 5
- console-mode keep
- '';
- };
+ "/loader/loader.conf".source = pkgs.writeText "loader.conf" ''
+ timeout 5
+ console-mode keep
+ '';
};
- partitions.nix-store = {
- storePaths = [ config.system.build.toplevel ];
- nixStorePrefix = "/";
- repartConfig = {
- Format = "ext4";
- Label = "nix-store";
- SizeMinBytes = "4G";
- Type = "linux-generic";
- };
+ };
+ partitions.nix-store = {
+ storePaths = [ config.system.build.toplevel ];
+ nixStorePrefix = "/";
+ repartConfig = {
+ Format = "ext4";
+ Label = "nix-store";
+ SizeMinBytes = "4G";
+ Type = "linux-generic";
};
};
+ };
boot.loader.systemd-boot = {
enable = true;
diff --git a/machines/radon/default.nix b/machines/radon/default.nix
index c77db03..f3e4ff0 100644
--- a/machines/radon/default.nix
+++ b/machines/radon/default.nix
@@ -1,4 +1,10 @@
-{ inputs, flake, pkgs, config, ... }:
+{
+ inputs,
+ flake,
+ pkgs,
+ config,
+ ...
+}:
let
interfaces = {
bottom = "enp1s0";
diff --git a/machines/radon/pxeboot.nix b/machines/radon/pxeboot.nix
index 4655990..0b5df13 100644
--- a/machines/radon/pxeboot.nix
+++ b/machines/radon/pxeboot.nix
@@ -3,30 +3,42 @@ let
installer = lib.nixosSystem {
system = "x86_64-linux";
modules = [
- ({ config, pkgs, lib, modulesPath, ... }: {
- imports = [
- (modulesPath + "/installer/netboot/netboot-minimal.nix")
- (modulesPath + "/installer/cd-dvd/channel.nix")
- ];
+ (
+ {
+ config,
+ pkgs,
+ lib,
+ modulesPath,
+ ...
+ }:
+ {
+ imports = [
+ (modulesPath + "/installer/netboot/netboot-minimal.nix")
+ (modulesPath + "/installer/cd-dvd/channel.nix")
+ ];
- services.openssh = {
- enable = true;
- openFirewall = true;
- settings = {
- PasswordAuthentication = false;
- KbdInteractiveAuthentication = false;
+ services.openssh = {
+ enable = true;
+ openFirewall = true;
+ settings = {
+ PasswordAuthentication = false;
+ KbdInteractiveAuthentication = false;
+ };
};
- };
- nix.settings = {
- experimental-features = [ "nix-command" "flakes" ];
- };
+ nix.settings = {
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ ];
+ };
- users.users.root.openssh.authorizedKeys.keys = [
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP7T2uWJFUu8aFZZgQusGKyEMocb2pKbHLDad2eIJus9"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEOw8YEbHsKy38JHp9W1wcxxZgWCDgnabOXccZUN5ddd"
- ];
- })
+ users.users.root.openssh.authorizedKeys.keys = [
+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP7T2uWJFUu8aFZZgQusGKyEMocb2pKbHLDad2eIJus9"
+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEOw8YEbHsKy38JHp9W1wcxxZgWCDgnabOXccZUN5ddd"
+ ];
+ }
+ )
];
};
diff --git a/machines/t1.nix b/machines/t1.nix
index b443da5..3a46494 100644
--- a/machines/t1.nix
+++ b/machines/t1.nix
@@ -1,22 +1,6 @@
-{
- flake,
- pkgs,
- perSystem,
- ...
-}:
+{ pkgs, ... }:
-let
- inherit (import flake.outputs.nixosModules.users { inherit perSystem pkgs; })
- kle
- ;
-in
{
- imports = [
- flake.outputs.nixosModules.disk
- flake.outputs.nixosModules.desktop
- flake.outputs.nixosModules.network
- ];
-
hardware = {
cpu.amd.updateMicrocode = true;
enableRedistributableFirmware = true;
@@ -31,9 +15,18 @@ in
};
};
- nixpkgs.hostPlatform = "x86_64-linux";
+ depot = {
+ desktop.enable = true;
+ users.kle.enable = true;
+ net = {
+ enable = true;
+ v6Token = "::beef";
+ sshd.enable = true;
+ sshd.publish = true;
+ };
+ };
- users.users.kle = kle;
+ nixpkgs.hostPlatform = "x86_64-linux";
xnet = {
disk = {
@@ -42,12 +35,6 @@ in
};
};
- depot.net = {
- v6Token = "::beef";
- sshd.enable = true;
- sshd.publish = true;
- };
-
# depot.disk = {
# enable = true;
# device = "/dev/nvme0n1";
@@ -80,7 +67,6 @@ in
environment.shellAliases.b = "${pkgs.ddcutil}/bin/ddcutil setvcp 10";
boot.kernelModules = [ "i2c-dev" ];
-
environment.systemPackages = with pkgs; [
ddcutil
prismlauncher