flake

Francesco Saccone's Nix flake.
git clone https://git.francescosaccone.com/flake
Log | Files | Refs | README | LICENSE

commit a4ce6c65717c206b508113a2ce7ba9aea0bcb69a
parent 87f802d3a4c8225416a89f464b073e1ede63b0d6
Author: Francesco Saccone <francesco@francescosaccone.com>
Date:   Thu, 15 May 2025 09:15:40 +0200

refactor: move quark from 'modules' to 'services'

Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>

Diffstat:
Mmodules/nixos/quark/acme/default.nix | 8++++----
Mmodules/nixos/quark/default.nix | 14+++++++-------
Mmodules/nixos/quark/tls/default.nix | 6+++---
3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/nixos/quark/acme/default.nix b/modules/nixos/quark/acme/default.nix @@ -6,7 +6,7 @@ ... }: { - options.modules.quark.acme = { + options.services.quark.acme = { enable = lib.mkOption { description = "Whether to enable the Certbot ACME client."; default = false; @@ -37,9 +37,9 @@ config = let - inherit (config.modules.quark) acme; + inherit (config.services.quark) acme; in - lib.mkIf (acme.enable && config.modules.quark.enable) { + lib.mkIf (acme.enable && config.services.quark.enable) { systemd = { services = { acme = { @@ -54,7 +54,7 @@ | ${pkgs.gnugrep}/bin/grep -q "No certificates"; then ${pkgs.certbot}/bin/certbot certonly --quiet --webroot \ --agree-tos --email ${acme.email} \ - -w ${config.modules.quark.directory} \ + -w ${config.services.quark.directory} \ -d ${builtins.concatStringsSep " -d " domains} else ${pkgs.certbot}/bin/certbot renew --quiet diff --git a/modules/nixos/quark/default.nix b/modules/nixos/quark/default.nix @@ -11,7 +11,7 @@ ./tls ]; - options.modules.quark = { + options.services.quark = { enable = lib.mkOption { description = "Whether to enable Quark web server."; default = false; @@ -43,7 +43,7 @@ }; }; - config = lib.mkIf config.modules.quark.enable { + config = lib.mkIf config.services.quark.enable { users = { users = { quark = { @@ -63,7 +63,7 @@ services = { quark = let - inherit (config.modules.quark) preStart; + inherit (config.services.quark) preStart; in rec { enable = true; @@ -72,14 +72,14 @@ path = preStart.packages; serviceConfig = let - inherit (config.modules.quark) customHeaderScripts tls; + inherit (config.services.quark) customHeaderScripts tls; script = pkgs.writeShellScriptBin "script" '' ${builtins.concatStringsSep "\n" preStart.scripts} ${pkgs.quark}/bin/quark \ -p 80 \ - -d ${config.modules.quark.directory} \ - -u ${config.modules.quark.user} \ + -d ${config.services.quark.directory} \ + -u ${config.services.quark.user} \ -g quark \ -i index.html ''; @@ -98,7 +98,7 @@ enable = true; wantedBy = [ "multi-user.target" ]; pathConfig = { - PathModified = [ config.modules.quark.directory ]; + PathModified = [ config.services.quark.directory ]; }; }; }; diff --git a/modules/nixos/quark/tls/default.nix b/modules/nixos/quark/tls/default.nix @@ -6,7 +6,7 @@ ... }: { - options.modules.quark.tls = { + options.services.quark.tls = { enable = lib.mkOption { description = "Whether to enable the Hitch reverse proxy."; default = false; @@ -20,9 +20,9 @@ config = let - inherit (config.modules.quark) tls; + inherit (config.services.quark) tls; in - lib.mkIf (tls.enable && config.modules.quark.enable) { + lib.mkIf (tls.enable && config.services.quark.enable) { users = { users = { hitch = {