From 150373b1651ba4abacc2e878ff08a79e665d71c6 Mon Sep 17 00:00:00 2001 From: Ciapa Date: Sun, 4 Jun 2023 17:43:32 +0000 Subject: [PATCH] Configure Seedbox for Rene --- flake.nix | 23 +++++++++++++++++ hosts/seedbox/rene/configuration.nix | 25 +++++++++++++++++++ hosts/seedbox/rene/hardware-configuration.nix | 18 +++++++++++++ hosts/seedbox/rene/networking.nix | 11 ++++++++ hosts/seedbox/rene/services/qbittorrent.nix | 15 +++++++++++ hosts/seedbox/rene/users.nix | 11 ++++++++ 6 files changed, 103 insertions(+) create mode 100644 hosts/seedbox/rene/configuration.nix create mode 100644 hosts/seedbox/rene/hardware-configuration.nix create mode 100644 hosts/seedbox/rene/networking.nix create mode 100644 hosts/seedbox/rene/services/qbittorrent.nix create mode 100644 hosts/seedbox/rene/users.nix diff --git a/flake.nix b/flake.nix index 25afb35..f3bb506 100644 --- a/flake.nix +++ b/flake.nix @@ -70,6 +70,16 @@ ]; }; + "rene.elmosco.lewd.wtf" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs self; }; + modules = [ + sops-nix.nixosModules.sops + ./default.nix + ./hosts/seedbox/rene/configuration.nix + ]; + }; + "kinda.sus.lol" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs self; }; @@ -160,6 +170,19 @@ }; }; + "rene.elmosco.lewd.wtf" = { + sshOpts = [ "-p" "22113" "-o" "StrictHostKeyChecking=no" ]; + hostname = "rene.elmosco.lewd.wtf"; + fastConnection = true; + + profiles.system = { + sshUser = "root"; + path = + deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."rene.elmosco.lewd.wtf"; + user = "root"; + }; + }; + "kinda.sus.lol" = { sshOpts = [ "-p" "22201" "-o" "StrictHostKeyChecking=no" ]; hostname = "kinda.sus.lol"; diff --git a/hosts/seedbox/rene/configuration.nix b/hosts/seedbox/rene/configuration.nix new file mode 100644 index 0000000..b0d3f80 --- /dev/null +++ b/hosts/seedbox/rene/configuration.nix @@ -0,0 +1,25 @@ +{ self, config, pkgs, lib, ... }: +let + utils = import ../../../util/include.nix { lib = lib; }; + imports = + (utils.includeDir ./services) ++ + [ + ./hardware-configuration.nix + ./networking.nix + ./users.nix + ]; +in +{ + inherit imports; + + networking.hostName = "rene"; + networking.domain = "elmosco.lewd.wtf"; + + boot.loader.grub = { + enable = true; + efiSupport = false; + devices = [ "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0" ]; + }; + + system.stateVersion = "22.11"; +} diff --git a/hosts/seedbox/rene/hardware-configuration.nix b/hosts/seedbox/rene/hardware-configuration.nix new file mode 100644 index 0000000..2912d05 --- /dev/null +++ b/hosts/seedbox/rene/hardware-configuration.nix @@ -0,0 +1,18 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.kernelModules = [ "kvm-intel" ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-label/home"; + fsType = "ext4"; + }; + + services.qemuGuest.enable = true; +} diff --git a/hosts/seedbox/rene/networking.nix b/hosts/seedbox/rene/networking.nix new file mode 100644 index 0000000..da8db48 --- /dev/null +++ b/hosts/seedbox/rene/networking.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + networking.defaultGateway = "192.168.99.1"; + networking.nameservers = [ "1.1.1.1" ]; + networking.interfaces.ens18.ipv4.addresses = [ + { + address = "192.168.99.113"; + prefixLength = 24; + } + ]; +} diff --git a/hosts/seedbox/rene/services/qbittorrent.nix b/hosts/seedbox/rene/services/qbittorrent.nix new file mode 100644 index 0000000..74924f4 --- /dev/null +++ b/hosts/seedbox/rene/services/qbittorrent.nix @@ -0,0 +1,15 @@ +{ + imports = + [ + ../../../../deployments/seedbox/qbittorrent/default.nix + ]; + + variables.qbittorrent = { + user = "rene"; + group = "rene"; + torrentPort = 61478; + uiPort = 8888; + configDir = "/home/rene"; + openFilesLimit = 8192; + }; +} diff --git a/hosts/seedbox/rene/users.nix b/hosts/seedbox/rene/users.nix new file mode 100644 index 0000000..f27f38f --- /dev/null +++ b/hosts/seedbox/rene/users.nix @@ -0,0 +1,11 @@ +{ + users.groups.rene = {}; + users.users.rene = { + group = "rene"; + isNormalUser = true; + home = "/home/rene"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIERtfY26/h5xl+bzZm2htR4+Wd879DvZRPHsosFaEqIW gaming@DESKTOP-4ACM3JU" + ]; + }; +}