summaryrefslogtreecommitdiff
path: root/Biz/Cloud/Git.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-04-20 17:22:32 -0400
committerBen Sima <ben@bsima.me>2021-11-26 13:47:34 -0500
commit2b307499382691e3b4391b7accd9030cfadb0dd4 (patch)
tree093e65358c687b38cf0e34554857bef73de8c511 /Biz/Cloud/Git.nix
parent6603960da6fd4bf2e65d844da116e0f507e541d3 (diff)
Publish and archive some git repos
Also adds a post-receive script that creates and publishes a git-archive of the repo at that commit. This way I can depend on my own nixpkgs fork. It took me forever but I finally figured out that I need --prefix in the git archive. I also switched to using gzip instead of xz because its faster, and I figured out how to get the sha256 that nix expects, so I can now just copy that and paste it into Biz/Bild/Sources.json.
Diffstat (limited to 'Biz/Cloud/Git.nix')
-rw-r--r--Biz/Cloud/Git.nix32
1 files changed, 29 insertions, 3 deletions
diff --git a/Biz/Cloud/Git.nix b/Biz/Cloud/Git.nix
index b35b126..4dde27f 100644
--- a/Biz/Cloud/Git.nix
+++ b/Biz/Cloud/Git.nix
@@ -1,11 +1,13 @@
-{ pkgs, lib, ... }:
+{ pkgs, lib, config, ... }:
-{
+let
+ root = "/srv/git";
+in {
services = {
gitolite = {
enable = true;
enableGitAnnex = true;
- dataDir = "/srv/git";
+ dataDir = root;
user = "git";
group = "git";
extraGitoliteRc = ''
@@ -16,6 +18,30 @@
(lib.strings.splitString "\n")
lib.lists.head
];
+ # TODO: this is broken
+ # commonHooks = [ ./git-hooks ];
};
+ gitDaemon = {
+ enable = true;
+ basePath = "${root}/repositories";
+ repositories = map (p: "${root}/repositories/${p}") [
+ "nixpkgs.git"
+ "ben/bin.git"
+ "ben/cfg.git"
+ ];
+ listenAddress = "simatime.com";
+ user = "gitDaemon";
+ group = "gitDaemon";
+ };
+ };
+ users.users = {
+ gitDaemon = {
+ #uid = config.ids.uids.gitDaemon;
+ description = "Git daemon user";
+ extraGroups = [ "git" ];
+ };
+ };
+ users.groups = {
+ gitDaemon = {};
};
}