From 9b95fe9b7345af2cd532759a1c1ef7bbaf3c492d Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Tue, 28 Dec 2021 15:09:51 +0000 Subject: [PATCH] add hetzner-vm and remove pinetab --- hosts/default.nix | 14 ++++-------- hosts/hetzner-vm/hetzner-vm.nix | 39 +++++++++++++++++++++++++++++++++ hosts/pinetab/pinetab.nix | 25 --------------------- outputs.nix | 16 ++++++++------ 4 files changed, 52 insertions(+), 42 deletions(-) create mode 100644 hosts/hetzner-vm/hetzner-vm.nix delete mode 100644 hosts/pinetab/pinetab.nix diff --git a/hosts/default.nix b/hosts/default.nix index 6e40502..e7afccf 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,4 @@ -{ self, home-manager, mobile-nixos, nixpkgs, tree, ... }@inputs: +{ self, home-manager, nixpkgs, tree, ... }@inputs: let defaultModules = [ home-manager.nixosModules.home-manager tree.impure.profiles.base ]; @@ -13,16 +13,10 @@ in { system = "x86_64-linux"; modules = defaultModules ++ [ ./lappy/lappy.nix ]; }; - pinetab_modules = defaultModules ++ [ ./pinetab/pinetab.nix ]; - pinetab_modules_inc_device = self.pinetab_modules ++ [ - (import "${mobile-nixos}/lib/configuration.nix" { - device = "pine64-pinetab"; - }) - ]; - pinetab = nixpkgs.lib.nixosSystem { + hetzner-vm = nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs; - system = "aarch64-linux"; - modules = self.pinetab_modules_inc_device; + system = "x86_64-linux"; + modules = defaultModules ++ [ ./hetzner-vm/hetzner-vm.nix ]; }; } diff --git a/hosts/hetzner-vm/hetzner-vm.nix b/hosts/hetzner-vm/hetzner-vm.nix new file mode 100644 index 0000000..56c80bb --- /dev/null +++ b/hosts/hetzner-vm/hetzner-vm.nix @@ -0,0 +1,39 @@ +{ modulesPath, tree, config, pkgs, lib, ... }: + +{ + imports = with tree; [ + users.chaoticryptidz + profiles.tailscale + profiles.sshd + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + + home-manager.users.root = { imports = with tree; [ home.base ]; }; + home-manager.users.chaoticryptidz = { + imports = with tree; [ + home.base + home.dev.archives + home.dev.editors + home.dev.git + home.dev.info + home.dev.network + home.dev.vcs + ]; + }; + + networking.hostName = "hetzner-vm"; + time.timeZone = "Europe/London"; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL4L1eBZzYXZNGBucTn/eOFp48el9JPiYt9iXQDpBSg/ chaoticryptidz@owo.monster" + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; + + system.stateVersion = "21.11"; +} + diff --git a/hosts/pinetab/pinetab.nix b/hosts/pinetab/pinetab.nix deleted file mode 100644 index d488cad..0000000 --- a/hosts/pinetab/pinetab.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ tree, config, pkgs, inputs, lib, ... }: - -{ - imports = with tree; - [ - users.chaoticryptidz - profiles.network_manager - profiles.dnscrypt - profiles.sshd - ]; - - users.users.root.password = "nixos"; - services.openssh.permitRootLogin = lib.mkForce "yes"; - - home-manager.users.root = { imports = with tree; [ home.base ]; }; - home-manager.users.chaoticryptidz = { - imports = with tree; [ home.base home.dev home.network_manager ]; - }; - - networking.hostName = "pinetab"; - time.timeZone = "Europe/London"; - - system.stateVersion = "21.11"; -} - diff --git a/outputs.nix b/outputs.nix index bb16c15..192413b 100644 --- a/outputs.nix +++ b/outputs.nix @@ -17,13 +17,6 @@ in { #legacyPackages.tree = tree; nixosConfigurations = import ./hosts ({ inherit tree; } // inputs); - pinetab-disk-image = - (import "${mobile-nixos}/lib/eval-with-configuration.nix" { - configuration = [tree.impure.hosts.pinetab]; - device = "pine64-pinetab"; - pkgs = nixpkgs.legacyPackages.aarch64-linux; - }).outputs.disk-image; - deploy.nodes.lappy = { hostname = "localhost"; profiles.system = { @@ -32,4 +25,13 @@ in { self.nixosConfigurations.lappy; }; }; + deploy.nodes.hetzner-vm = { + hostname = "65.21.182.73"; + username = "root" + profiles.system = { + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos + self.nixosConfigurations.hetzner-vm; + }; + }; }