From c347394acec52827f70570821309ad3a589379a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 2 Jun 2024 21:50:40 +0200 Subject: [PATCH] Add nixos-test1 --- flake.nix | 10 +++++ hosts/nixos-test1/configuration.nix | 55 +++++++++++++++++++++++++++ hosts/nixos-test1/default.nix | 5 +++ services/ns/zones-home-2rjus-net.conf | 3 +- 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 hosts/nixos-test1/configuration.nix create mode 100644 hosts/nixos-test1/default.nix diff --git a/flake.nix b/flake.nix index 89d76aa..569778e 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-23.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; sops-nix.url = "github:Mic92/sops-nix"; + backup-helper.url = "git+https://git.t-juice.club/torjus/backup-helper?ref=master"; }; outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, ... }@inputs: @@ -55,6 +56,15 @@ sops-nix.nixosModules.sops ]; }; + nixos-test1 = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs self sops-nix; }; + modules = [ + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + ./hosts/nixos-test1 + sops-nix.nixosModules.sops + ]; + }; ha1 = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs self sops-nix; }; diff --git a/hosts/nixos-test1/configuration.nix b/hosts/nixos-test1/configuration.nix new file mode 100644 index 0000000..cb7dec5 --- /dev/null +++ b/hosts/nixos-test1/configuration.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ../template/hardware-configuration.nix + + ../../system + ]; + + nixpkgs.config.allowUnfree = true; + # Use the systemd-boot EFI boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + networking.hostName = "nixos-test1"; + 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.10/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/nixos-test1/default.nix b/hosts/nixos-test1/default.nix new file mode 100644 index 0000000..4cd684a --- /dev/null +++ b/hosts/nixos-test1/default.nix @@ -0,0 +1,5 @@ +{ ... }: { + imports = [ + ./configuration.nix + ]; +} diff --git a/services/ns/zones-home-2rjus-net.conf b/services/ns/zones-home-2rjus-net.conf index 7082ba5..e1871ee 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. ( - 2034 ; serial number + 2035 ; serial number 3600 ; refresh 900 ; retry 1209600 ; expire @@ -52,6 +52,7 @@ ns2 IN A 10.69.13.6 ns3 IN A 10.69.13.7 ns4 IN A 10.69.13.8 ha1 IN A 10.69.13.9 +nixos-test1 IN A 10.69.13.10 ; 22_WLAN unifi-ctrl IN A 10.69.22.5