From 9e5b7220977588d76b751da104cf324d9b592bdf Mon Sep 17 00:00:00 2001 From: notohh Date: Sat, 3 Jun 2023 22:53:57 -0400 Subject: [PATCH] hosts: init yuki --- home/default.nix | 8 ++++++ hosts/default.nix | 20 +++++++++++++++ hosts/deploy.nix | 10 ++++++++ hosts/tsuki/default.nix | 1 - hosts/yuki/default.nix | 30 ++++++++++++++++++++++ hosts/yuki/hardware-configuration.nix | 36 +++++++++++++++++++++++++++ hosts/yuki/home.nix | 19 ++++++++++++++ 7 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 hosts/yuki/default.nix create mode 100644 hosts/yuki/hardware-configuration.nix create mode 100644 hosts/yuki/home.nix diff --git a/home/default.nix b/home/default.nix index 0600d00..9a2ec7f 100644 --- a/home/default.nix +++ b/home/default.nix @@ -42,6 +42,14 @@ HostName 192.168.1.54 User notoh IdentityFile ~/.ssh/kariru + Host yuki + HostName 192.168.1.36 + User notoh + IdentityFile ~/.ssh/yuki + Host hetzner + HostName 5.161.181.184 + User root + IdentityFile ~/.ssh/kumo Host pihole Hostname 192.168.1.221 User root diff --git a/hosts/default.nix b/hosts/default.nix index 492c0e6..a26789c 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -71,4 +71,24 @@ in { } ]; }; + yuki = nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = [ + sopsModule + diskoModule + hmModule + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.notoh = { + imports = [ + ./yuki/home.nix + ]; + }; + }; + } + ]; + }; } diff --git a/hosts/deploy.nix b/hosts/deploy.nix index cb10171..623bab1 100644 --- a/hosts/deploy.nix +++ b/hosts/deploy.nix @@ -20,5 +20,15 @@ inputs: { sshOpts = ["-t" "-i" "~/.ssh/kariru"]; magicRollback = false; }; + yuki = { + hostname = "yuki"; + profiles.system = { + user = "root"; + path = activate.nixos inputs.self.nixosConfigurations.yuki; + }; + sshUser = "notoh"; + sshOpts = ["-t" "-i" "~/.ssh/yuki"]; + magicRollback = false; + }; }; } diff --git a/hosts/tsuki/default.nix b/hosts/tsuki/default.nix index 4ffa2d8..ef9e5e1 100755 --- a/hosts/tsuki/default.nix +++ b/hosts/tsuki/default.nix @@ -11,7 +11,6 @@ ../../modules/fonts.nix ]; - # bootloader boot.loader = { systemd-boot = { enable = true; diff --git a/hosts/yuki/default.nix b/hosts/yuki/default.nix new file mode 100644 index 0000000..5a141c5 --- /dev/null +++ b/hosts/yuki/default.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + ... +}: { + imports = [ + ./hardware-configuration.nix + ../../modules + ]; + boot.loader = { + systemd-boot = { + enable = true; + configurationLimit = 8; + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; + + networking.hostName = "yuki"; + + networking.networkmanager.enable = true; + + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + services.openssh.enable = true; +} diff --git a/hosts/yuki/hardware-configuration.nix b/hosts/yuki/hardware-configuration.nix new file mode 100644 index 0000000..4c9dd66 --- /dev/null +++ b/hosts/yuki/hardware-configuration.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/56f5b5b9-9ab5-4c05-be80-2e34405bfbd9"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/4E08-C711"; + fsType = "vfat"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/34a9e234-35da-4140-b231-2bb983a5204b";} + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/yuki/home.nix b/hosts/yuki/home.nix new file mode 100644 index 0000000..2c61281 --- /dev/null +++ b/hosts/yuki/home.nix @@ -0,0 +1,19 @@ +{ + config, + pkgs, + lib, + ... +}: { + imports = [ + ../../home + ]; + + systemd.user.startServices = "sd-switch"; + programs.home-manager.enable = true; + + home = lib.mkForce { + username = "notoh"; + homeDirectory = "/home/notoh"; + stateVersion = "23.05"; + }; +}