From 61227d07df15d88bce35991fa1d3810824886150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Thu, 5 Jun 2025 00:03:53 +0300 Subject: [PATCH] Migrate syncthing to flakes --- hosts/syncthing/configuration.nix | 6 +---- hosts/syncthing/state.nix | 44 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 hosts/syncthing/state.nix diff --git a/hosts/syncthing/configuration.nix b/hosts/syncthing/configuration.nix index f026176..e401e25 100644 --- a/hosts/syncthing/configuration.nix +++ b/hosts/syncthing/configuration.nix @@ -1,16 +1,12 @@ { lib, ... }: { - networking.hostName = "syncthing"; - imports = [ ../../shared/base.nix + ../../shared/hardware/vm.nix ../../shared/users/vili.nix ../../servers/syncthing.nix ]; users.users.vili.hashedPasswordFile = lib.mkForce null; - - # HARDWARE SPECIFIC - services.qemuGuest.enable = true; } diff --git a/hosts/syncthing/state.nix b/hosts/syncthing/state.nix new file mode 100644 index 0000000..eef4aba --- /dev/null +++ b/hosts/syncthing/state.nix @@ -0,0 +1,44 @@ +{ lib, modulesPath, ... }: +{ + system.stateVersion = "22.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/895d2004-3bd2-4bc5-bb46-62f94a0a68e3"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/38AD-EFDC"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + fileSystems."/home/vili" = { + device = "/dev/disk/by-uuid/d08136ed-7950-412c-bcf6-7c6e9f015e47"; + fsType = "ext4"; + }; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}