From 43e754db72ce552be256a24463ab77056337429c Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Wed, 23 Oct 2024 11:25:01 +0200 Subject: [PATCH] hosts/anastacia: init with generated configuration --- hosts/anastacia/default.nix | 14 ++++++ hosts/anastacia/hardware-configuration.nix | 10 +++++ hosts/anastacia/networking.nix | 52 ++++++++++++++++++++++ hosts/default.nix | 8 ++++ 4 files changed, 84 insertions(+) create mode 100644 hosts/anastacia/default.nix create mode 100644 hosts/anastacia/hardware-configuration.nix create mode 100644 hosts/anastacia/networking.nix diff --git a/hosts/anastacia/default.nix b/hosts/anastacia/default.nix new file mode 100644 index 0000000..1b56dd7 --- /dev/null +++ b/hosts/anastacia/default.nix @@ -0,0 +1,14 @@ +{...}: { + imports = [ + ./hardware-configuration.nix + ./networking.nix # generated at runtime by nixos-infect + ]; + + boot.tmp.cleanOnBoot = true; + zramSwap.enable = true; + networking.hostName = "anastacia"; + networking.domain = ""; + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzs7SQH0Vjt9JHoXXmWy9fPU1I3rrRWV5magZFrI5al'']; + system.stateVersion = "23.11"; +} diff --git a/hosts/anastacia/hardware-configuration.nix b/hosts/anastacia/hardware-configuration.nix new file mode 100644 index 0000000..329ed8a --- /dev/null +++ b/hosts/anastacia/hardware-configuration.nix @@ -0,0 +1,10 @@ +{modulesPath, ...}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"]; + boot.initrd.kernelModules = ["nvme"]; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; +} diff --git a/hosts/anastacia/networking.nix b/hosts/anastacia/networking.nix new file mode 100644 index 0000000..6dcffe8 --- /dev/null +++ b/hosts/anastacia/networking.nix @@ -0,0 +1,52 @@ +{lib, ...}: { + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ + "8.8.8.8" + ]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { + address = "78.47.146.254"; + prefixLength = 32; + } + ]; + ipv6.addresses = [ + { + address = "2a01:4f8:1c1c:8495::1"; + prefixLength = 64; + } + { + address = "fe80::9400:3ff:fecb:6deb"; + prefixLength = 64; + } + ]; + ipv4.routes = [ + { + address = "172.31.1.1"; + prefixLength = 32; + } + ]; + ipv6.routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="96:00:03:cb:6d:eb", NAME="eth0" + + ''; +} diff --git a/hosts/default.nix b/hosts/default.nix index e2b4ddd..6433749 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -28,4 +28,12 @@ in { self.nixosModules.theme ]; }; + + anastacia = nixosSystem { + system = "x86_64-linux"; + inherit specialArgs; + modules = [ + ./anastacia + ]; + }; }