diff --git a/home/default.nix b/home/default.nix index 7b81a6b..642ded4 100644 --- a/home/default.nix +++ b/home/default.nix @@ -49,6 +49,10 @@ HostName 192.168.1.36 User notoh IdentityFile ~/.ssh/yuki + Host arashi + HostName 192.168.1.211 + User notoh + IdentityFile ~/.ssh/arashi Host hetzner HostName 5.161.181.184 User root diff --git a/hosts/arashi/default.nix b/hosts/arashi/default.nix new file mode 100644 index 0000000..dcb9634 --- /dev/null +++ b/hosts/arashi/default.nix @@ -0,0 +1,24 @@ +{...}: { + imports = [ + ./hardware-configuration.nix + ../../modules + ]; + + boot.loader = { + grub = { + enable = true; + configurationLimit = 5; + device = "/dev/sda"; + useOSProber = false; + }; + }; + + networking = { + hostName = "arashi"; + }; + + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; +} diff --git a/hosts/arashi/hardware-configuration.nix b/hosts/arashi/hardware-configuration.nix new file mode 100644 index 0000000..4746187 --- /dev/null +++ b/hosts/arashi/hardware-configuration.nix @@ -0,0 +1,29 @@ +{ + 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/3fd88f1f-cec3-4737-b9d0-6c8f026c3927"; + fsType = "ext4"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/e9eb4b6a-e9a1-4616-8c82-349d2f38d140";} + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/arashi/home.nix b/hosts/arashi/home.nix new file mode 100644 index 0000000..c7eafac --- /dev/null +++ b/hosts/arashi/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/arashi/services/default.nix b/hosts/arashi/services/default.nix new file mode 100644 index 0000000..08e6a9b --- /dev/null +++ b/hosts/arashi/services/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./traefik.nix + ]; +} diff --git a/hosts/arashi/services/traefik.nix b/hosts/arashi/services/traefik.nix new file mode 100644 index 0000000..f5fd3ce --- /dev/null +++ b/hosts/arashi/services/traefik.nix @@ -0,0 +1,39 @@ +_: { + networking.firewall.allowedTCPPorts = [80 443]; + services.traefik = { + enable = true; + dynamicConfigOptions = { + http = { + routers = { + api = { + rule = "PathPrefix(`/api/`)"; + entryPoints = ["websecure"]; + service = "api@internal"; + }; + }; + services = { + sonarr.loadBalancer.servers = [{url = "http://localhost:8989";}]; + }; + }; + }; + staticConfigOptions = { + log.level = "DEBUG"; + api.dashboard = false; + api.insecure = false; + global = { + checkNewVersion = false; + sendAnonymousUsage = false; + }; + entryPoints = { + websecure = { + address = ":443"; + forwardedHeaders.insecure = true; + }; + web = { + address = ":80"; + forwardedHeaders.insecure = true; + }; + }; + }; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix index 8f5b23f..f83a564 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -117,4 +117,24 @@ in { } ]; }; + arashi = nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = [ + ./arashi + sopsModule + hmModule + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.notoh = { + imports = [ + ./arashi/home.nix + ]; + }; + }; + } + ]; + }; } diff --git a/hosts/deploy.nix b/hosts/deploy.nix index 623bab1..d0f637c 100644 --- a/hosts/deploy.nix +++ b/hosts/deploy.nix @@ -30,5 +30,15 @@ inputs: { sshOpts = ["-t" "-i" "~/.ssh/yuki"]; magicRollback = false; }; + arashi = { + hostname = "arashi"; + profiles.system = { + user = "root"; + path = activate.nixos inputs.self.nixosConfigurations.arashi; + }; + sshUser = "notoh"; + sshOpts = ["-t" "-i" "~/.ssh/arashi"]; + magicRollback = false; + }; }; }