From 69bbbd51627bf0d4e6a03a51ae79f30f416d81be Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 5 Dec 2023 22:01:33 +0900 Subject: [PATCH] Configuring linode and xrdp --- nixos/hosts/framework-server/rdesktop.nix | 2 +- nixos/hosts/framework-server/wireguard.nix | 2 +- nixos/hosts/osaka-linode-01/default.nix | 21 ++++++++---- nixos/hosts/osaka-linode-01/disks.nix | 38 ---------------------- 4 files changed, 17 insertions(+), 46 deletions(-) delete mode 100644 nixos/hosts/osaka-linode-01/disks.nix diff --git a/nixos/hosts/framework-server/rdesktop.nix b/nixos/hosts/framework-server/rdesktop.nix index f57a38d7..284296fd 100644 --- a/nixos/hosts/framework-server/rdesktop.nix +++ b/nixos/hosts/framework-server/rdesktop.nix @@ -9,7 +9,7 @@ enable = true; defaultWindowManager = "${pkgs.xfce.xfce4-session}/bin/startxfce4"; openFirewall = true; - # confDir = "/etc/xrdp/conf"; + confDir = "/etc/xrdp/conf"; }; environment.systemPackages = [ diff --git a/nixos/hosts/framework-server/wireguard.nix b/nixos/hosts/framework-server/wireguard.nix index 9fb85e8f..46ab0cf1 100644 --- a/nixos/hosts/framework-server/wireguard.nix +++ b/nixos/hosts/framework-server/wireguard.nix @@ -21,7 +21,7 @@ privateKeyFile = "/run/secrets/wireguard_keys/framework-server"; # Testing peers = [ - { # osaka-vultr-01 + { # osaka-linode-01 publicKey = "yPZ3EmmIqCkReXf1DRTxzVaKQ2k+ifGmYJHji5nnMmE="; presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key"; persistentKeepalive = 5; diff --git a/nixos/hosts/osaka-linode-01/default.nix b/nixos/hosts/osaka-linode-01/default.nix index 157f1e77..a86eb4f9 100644 --- a/nixos/hosts/osaka-linode-01/default.nix +++ b/nixos/hosts/osaka-linode-01/default.nix @@ -1,19 +1,28 @@ { config, lib, pkgs, modulesPath, desktop, username, ... }: { imports = [ + (modulesPath + "/profiles/qemu-guest.nix") ./firewall.nix ./wireguard.nix ]; + + boot.loader.grub = true; + + boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + swapDevices = [ { device = "/dev/disk/by-label/linode-swap"; } ]; # Distributed Builds nix.distributedBuilds = true; nixpkgs.config.allowUnfree = false; - boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "virtio_pci" "virtio_blk" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "iptable_nat" "iptable_filter" "xt_nat" ]; - boot.extraModulePackages = [ ]; - virtualisation.hypervGuest.enable = true; - networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; time.timeZone = "Asia/Tokyo"; diff --git a/nixos/hosts/osaka-linode-01/disks.nix b/nixos/hosts/osaka-linode-01/disks.nix deleted file mode 100644 index ebdd2834..00000000 --- a/nixos/hosts/osaka-linode-01/disks.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - boot.loader.grub.enableCryptodisk = true; - disko.devices.disk.vda = { - device = "/dev/vda"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; - }; # partitions.boot - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; # ESP - luks = { - size = "100%"; - content = { - type = "luks"; - name = "crypted"; - extraOpenArgs = [ "--allow-discards" ]; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; # content - }; # content - }; # luks.partitions - }; # partitions - }; # content - }; # disko.devices.disk.vda -} \ No newline at end of file