From 883a0ae098861cb94499850193b5aa4ec443f6c4 Mon Sep 17 00:00:00 2001 From: notohh Date: Fri, 23 Jun 2023 09:25:35 -0400 Subject: [PATCH] hosts: init sora --- hosts/default.nix | 19 +++++++++++ hosts/deploy.nix | 10 ++++++ hosts/sora/configuration.nix | 21 ++++++++++++ hosts/sora/hardware-configuration.nix | 10 ++++++ hosts/sora/home.nix | 14 ++++++++ hosts/sora/networking.nix | 49 +++++++++++++++++++++++++++ 6 files changed, 123 insertions(+) create mode 100644 hosts/sora/configuration.nix create mode 100644 hosts/sora/hardware-configuration.nix create mode 100644 hosts/sora/home.nix create mode 100644 hosts/sora/networking.nix diff --git a/hosts/default.nix b/hosts/default.nix index f83a564..af3d47e 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -137,4 +137,23 @@ in { } ]; }; + sora = nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = [ + ./arashi + hmModule + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.notoh = { + imports = [ + ./sora/home.nix + ]; + }; + }; + } + ]; + }; } diff --git a/hosts/deploy.nix b/hosts/deploy.nix index d0f637c..4a7a35b 100644 --- a/hosts/deploy.nix +++ b/hosts/deploy.nix @@ -40,5 +40,15 @@ inputs: { sshOpts = ["-t" "-i" "~/.ssh/arashi"]; magicRollback = false; }; + sora = { + hostname = "sora"; + profiles.system = { + user = "root"; + path = activate.nixos inputs.self.nixosConfigurations.sora; + }; + sshUser = "notoh"; + sshOpts = ["-t" "-i" "~/.ssh/kumo"]; + magicRollback = false; + }; }; } diff --git a/hosts/sora/configuration.nix b/hosts/sora/configuration.nix new file mode 100644 index 0000000..11a12fb --- /dev/null +++ b/hosts/sora/configuration.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + imports = [ + ./hardware-configuration.nix + ./networking.nix + ]; + + environment.systemPackages = with pkgs; [ + git + croc + helix + ]; + + boot.cleanTmpDir = true; + zramSwap.enable = true; + networking.hostName = "sora"; + networking.domain = ""; + services.openssh.enable = true; + users.users.notoh.openssh.authorizedKeys.keys = [ + ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDqTg12niJ4nkm7jv9bcfiALJ7YA8LhmSpaq035fY/cU1vTrrfJjnilSgIE69IoC+gBxKWly01S9f4RpF0n7BoYx+GopFP99K8D8koaPL5dku7PCRrWBbu/5ZrMhjNrHvQkse36mTcNGgouorhShuJ9LpWF2oBqkKjzLWKnjU3NRJwCUJFizR3thfc2Hri61vxQGt1WQJrqDPZpUnLL6WAeJK/aHOhMOMLbfEPrtmmBse+xtwFFV+jxEY4MitvgnweQ5i7yKqtrldKQ0o03AO3NRikeQbRmEm6zlHTQpd6EOktTKOJKZYtOZ1ASHPxp8B10B0MBVpYWrvCmb+vyrWszYKeCyuu6a57gfoai+AHNEyxrtT2diJANia4WgW8kHGxuVAXFpKX/tr5ZvGXq8uWlQUgrAHphlaEF+x97aqi8GuZTqq5Y9xH4iwm6V8EK3VvLWTwyQauCq7IypxlNsyj8hUo9TtYQaIHHt1kNFahXLKnIuqmdVq6TGYt9AuK5Zek='' + ]; +} diff --git a/hosts/sora/hardware-configuration.nix b/hosts/sora/hardware-configuration.nix new file mode 100644 index 0000000..329ed8a --- /dev/null +++ b/hosts/sora/hardware-configuration.nix @@ -0,0 +1,10 @@ +{modulesPath, ...}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"]; + boot.initrd.kernelModules = ["nvme"]; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; +} diff --git a/hosts/sora/home.nix b/hosts/sora/home.nix new file mode 100644 index 0000000..c7eafac --- /dev/null +++ b/hosts/sora/home.nix @@ -0,0 +1,14 @@ +{...}: { + imports = [ + ../../home + ]; + + systemd.user.startServices = "sd-switch"; + programs.home-manager.enable = true; + + home = { + username = "notoh"; + homeDirectory = "/home/notoh"; + stateVersion = "23.05"; + }; +} diff --git a/hosts/sora/networking.nix b/hosts/sora/networking.nix new file mode 100644 index 0000000..4f912b3 --- /dev/null +++ b/hosts/sora/networking.nix @@ -0,0 +1,49 @@ +{lib, ...}: { + networking = { + nameservers = [ + "8.8.8.8" + ]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { + address = "5.161.181.184"; + prefixLength = 32; + } + ]; + ipv6.addresses = [ + { + address = "2a01:4ff:f0:337a::1"; + prefixLength = 64; + } + { + address = "fe80::9400:2ff:fe4e:83c1"; + prefixLength = 64; + } + ]; + ipv4.routes = [ + { + address = "172.31.1.1"; + prefixLength = 32; + } + ]; + ipv6.routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="96:00:02:4e:83:c1", NAME="eth0" + ''; +}