summary refs log tree commit diff stats
path: root/modules/nixos/vhack/nix-sync/default.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-20 13:58:21 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-20 13:58:21 +0100
commit33639143ea50404a04bc4c454435aff1bd79dd4b (patch)
treeede4b6832bb86ac30281fc22700ae1fe40658f37 /modules/nixos/vhack/nix-sync/default.nix
parentfix(treewide): Update to nixos release 24.11 (diff)
downloadnixos-server-33639143ea50404a04bc4c454435aff1bd79dd4b.tar.gz
nixos-server-33639143ea50404a04bc4c454435aff1bd79dd4b.zip
refactor({modules,test}): Migrate to a `by-name` structure
Diffstat (limited to 'modules/nixos/vhack/nix-sync/default.nix')
-rw-r--r--modules/nixos/vhack/nix-sync/default.nix61
1 files changed, 0 insertions, 61 deletions
diff --git a/modules/nixos/vhack/nix-sync/default.nix b/modules/nixos/vhack/nix-sync/default.nix
deleted file mode 100644
index a624e0e..0000000
--- a/modules/nixos/vhack/nix-sync/default.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{
-  config,
-  lib,
-  ...
-}: let
-  cfg = config.vhack.nix-sync;
-
-  mkNixSyncRepository = {
-    domain,
-    root ? "",
-    url,
-    extraSettings ? {},
-  }: {
-    name = "${domain}";
-    value = {
-      path = "/etc/nginx/websites/${domain}/${root}";
-      uri = "${url}";
-      inherit extraSettings;
-    };
-  };
-  nixSyncRepositories = builtins.listToAttrs (builtins.map mkNixSyncRepository domains);
-
-  mkVirtHost = {
-    domain,
-    root ? "",
-    url,
-    extraSettings ? {},
-  }: {
-    name = "${domain}";
-    value =
-      lib.recursiveUpdate {
-        forceSSL = true;
-        enableACME = true;
-        root = "/etc/nginx/websites/${domain}/${root}";
-      }
-      extraSettings;
-  };
-  virtHosts = builtins.listToAttrs (builtins.map mkVirtHost domains);
-
-  domains = import ./hosts.nix {};
-in {
-  imports = [
-    ./module.nix
-  ];
-
-  options.vhack.nix-sync = {
-    enable = lib.mkEnableOption ''
-      a website git ops solution.
-    '';
-  };
-
-  config = lib.mkIf cfg.enable {
-    services.nix-sync = {
-      enable = true;
-      repositories = nixSyncRepositories;
-    };
-
-    vhack.nginx.enable = true;
-    services.nginx.virtualHosts = virtHosts;
-  };
-}