diff --git a/flake.nix b/flake.nix index 85c73a3..de744ee 100644 --- a/flake.nix +++ b/flake.nix @@ -17,5 +17,16 @@ } ]; }; + + nixosConfigurations."microserver.parents.ts.hillion.co.uk" = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + specialArgs = inputs; + modules = [ + ./hosts/microserver.parents.ts.hillion.co.uk/default.nix + { + system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + } + ]; + }; }; } diff --git a/hosts/microserver.parents.ts.hillion.co.uk/default.nix b/hosts/microserver.parents.ts.hillion.co.uk/default.nix new file mode 100644 index 0000000..7403a09 --- /dev/null +++ b/hosts/microserver.parents.ts.hillion.co.uk/default.nix @@ -0,0 +1,27 @@ +{ config, pkgs, lib, ... }: + +{ + system.stateVersion = "22.05"; + + networking.hostName = "microserver"; + networking.domain = "parents.ts.hillion.co.uk"; + + boot.loader.grub.enable = false; + boot.loader.raspberryPi = { + enable = true; + version = 4; + }; + + imports = [ + ./hardware-configuration.nix + ../../modules/common/default.nix + ../../modules/secrets/tailscale/microserver.parents.ts.hillion.co.uk.nix + ]; + + tailscaleAdvertiseRoutes = "10.0.0.0/24"; + + boot.kernel.sysctl = { + "net.ipv4.ip_forward" = true; + }; +} + diff --git a/hosts/microserver.parents.ts.hillion.co.uk/hardware-configuration.nix b/hosts/microserver.parents.ts.hillion.co.uk/hardware-configuration.nix new file mode 100644 index 0000000..5ae9d65 --- /dev/null +++ b/hosts/microserver.parents.ts.hillion.co.uk/hardware-configuration.nix @@ -0,0 +1,34 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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.eth0.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; + # networking.interfaces.vlan2.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/modules/secrets b/modules/secrets index fc65b76..f5dd821 160000 --- a/modules/secrets +++ b/modules/secrets @@ -1 +1 @@ -Subproject commit fc65b7677ec44888a98c66d937dd78ad593b8381 +Subproject commit f5dd82111a16988796e87b9dc741b2c1eb75b179