From a6980a1b742173591eca7a94741960aaed14209a Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 30 May 2023 22:22:21 +1000 Subject: [PATCH] helix: new deployment --- hosts/helix/default.nix | 27 +++++++++++++++++++++++--- hosts/helix/hardware-configuration.nix | 20 +++++++++++-------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/hosts/helix/default.nix b/hosts/helix/default.nix index 3bf9e7ae..c8077e18 100644 --- a/hosts/helix/default.nix +++ b/hosts/helix/default.nix @@ -1,10 +1,10 @@ -{ self, profiles, suites, ... }: +{ self, profiles, suites, pkgs, ... }: { imports = [ ./configuration.nix ../profiles/core ../profiles/server - ../profiles/metrics + # ../profiles/metrics ../profiles/gitea ../profiles/woodpecker-server ../profiles/rss-bridge @@ -19,10 +19,31 @@ extraGroups = [ "wheel" ]; }; + age.secrets.helix-wg.file = "${self}/secrets/helix-wg.age"; + age.secrets.helix-wg.owner = "anish"; mossnet.wg = { enable = true; ips = [ "10.0.69.5/24" ]; - privateKeyFile = "/home/anish/wg/wg-priv"; + privateKeyFile = "/run/agenix/helix-wg"; }; + services.postgresql.package = pkgs.postgresql_11; + services.postgresqlBackup = { + # TODO needs working wireguard to box + enable = false; + databases = [ "gitea" "freshrss" "woodpecker" ]; + location = "/mnt/two/postgres"; + }; + + mossnet.backup = { + enable = true; + name = "helix"; + paths = [ + "/var/lib/gitea" + "/var/lib/freshrss" + "/var/lib/woodpecker" + "/var/lib/microbin" + ]; + + }; } diff --git a/hosts/helix/hardware-configuration.nix b/hosts/helix/hardware-configuration.nix index c10b3c90..42c0f365 100644 --- a/hosts/helix/hardware-configuration.nix +++ b/hosts/helix/hardware-configuration.nix @@ -5,23 +5,27 @@ { imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") + [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "floppy" "sr_mod" "virtio_blk" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { - device = "/dev/disk/by-uuid/3b8b2c4b-835e-4822-8ac8-0effdc8270d6"; - fsType = "btrfs"; + { device = "/dev/disk/by-uuid/7c560634-d545-41cc-b375-42ce3037fd73"; + fsType = "ext4"; }; swapDevices = [ ]; - nix.settings.max-jobs = lib.mkDefault 1; - nixpkgs.hostPlatform = "x86_64-linux"; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens3.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }