diff --git a/copy_pasta.zsh b/copy_pasta.zsh index 0f2792e..9fe02d0 100644 --- a/copy_pasta.zsh +++ b/copy_pasta.zsh @@ -1,3 +1,4 @@ +#!/usr/bin/env zsh export NIX_CONFIG="experimental-features = nix-command flakes" @@ -5,13 +6,23 @@ echo "=== nix --version ===" nix --version echo -echo "=== nix flake show ===" -nix flake show . -echo +configs=( + "nixos-local-wireguard-server" + "nixos-blank" + "nixos-songsheet" + "nixos-database" + "nixos-forgejo" + "nixos-teamspeak" + "nixos-traefik" + "nixos-build-machine" +) -echo "=== nix eval (raw toplevel) ===" -nix eval --raw .#nixosConfigurations.nixos-local-wireguard-server.config.system.build.toplevel || true -echo +if [[ -n "$1" ]]; then + configs=("$1") +fi -echo "=== nix build --dry-run ===" -nix build --dry-run .#nixosConfigurations.nixos-local-wireguard-server.config.system.build.toplevel || true \ No newline at end of file +for config in "${configs[@]}"; do + echo "=== Dry-run: $config ===" + nix build --dry-run ".#nixosConfigurations.${config}.config.system.build.toplevel" || true + echo +done diff --git a/nix-system-configs/modules/secrets-config/sops-build-machine.nix b/nix-system-configs/modules/secrets-config/sops-build-machine.nix index 8dee242..d66aeda 100644 --- a/nix-system-configs/modules/secrets-config/sops-build-machine.nix +++ b/nix-system-configs/modules/secrets-config/sops-build-machine.nix @@ -28,7 +28,7 @@ # Export individual WireGuard keys from the SOPS YAML as text secrets so they # are available both as strings and as files (.path) - sops.secrets.":" = { + sops.secrets."runner_token" = { format = "yaml"; sopsFile = ../../secrets/build_machine/secrets.yaml; owner = "root"; diff --git a/nix-system-configs/modules/system/build_machine.nix b/nix-system-configs/modules/system/build_machine.nix index 3c5f069..2bc2328 100644 --- a/nix-system-configs/modules/system/build_machine.nix +++ b/nix-system-configs/modules/system/build_machine.nix @@ -42,21 +42,6 @@ local.userDescription = "NixOS Build Machine"; local.address = "10.1.1.3"; - # Add Lix instead of Nix - nixpkgs.overlays = [ - (final: prev: { - inherit - (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena - ; - }) - ]; - - nix.package = pkgs.lixPackageSets.stable.lix; - # Enable Rsync services.rsync.enable = true; @@ -124,35 +109,6 @@ # Enable Tailscale services.tailscale.enable = true; - networking.hostName = local.hostname; # Define your hostname. - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "Europe/Copenhagen"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_AU.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_AU.UTF-8"; - LC_IDENTIFICATION = "en_AU.UTF-8"; - LC_MEASUREMENT = "en_AU.UTF-8"; - LC_MONETARY = "en_AU.UTF-8"; - LC_NAME = "en_AU.UTF-8"; - LC_NUMERIC = "en_AU.UTF-8"; - LC_PAPER = "en_AU.UTF-8"; - LC_TELEPHONE = "en_AU.UTF-8"; - LC_TIME = "en_AU.UTF-8"; - }; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "au"; - variant = ""; - }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.nixosbm = { isNormalUser = true; @@ -168,9 +124,6 @@ home = "/home/nixremote"; createHome = true; - # Lock the user account (no login shell) - shell = pkgs.shadow; - # SSH key for remote builds openssh.authorizedKeys.keys = [ # Add the public key from your client machines here @@ -203,10 +156,18 @@ # Enable the OpenSSH daemon. services.openssh.enable = true; +# Enable Podman for Gitea Actions Runner + virtualisation.podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + + # Network configuration for the build machine on the Proxmox bridge networking.interfaces.ens18.ipv4.addresses = [ { - address = local.address; + address = config.local.address; #dns = "10.1.1.2"; prefixLength = 24; } diff --git a/nix-system-configs/modules/system/database.nix b/nix-system-configs/modules/system/database.nix index 7255081..772f117 100644 --- a/nix-system-configs/modules/system/database.nix +++ b/nix-system-configs/modules/system/database.nix @@ -35,8 +35,8 @@ ../lix-default.nix ../secrets-config/sops-database.nix ../system_scripts/gcloud_backup.nix - ./hardware-configuration.nix - ]; + ## TODO: Make this more elegant and less risky for unexpected errors happening. +] ++ lib.optional (builtins.pathExists ./hardware-configuration.nix) ./hardware-configuration.nix; config = { local.hostname = "nixosdd";