diff --git a/flake.nix b/flake.nix index 2422ffc3..873b6e2d 100644 --- a/flake.nix +++ b/flake.nix @@ -506,6 +506,14 @@ system = "x86_64-linux"; }; + storage-ng = nixosSystem' { + modules = [ + ./hosts/storage-ng + secrets.nixosModules.admins + ]; + system = "x86_64-linux"; + }; + }; nixosModule = import ./lib; diff --git a/host-registry.nix b/host-registry.nix index 6ede0228..71fb5ef0 100644 --- a/host-registry.nix +++ b/host-registry.nix @@ -26,6 +26,8 @@ rec { samba = { }; + storage-ng.ip4 = "172.22.99.20"; + storage-ng.ip6 = "2a00:8180:2c00:223::20"; storage-ng.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMeg5ojU7U8+Lx824y+brazVJ007mEJDM7C7aUruOWGP"; server1 = { @@ -65,8 +67,6 @@ rec { publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHhcvlbZ4TjAb6eQkYB2/Z3o/PHQVyAS6iEdGX+CEbGD"; }; - storage.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbjG4uY8A0IJHRKjiQwt9JbuLDNVaTcwNJN8J4z6mgX"; - yggdrasil = { ip4 = "172.20.72.62"; ip6 = "2a00:8180:2c00:281:9000::1"; diff --git a/hosts/storage-ng/configuration.nix b/hosts/storage-ng/default.nix similarity index 80% rename from hosts/storage-ng/configuration.nix rename to hosts/storage-ng/default.nix index dbce9700..5fcd210d 100644 --- a/hosts/storage-ng/configuration.nix +++ b/hosts/storage-ng/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, strings, ... }: +{ hostRegistry, config, pkgs, lib, strings, ... }: let eth0 = "ens18"; @@ -7,9 +7,9 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../lib + # ../../lib # ../../lib/hq.nix - ../../lib/shared.nix + # ../../lib/shared.nix ]; c3d2 = { @@ -19,12 +19,13 @@ in hq.interface = eth0; }; - hq.yggdrasil = { + boot.loader.grub = { enable = true; - interface = eth0; + version = 2; + efiSupport = true; + devices = [ "nodev" ]; }; - - boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; systemd.enableEmergencyMode = false; networking = { @@ -32,15 +33,16 @@ in # usePredictableInterfacenames = false; interfaces."${eth0}" = { ipv4.addresses = [{ - address = "172.22.99.20"; + address = hostRegistry.hosts.${config.networking.hostName}.ip4; prefixLength = 24; }]; ipv6.addresses = [{ - address = "2a00:8180:2c00:223::20"; + address = hostRegistry.hosts.${config.networking.hostName}.ip6; prefixLength = 64; }]; }; + defaultGateway.address = "172.22.99.4"; defaultGateway.interface = eth0; }; @@ -64,6 +66,7 @@ in # fixme, we need a floating ip here # correct is floating ip 172.22.99.21 # does not exist yet + # TODO: where, exactly? # secretfile does not work :( fileSystems."/mnt/cephfs" = { diff --git a/hosts/storage-ng/hardware-configuration.nix b/hosts/storage-ng/hardware-configuration.nix index 2ba0db25..54a7f8a4 100644 --- a/hosts/storage-ng/hardware-configuration.nix +++ b/hosts/storage-ng/hardware-configuration.nix @@ -1,10 +1,13 @@ # 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, ... }: +{ config, lib, pkgs, modulesPath, ... }: { - imports = [ ]; + imports = [ + "${modulesPath}/installer/scan/not-detected.nix" + "${modulesPath}/profiles/qemu-guest.nix" + ]; boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];