summary refs log tree commit diff stats
path: root/system/services/git-sync/default.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-03 08:49:41 +0200
committerSoispha <soispha@vhack.eu>2023-07-03 14:26:40 +0200
commit3f2fedfb794a1fccf4581a9cef5eaf4fd1c837a7 (patch)
treeba11fac01f887359954073c9e53712d7e8a5e4a3 /system/services/git-sync/default.nix
parentFix(system/fs-layout): Remove persistent dir as it's now in /srv (diff)
downloadnixos-server-3f2fedfb794a1fccf4581a9cef5eaf4fd1c837a7.tar.gz
nixos-server-3f2fedfb794a1fccf4581a9cef5eaf4fd1c837a7.zip
Feat(system/services/nix-sync): Remodel git-sync to make it useful
Diffstat (limited to 'system/services/git-sync/default.nix')
-rw-r--r--system/services/git-sync/default.nix99
1 files changed, 0 insertions, 99 deletions
diff --git a/system/services/git-sync/default.nix b/system/services/git-sync/default.nix
deleted file mode 100644
index 4295870..0000000
--- a/system/services/git-sync/default.nix
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Taken from:
-https://github.com/nix-community/home-manager/blob/9ba7b3990eb1f4782ea3f5fe7ac4f3c88dd7a32c/modules/services/git-sync.nix
-*/
-{
-  config,
-  lib,
-  pkgs,
-  ...
-}: let
-  cfg = config.services.git-sync;
-
-  mkUnit = name: repo: {
-    unitConfig.Description = "Git Sync ${name}";
-
-    wantedBy = ["default.target"];
-
-    serviceConfig = {
-      Environment = [
-        "PATH=${lib.makeBinPath (with pkgs; [openssh git])}"
-        "GIT_SYNC_DIRECTORY=${repo.path}"
-        "GIT_SYNC_COMMAND=${cfg.package}/bin/git-sync"
-        "GIT_SYNC_REPOSITORY=${repo.uri}"
-        "GIT_SYNC_INTERVAL=${toString repo.interval}"
-      ];
-      ExecStart = "${cfg.package}/bin/git-sync-on-inotify";
-      Restart = "on-abort";
-    };
-  };
-
-  services =
-    lib.mapAttrs' (name: repo: {
-      name = "git-sync-${name}";
-      value = mkUnit name repo;
-    })
-    cfg.repositories;
-
-  repositoryType = lib.types.submodule ({name, ...}: {
-    options = {
-      name = lib.mkOption {
-        internal = true;
-        default = name;
-        type = lib.types.str;
-        description = "The name that should be given to this unit.";
-      };
-
-      path = lib.mkOption {
-        type = lib.types.str;
-        description = "The path at which to sync the repository";
-      };
-
-      uri = lib.mkOption {
-        type = lib.types.str;
-        example = "git+ssh://user@example.com:/~[user]/path/to/repo.git";
-        description = ''
-          The URI of the remote to be synchronized. This is only used in the
-          event that the directory does not already exist. See
-          <link xlink:href="https://git-scm.com/docs/git-clone#_git_urls"/>
-          for the supported URIs.
-        '';
-      };
-
-      interval = lib.mkOption {
-        type = lib.types.int;
-        default = 500;
-        description = ''
-          The interval, specified in seconds, at which the synchronization will
-          be triggered even without filesystem changes.
-        '';
-      };
-    };
-  });
-in {
-  options = {
-    services.git-sync = {
-      enable = lib.mkEnableOption "git-sync services";
-
-      package = lib.mkOption {
-        type = lib.types.package;
-        default = pkgs.git-sync;
-        defaultText = lib.literalExpression "pkgs.git-sync";
-        description = ''
-          Package containing the <command>git-sync</command> program.
-        '';
-      };
-
-      repositories = lib.mkOption {
-        type = with lib.types; attrsOf repositoryType;
-        description = ''
-          The repositories that should be synchronized.
-        '';
-      };
-    };
-  };
-
-  config = lib.mkIf cfg.enable {
-    systemd.services = services;
-  };
-}