From 78b98fa927a1a2bfe6f4bdc87a9273b232ddaf73 Mon Sep 17 00:00:00 2001 From: notohh Date: Wed, 17 May 2023 10:13:01 -0400 Subject: [PATCH] feat: init kariru --- hosts/default.nix | 21 ++++++++++++ hosts/deploy.nix | 10 ++++++ hosts/kariru/default.nix | 44 +++++++++++++++++++++++++ hosts/kariru/hardware-configuration.nix | 37 +++++++++++++++++++++ hosts/kariru/home.nix | 18 ++++++++++ hosts/sakura/default.nix | 4 --- hosts/sakura/hardware-configuration.nix | 4 +++ hosts/sutakku/default.nix | 5 +-- 8 files changed, 135 insertions(+), 8 deletions(-) create mode 100644 hosts/kariru/default.nix create mode 100644 hosts/kariru/hardware-configuration.nix create mode 100644 hosts/kariru/home.nix diff --git a/hosts/default.nix b/hosts/default.nix index a8c86b7..e089abd 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -71,4 +71,25 @@ in { } ]; }; + kariru = nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = [ + ./kariru + sopsModule + diskoModule + hmModule + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.notoh = { + imports = [ + ./kariru/home.nix + ]; + }; + }; + } + ]; + }; } diff --git a/hosts/deploy.nix b/hosts/deploy.nix index ec529b2..de0bfab 100644 --- a/hosts/deploy.nix +++ b/hosts/deploy.nix @@ -20,5 +20,15 @@ inputs: { sshOpts = ["-t" "-i" "~/.ssh/sakura"]; magicRollback = false; }; + kariru = { + hostname = "kariru"; + profiles.system = { + user = "root"; + path = activate.nixos inputs.self.nixosConfigurations.kariru; + }; + sshUser = "notoh"; + sshOpts = ["-t" "-i" "~/.ssh/kariru"]; + magicRollback = false; + }; }; } diff --git a/hosts/kariru/default.nix b/hosts/kariru/default.nix new file mode 100644 index 0000000..60c333c --- /dev/null +++ b/hosts/kariru/default.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + ... +}: { + imports = [ + ./hardware-configuration.nix + ../../modules + ../../modules/services/arr + ]; + + boot.loader = { + grub = { + enable = true; + configurationLimit = 3; + device = "/dev/sda"; + useOSProber = false; + }; + }; + + networking = { + hostName = "kariru"; + }; + + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + users = { + defaultUserShell = pkgs.nushell; + users.notoh = { + isNormalUser = true; + description = "notoh"; + extraGroups = ["networkmanager" "wheel" "docker"]; + }; + }; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryFlavor = "curses"; + }; +} diff --git a/hosts/kariru/hardware-configuration.nix b/hosts/kariru/hardware-configuration.nix new file mode 100644 index 0000000..33eb6a8 --- /dev/null +++ b/hosts/kariru/hardware-configuration.nix @@ -0,0 +1,37 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/f5a0738c-d027-4ffb-82ec-9901ca6b310b"; + fsType = "ext4"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f28bad28-ae14-4aa7-85c5-47abe46bae56";} + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/kariru/home.nix b/hosts/kariru/home.nix new file mode 100644 index 0000000..c8a9536 --- /dev/null +++ b/hosts/kariru/home.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + ... +}: { + 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/sakura/default.nix b/hosts/sakura/default.nix index 0be0dc2..3256d88 100644 --- a/hosts/sakura/default.nix +++ b/hosts/sakura/default.nix @@ -36,10 +36,6 @@ }; }; - environment.systemPackages = with pkgs; [ - wget - ]; - programs.gnupg.agent = { enable = true; enableSSHSupport = true; diff --git a/hosts/sakura/hardware-configuration.nix b/hosts/sakura/hardware-configuration.nix index 760eacb..beaa7dc 100644 --- a/hosts/sakura/hardware-configuration.nix +++ b/hosts/sakura/hardware-configuration.nix @@ -22,6 +22,10 @@ device = "192.168.1.71:/volume1/stash"; fsType = "nfs"; }; + fileSystems."/media" = { + device = "192.168.1.71:/volume1/media"; + fsType = "nfs"; + }; swapDevices = [ {device = "/dev/disk/by-uuid/c5afba13-f1af-4e7f-994b-f565c52d92fc";} ]; diff --git a/hosts/sutakku/default.nix b/hosts/sutakku/default.nix index ccf7444..4c7731a 100644 --- a/hosts/sutakku/default.nix +++ b/hosts/sutakku/default.nix @@ -6,6 +6,7 @@ imports = [ ./hardware-configuration.nix ../../modules + ../../modules/services/arr ]; boot.loader = { @@ -35,10 +36,6 @@ }; }; - environment.systemPackages = with pkgs; [ - wget - ]; - programs.gnupg.agent = { enable = true; enableSSHSupport = true;