From c858eebb93c8851a430875d8f21efef595f4cb89 Mon Sep 17 00:00:00 2001 From: padreug Date: Wed, 8 Oct 2025 18:02:36 +0200 Subject: [PATCH] Refactor shared Nix configuration to improve hostname handling and module imports Updated the shared Nix configuration to extract the hostname from the domain, enhancing clarity in the setup. Reordered module imports to ensure proper dependency management, including the addition of module arguments for better customization. This change improves the overall organization and maintainability of the NixOS configuration. --- config/shared.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/shared.nix b/config/shared.nix index 8e9023d..7ff887e 100644 --- a/config/shared.nix +++ b/config/shared.nix @@ -3,13 +3,14 @@ { imports = [ ./nginx.nix - ./pict-rs.nix ./modules/lnbits-service.nix + { _module.args = { inherit domain; }; } + ./pict-rs.nix ./lnbits.nix ]; - # Set hostname (passed as parameter) - networking.hostName = domain; + # Set hostname (extract from domain, e.g., "4lpaca" from "4lpaca.io") + networking.hostName = builtins.head (pkgs.lib.splitString "." domain); # System packages environment.systemPackages = with pkgs; [