From d12c6ef0f33607d13905b01285a22867bccdf5d5 Mon Sep 17 00:00:00 2001 From: iofq Date: Mon, 15 Jan 2024 00:06:28 -0600 Subject: [PATCH] init contabo --- home-manager/t14/home.nix | 12 ++++++-- nixos/contabo/configuration.nix | 38 ++++++++++++++++++++++++ nixos/contabo/hardware-configuration.nix | 10 +++++++ nixos/default.nix | 13 ++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 nixos/contabo/configuration.nix create mode 100755 nixos/contabo/hardware-configuration.nix diff --git a/home-manager/t14/home.nix b/home-manager/t14/home.nix index 9cd58ac..379a75a 100755 --- a/home-manager/t14/home.nix +++ b/home-manager/t14/home.nix @@ -33,10 +33,18 @@ programs.ssh = { enable = true; matchBlocks = { - "10110110.xyz" = { - hostname = "10110110.xyz"; + "racknerd.10110110.xyz" = { + hostname = "contabo.10110110.xyz"; identityFile = "/home/e/.ssh/racknerd"; }; + "contabo.10110110.xyz" = { + hostname = "contabo.10110110.xyz"; + identityFile = "/home/e/.ssh/id_ed25519"; + }; + "consensus" = { + hostname = "consensus"; + identityFile = "/home/e/.ssh/id_ed25519"; + }; }; }; fonts.fontconfig.enable = true; diff --git a/nixos/contabo/configuration.nix b/nixos/contabo/configuration.nix new file mode 100644 index 0000000..039160a --- /dev/null +++ b/nixos/contabo/configuration.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: { + imports = [ + ./hardware-configuration.nix + ]; + environment.systemPackages = with pkgs; [ + nfs-utils + ]; + boot.tmp.cleanOnBoot = true; + zramSwap.enable = false; + networking.hostName = "eef"; + networking.domain = ""; + networking.firewall = { + enable = true; + allowedTCPPorts = [22]; + allowedUDPPorts = []; + logRefusedConnections = true; + }; + services.openssh.enable = true; + users.users = { + root = { + openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHM4Zr0PFN7QdOG2aJ+nuzRCK6caulrpY6bphA1Ppl8Y e@t14'']; + }; + e = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + home = "/home/e"; + packages = with pkgs; [ + vim + htop + tree + ]; + openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHM4Zr0PFN7QdOG2aJ+nuzRCK6caulrpY6bphA1Ppl8Y e@t14'']; + }; + }; + security.sudo.wheelNeedsPassword = false; + nix.settings.trusted-users = ["e"]; + system.stateVersion = "22.11"; +} diff --git a/nixos/contabo/hardware-configuration.nix b/nixos/contabo/hardware-configuration.nix new file mode 100755 index 0000000..b8fa980 --- /dev/null +++ b/nixos/contabo/hardware-configuration.nix @@ -0,0 +1,10 @@ +{ lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; }; + +} diff --git a/nixos/default.nix b/nixos/default.nix index b0396b5..d54dae2 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -27,4 +27,17 @@ ./racknerd/configuration.nix ]; }; + contabo = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs system pkgs; + host = { + hostName = "eef"; + username = attrs.username; + }; + }; + modules = [ + ./configuration.nix + ./contabo/configuration.nix + ]; + }; }