From 4ec8b69cdeb3380f77485fcd038d79dde483e506 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Wed, 19 Mar 2025 17:14:09 +0100 Subject: [PATCH] morn: Init new host --- flake.nix | 3 +++ hosts/morn/configuration.nix | 28 ++++++++++++++++++++ hosts/morn/hardware-configuration.nix | 37 +++++++++++++++++++++++++++ hosts/morn/home.nix | 12 +++++++++ 4 files changed, 80 insertions(+) create mode 100644 hosts/morn/configuration.nix create mode 100644 hosts/morn/hardware-configuration.nix create mode 100644 hosts/morn/home.nix diff --git a/flake.nix b/flake.nix index bad4226..de6acb5 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,9 @@ # Web host malcolm = normalSys "malcolm" { }; + # General application server + morn = normalSys "morn" { }; + # Home desktop sisko = normalSys "sisko" { }; diff --git a/hosts/morn/configuration.nix b/hosts/morn/configuration.nix new file mode 100644 index 0000000..cea0147 --- /dev/null +++ b/hosts/morn/configuration.nix @@ -0,0 +1,28 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ../../base.nix + ../../common/metrics-exporters.nix + ./hardware-configuration.nix + ]; + + networking = { + hostName = "morn"; + defaultGateway = "192.168.10.1"; + interfaces.ens18.ipv4 = { + addresses = [ + { address = "192.168.10.203"; prefixLength = 24; } + ]; + }; + hostId = "89b7722d"; + }; + + sops.defaultSopsFile = ../../secrets/burnham/burnham.yaml; + + environment.variables = { EDITOR = "vim"; }; + + system.stateVersion = "24.11"; +} + diff --git a/hosts/morn/hardware-configuration.nix b/hosts/morn/hardware-configuration.nix new file mode 100644 index 0000000..6d8218e --- /dev/null +++ b/hosts/morn/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/93307186-cbc3-4748-859f-0013a1e36def"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/FFCD-993A"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/morn/home.nix b/hosts/morn/home.nix new file mode 100644 index 0000000..0837f7d --- /dev/null +++ b/hosts/morn/home.nix @@ -0,0 +1,12 @@ +{ pkgs, lib, ... }: +{ + imports = [ + ./../../home/base.nix + ]; + + programs = { + zsh.shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config"; + }; + + home.stateVersion = "24.11"; +}