From 6108e98a762b9db62e3e1570676f0f450c43bc0c Mon Sep 17 00:00:00 2001 From: aviac Date: Sat, 3 May 2025 19:58:29 +0200 Subject: [PATCH] docs(nix): add a few more comments to the nix module --- nix/modules/default.nix | 8 +++++++- nix/modules/test.nix | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 3ef1bb43..fca7b160 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -87,13 +87,15 @@ [ cfg.domain ] ] ); + # HTTPs URL, used frequently baseUrl = "https://${fullDomain}"; in lib.mkIf cfg.enable { + # configure the user that runs the continuwuity server users.users.${cfg.user} = { - inherit (cfg) group; isSystemUser = true; + inherit (cfg) group; home = cfg.dataDir; createHome = true; shell = "${lib.getExe pkgs.bash}"; @@ -114,6 +116,9 @@ server = "${fullDomain}:443"; }; }; + # this applies the default config options as well as the extra config options + # NOTE: It might be possible to overwrite the defaults through the extraConfig, in this case the user of + # this module is on her own mergedConfig = builtins.foldl' lib.recursiveUpdate (builtins.removeAttrs cfg.settings [ "extraConfig" ]) [ @@ -215,6 +220,7 @@ }; }; + # optionally configure nginx if enabled services.nginx = let clientConfig = { diff --git a/nix/modules/test.nix b/nix/modules/test.nix index 676e88d5..68840073 100644 --- a/nix/modules/test.nix +++ b/nix/modules/test.nix @@ -1,3 +1,4 @@ +# This system sole purpose is to test the nixosModules.continuwuity module from ../modules/default.nix { inputs, ... }: { testSystem = inputs.nixpkgs.lib.nixosSystem {