From 451b9e65f5a15f60a00d673b24a27488a2859395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Thu, 5 Jun 2025 00:29:40 +0300 Subject: [PATCH] Migrate forgejo to flakes --- hosts/forgejo/configuration.nix | 10 +++------ hosts/forgejo/state.nix | 39 +++++++++++++++++++++++++++++++++ servers/forgejo.nix | 5 ++++- 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 hosts/forgejo/state.nix diff --git a/hosts/forgejo/configuration.nix b/hosts/forgejo/configuration.nix index 96013bc..5de4085 100644 --- a/hosts/forgejo/configuration.nix +++ b/hosts/forgejo/configuration.nix @@ -1,12 +1,8 @@ { ... }: { - networking.hostName = "forgejo"; - imports = [ - ../shared/base.nix - ../servers/forgejo.nix + ../../shared/base.nix + ../../shared/hardware/vm.nix + ../../servers/forgejo.nix ]; - - # HARDWARE SPECIFIC - services.qemuGuest.enable = true; } diff --git a/hosts/forgejo/state.nix b/hosts/forgejo/state.nix new file mode 100644 index 0000000..82ab26a --- /dev/null +++ b/hosts/forgejo/state.nix @@ -0,0 +1,39 @@ +{ lib, modulesPath, ... }: +{ + system.stateVersion = "24.11"; + + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ahci" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/6de79a95-d101-4734-8482-1e0869498ce8"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/78B9-CA51"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/servers/forgejo.nix b/servers/forgejo.nix index 32f0e20..07c4ef6 100644 --- a/servers/forgejo.nix +++ b/servers/forgejo.nix @@ -1,6 +1,9 @@ { config, ... }: { - imports = [ ./utils/acme-http-client.nix ]; + imports = [ + ./utils/nginx-https-server.nix + ./utils/acme-http-client.nix + ]; services = { forgejo = {