From 252794b75d990420a8f807df5e91ad53ae9785d1 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 15 Jun 2025 08:30:33 +0200 Subject: [PATCH] lkjlkjdsalkj --- .../furiphoneflx1/modules/networking.nix | 40 +++++++++++++++++++ .../furiphoneflx1/modules/udev.nix | 1 + ...iguration.nix => system-configuration.nix} | 0 3 files changed, 41 insertions(+) create mode 100644 hosts/system-manager/furiphoneflx1/modules/networking.nix create mode 100644 hosts/system-manager/furiphoneflx1/modules/udev.nix rename hosts/system-manager/furiphoneflx1/{configuration.nix => system-configuration.nix} (100%) diff --git a/hosts/system-manager/furiphoneflx1/modules/networking.nix b/hosts/system-manager/furiphoneflx1/modules/networking.nix new file mode 100644 index 0000000..3e62260 --- /dev/null +++ b/hosts/system-manager/furiphoneflx1/modules/networking.nix @@ -0,0 +1,40 @@ +{ lib, ... }: + +let + cfg = config.networking; +in + +{ + options = { + # from https://github.com/NixOS/nixpkgs/blob/799ba5bffed04ced7067a91798353d360788b30d/nixos/modules/tasks/network-interfaces.nix + + networking.hostName = mkOption { + default = config.system.nixos.distroId; + defaultText = literalExpression "config.system.nixos.distroId"; + type = types.strMatching + "^$|^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$"; + }; + + networking.fqdn = mkOption { + readOnly = true; + type = types.str; + default = if (cfg.hostName != "" && cfg.domain != null) + then "${cfg.hostName}.${cfg.domain}" + else throw '' + The FQDN is required but cannot be determined. Please make sure that + both networking.hostName and networking.domain are set properly. + ''; + defaultText = literalExpression ''"''${networking.hostName}.''${networking.domain}"''; + description = '' + The fully qualified domain name (FQDN) of this host. It is the result + of combining `networking.hostName` and `networking.domain.` Using this + option will result in an evaluation error if the hostname is empty or + no domain is specified. + + Modules that accept a mere `networking.hostName` but prefer a fully qualified + domain name may use `networking.fqdnOrHostName` instead. + ''; + }; + + }; +} diff --git a/hosts/system-manager/furiphoneflx1/modules/udev.nix b/hosts/system-manager/furiphoneflx1/modules/udev.nix new file mode 100644 index 0000000..4640904 --- /dev/null +++ b/hosts/system-manager/furiphoneflx1/modules/udev.nix @@ -0,0 +1 @@ +# TODO diff --git a/hosts/system-manager/furiphoneflx1/configuration.nix b/hosts/system-manager/furiphoneflx1/system-configuration.nix similarity index 100% rename from hosts/system-manager/furiphoneflx1/configuration.nix rename to hosts/system-manager/furiphoneflx1/system-configuration.nix