From 94eda4ba479f1e4051c63ac9b2b349b27b429c81 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 22 Jun 2023 11:59:16 +0000 Subject: [PATCH] Add magnesium --- hosts/default.nix | 4 ++ hosts/magnesium/configuration.nix | 57 ++++++++++++++++++++++ hosts/magnesium/hardware-configuration.nix | 54 ++++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 hosts/magnesium/configuration.nix create mode 100644 hosts/magnesium/hardware-configuration.nix diff --git a/hosts/default.nix b/hosts/default.nix index 2511c21..21c1c71 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -21,4 +21,8 @@ system = "x86_64-linux"; targetHost = "192.168.42.1"; }; + magnesium = { + system = "aarch64"; + targetHost = "162.55.35.199"; + }; } diff --git a/hosts/magnesium/configuration.nix b/hosts/magnesium/configuration.nix new file mode 100644 index 0000000..b4f9b97 --- /dev/null +++ b/hosts/magnesium/configuration.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ../../home-manager/users/jalr.nix + ]; + + networking.hostName = "magnesium"; + services.openssh.enable = true; + security.sudo.wheelNeedsPassword = false; + + systemd.network = { + enable = true; + networks."10-wan" = { + matchConfig.Name = "enp1s0"; + networkConfig.DHCP = "no"; + address = [ + "162.55.35.199/32" + "2a01:4f8:c012:21ba::/64" + ]; + routes = [ + { + routeConfig.Destination = "172.31.1.1"; + } + { + routeConfig = { + Gateway = "172.31.1.1"; + GatewayOnLink = true; + }; + } + { + routeConfig.Gateway = "fe80::1"; + } + ]; + }; + }; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + myConfig = { + bootloader = "systemd-boot"; + uefi.enable = true; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.05"; # Did you read the comment? + +} + diff --git a/hosts/magnesium/hardware-configuration.nix b/hosts/magnesium/hardware-configuration.nix new file mode 100644 index 0000000..b4eba9e --- /dev/null +++ b/hosts/magnesium/hardware-configuration.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/45dcac99-1f65-48ab-b5bf-8a1507f0b75a"; + fsType = "btrfs"; + options = [ + "subvol=root" + "compress=zstd" + ]; + }; + + fileSystems."/home" = + { + device = "/dev/disk/by-uuid/45dcac99-1f65-48ab-b5bf-8a1507f0b75a"; + fsType = "btrfs"; + options = [ + "subvol=home" + "compress=zstd" + ]; + }; + + fileSystems."/nix" = + { + device = "/dev/disk/by-uuid/45dcac99-1f65-48ab-b5bf-8a1507f0b75a"; + fsType = "btrfs"; + options = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/7836-0C48"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +}