From d7a6e09ce39ea09c9d580a83bf9373203d85ac59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 21 Oct 2024 11:01:10 +0200 Subject: [PATCH] Add ca host --- flake.nix | 16 +++++++ hosts/ca/configuration.nix | 62 +++++++++++++++++++++++++++ hosts/ca/default.nix | 6 +++ services/ns/zones-home-2rjus-net.conf | 3 +- 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 hosts/ca/configuration.nix create mode 100644 hosts/ca/default.nix diff --git a/flake.nix b/flake.nix index 0d2386c..27a8651 100644 --- a/flake.nix +++ b/flake.nix @@ -200,6 +200,22 @@ sops-nix.nixosModules.sops ]; }; + ca = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs self sops-nix; + }; + modules = [ + ( + { config, pkgs, ... }: + { + nixpkgs.overlays = [ overlay-unstable ]; + } + ) + ./hosts/ca + sops-nix.nixosModules.sops + ]; + }; }; }; } diff --git a/hosts/ca/configuration.nix b/hosts/ca/configuration.nix new file mode 100644 index 0000000..a73cbf5 --- /dev/null +++ b/hosts/ca/configuration.nix @@ -0,0 +1,62 @@ +{ + pkgs, + ... +}: + +{ + imports = [ + ../template/hardware-configuration.nix + + ../../system + ]; + + nixpkgs.config.allowUnfree = true; + # Use the systemd-boot EFI boot loader. + boot.loader.grub = { + enable = true; + device = "/dev/sda"; + configurationLimit = 3; + }; + + networking.hostName = "ca"; + networking.domain = "home.2rjus.net"; + networking.useNetworkd = true; + networking.useDHCP = false; + services.resolved.enable = true; + networking.nameservers = [ + "10.69.13.5" + "10.69.13.6" + ]; + + systemd.network.enable = true; + systemd.network.networks."ens18" = { + matchConfig.Name = "ens18"; + address = [ + "10.69.13.12/24" + ]; + routes = [ + { routeConfig.Gateway = "10.69.13.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + time.timeZone = "Europe/Oslo"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + nix.settings.tarball-ttl = 0; + environment.systemPackages = with pkgs; [ + vim + wget + git + ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + system.stateVersion = "23.11"; # Did you read the comment? +} diff --git a/hosts/ca/default.nix b/hosts/ca/default.nix new file mode 100644 index 0000000..0167962 --- /dev/null +++ b/hosts/ca/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./configuration.nix + ]; +} diff --git a/services/ns/zones-home-2rjus-net.conf b/services/ns/zones-home-2rjus-net.conf index 8e1bac8..efc6c3d 100644 --- a/services/ns/zones-home-2rjus-net.conf +++ b/services/ns/zones-home-2rjus-net.conf @@ -1,7 +1,7 @@ $ORIGIN home.2rjus.net. $TTL 1800 @ IN SOA ns1.home.2rjus.net. admin.test.2rjus.net. ( - 2039 ; serial number + 2040 ; serial number 3600 ; refresh 900 ; retry 1209600 ; expire @@ -59,6 +59,7 @@ http-proxy IN A 10.69.13.11 nzbget IN CNAME http-proxy radarr IN CNAME http-proxy sonarr IN CNAME http-proxy +ca IN A 10.69.13.12 ; 22_WLAN unifi-ctrl IN A 10.69.22.5