From 715921d711928b4f122edc29e1ff19934de3419b Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Fri, 8 Sep 2023 02:10:40 +0200 Subject: [PATCH] Initialize host: shark --- flake.nix | 1 + hosts/shark/configuration.nix | 39 ++++++++++++++++++++++++++ hosts/shark/hardware-configuration.nix | 38 +++++++++++++++++++++++++ values.nix | 4 +++ 4 files changed, 82 insertions(+) create mode 100644 hosts/shark/configuration.nix create mode 100644 hosts/shark/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index f788ca5..fd14053 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,7 @@ jokum = stableNixosConfig "jokum" { modules = [ matrix-next.nixosModules.synapse ]; }; + shark = stableNixosConfig "shark" { }; }; devShells = forAllSystems (system: { diff --git a/hosts/shark/configuration.nix b/hosts/shark/configuration.nix new file mode 100644 index 0000000..a7745f0 --- /dev/null +++ b/hosts/shark/configuration.nix @@ -0,0 +1,39 @@ +{ config, pkgs, values, ... }: +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../base.nix + ../../misc/metrics-exporters.nix + ]; + + sops.defaultSopsFile = ../../secrets/shark/shark.yaml; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + sops.age.keyFile = "/var/lib/sops-nix/key.txt"; + sops.age.generateKey = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "shark"; # Define your hostname. + + systemd.network.networks."30-ens18" = values.defaultNetworkConfig // { + matchConfig.Name = "ens18"; + address = with values.hosts.ildkule; [ (ipv4 + "/25") (ipv6 + "/64") ]; + }; + + # List packages installed in system profile + environment.systemPackages = with pkgs; [ + ]; + + # List services that you want to enable: + + # 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/shark/hardware-configuration.nix b/hosts/shark/hardware-configuration.nix new file mode 100644 index 0000000..eff968e --- /dev/null +++ b/hosts/shark/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 = [ "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/224c45db-9fdc-45d4-b3ad-aaf20b3efa8a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/CC37-F5FE"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/a1ce3234-78b1-4565-9643-f4a05004424f"; } + ]; + + # 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/values.nix b/values.nix index de8a716..c3a1fb7 100644 --- a/values.nix +++ b/values.nix @@ -37,6 +37,10 @@ in rec { ipv4 = pvv-ipv4 209; ipv6 = pvv-ipv6 209; }; + shark = { + ipv4 = pvv-ipv4 196; + ipv6 = pvv-ipv6 196; + }; }; defaultNetworkConfig = {