From 6684dfb43446d9aed4d555fb8555b5d2955459fa Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 19 Sep 2023 14:31:06 -0300 Subject: [PATCH] hosts/zatsune-nixos: init --- flake.nix | 1 + hosts/zatsune-nixos/default.nix | 44 +++++++++++++++++++ .../zatsune-nixos/hardware-configuration.nix | 38 ++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 hosts/zatsune-nixos/default.nix create mode 100644 hosts/zatsune-nixos/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index b41e99d8..8a98f455 100644 --- a/flake.nix +++ b/flake.nix @@ -130,6 +130,7 @@ (mkNixOSConfig { hostname = "miku-nixos"; }) (mkNixOSConfig { hostname = "mirai-vps"; }) (mkNixOSConfig { hostname = "sankyuu-nixos"; }) + (mkNixOSConfig { hostname = "zatsune-nixos"; system = "aarch64-linux"; }) # Home-Manager configs (mkHomeConfig { hostname = "home-linux"; }) diff --git a/hosts/zatsune-nixos/default.nix b/hosts/zatsune-nixos/default.nix new file mode 100644 index 00000000..6afc8c8a --- /dev/null +++ b/hosts/zatsune-nixos/default.nix @@ -0,0 +1,44 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../nixos/home.nix + ../../nixos/minimal.nix + ../../nixos/server + ]; + + nixos.home.imports = [ + ../../home-manager/minimal.nix + ]; + + device.type = "server"; + + nixos = { + server = { + enable = true; + iperf3.enable = true; + ssh.enable = true; + tailscale.enable = true; + duckdns-updater = { + enable = true; + domain = "zatsune-nixos.duckdns.org"; + onCalendar = "daily"; # fixed IP, mostly for health checking + certs.enable = true; + }; + }; + system.smart.enable = false; + }; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "zatsune-nixos"; +} diff --git a/hosts/zatsune-nixos/hardware-configuration.nix b/hosts/zatsune-nixos/hardware-configuration.nix new file mode 100644 index 00000000..9cd416e0 --- /dev/null +++ b/hosts/zatsune-nixos/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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 = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2359ed05-7d97-49d8-91a6-434641449b95"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5BED-71B7"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/280b8949-4eb5-436e-8c5f-82c7602e89b4"; } + ]; + + # 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.enp0s6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +}