about summary refs log tree commit diff
path: root/modules/common/subversion.nix
blob: 40ea07d6792032056f840bc31a9c9c9fa45727d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.subversion;
in {
  options.nixfiles.modules.subversion.enable = mkEnableOption "Subversion";

  config = mkIf cfg.enable {
    nixfiles.modules.gnupg.enable = true;

    hm.home = {
      file = {
        ".subversion/config".text = generators.toINI {} {
          auth = {
            password-stores = "gpg-agent";
            ssl-client-cert-file-prompt = "no";
            store-passwords = "yes";
            store-auth-creds = "yes";
          };
          helpers = {
            editor-cmd = "${config.programs.vim.package}/bin/vim";
            diff-cmd = "${pkgs.colordiff}/bin/colordiff";
          };
          miscellany = {
            global-ignores = with config.hm.programs.git;
              optionalString (ignores != []) (concatStringsSep " " ignores);
            diff-ignore-content-type = "no";
          };
          working-copy = {
            exclusive-locking-clients = "svn";
            exclusive-locking = true;
            busy-timeout = 10000;
          };
        };

        ".subversion/servers".text = generators.toINI {} {
          global = {
            store-auth-creds = "yes";
            store-passwords = "yes";
            store-plaintext-passwords = "yes";
          };
        };
      };

      packages = [(pkgs.subversionClient.override {saslSupport = true;})];
    };
  };
}

Consider giving Nix/NixOS a try! <3