summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/cgit.nix62
1 files changed, 34 insertions, 28 deletions
diff --git a/services/cgit.nix b/services/cgit.nix
index 07d4024..acadcc1 100644
--- a/services/cgit.nix
+++ b/services/cgit.nix
@@ -1,38 +1,44 @@
-{pkgs, lib, config, ...}: let
- inherit (lib) mkIf mkOption mkEnableOption types;
- cfg = config.wilkuu.services.cgit;
- cgit_dark = pkgs.fetchFromGitHub {
- owner = "jb3";
- repo = "cgit-dark";
- rev = "f82cde4b29834d31465a5dafa00de527ef6853b0";
- hash = "sha256-fSOelKDf1lHHRuyg/F81l8rAFrc6u7mAEFBX1Ua3V10=";
- };
-in {
+{
+ pkgs,
+ lib,
+ config,
+ ...
+}:
+let
+ inherit (lib)
+ mkIf
+ mkOption
+ mkEnableOption
+ types
+ ;
+ cfg = config.wilkuu.services.cgit;
+in
+{
options.wilkuu.services.cgit = {
- enable = mkEnableOption "remote git and cgit";
+ enable = mkEnableOption "remote git and cgit";
domain = mkOption {
- description = "Domain to run cgit on";
- example = "git.wilkuu.xyz";
+ description = "Domain to run cgit on";
+ example = "git.wilkuu.xyz";
default = "git.${config.networking.hostName}.local";
type = types.str;
- };
+ };
};
config = mkIf cfg.enable {
- users.groups.git = {};
+ users.groups.git = { };
users.users.git = {
- group = "git";
+ group = "git";
enable = true;
- isSystemUser = true;
+ isSystemUser = true;
home = "/srv/git/";
- createHome = true;
- shell = "${pkgs.git}/bin/git-shell";
+ createHome = true;
+ shell = "${pkgs.git}/bin/git-shell";
openssh.authorizedKeys.keyFiles = [
../secrets/${config.networking.hostName}/git_authorized_keys
];
- };
+ };
services.openssh = {
- enable = true;
+ enable = true;
extraConfig = ''
Match user git
AllowTcpForwarding no
@@ -42,13 +48,13 @@ in {
PermitTTY no
X11Forwarding no
'';
-
+
};
- services.openssh.settings.AllowUsers = ["git"];
+ services.openssh.settings.AllowUsers = [ "git" ];
services.cgit."${cfg.domain}" = {
- enable = true;
+ enable = true;
group = "git";
- user = "git";
+ user = "git";
scanPath = "/srv/git";
settings = {
enable-follow-links = true;
@@ -57,13 +63,13 @@ in {
# css = "https://raw.githubusercontent.com/jb3/cgit-dark/f82cde4b29834d31465a5dafa00de527ef6853b0/cgit-themed.css";
};
gitHttpBackend = {
- enable = true;
+ enable = true;
checkExportOkFiles = false; # TODO: Reconsider later
};
};
services.nginx.virtualHosts.${cfg.domain} = {
- forceSSL = true;
- enableACME = true;
+ forceSSL = true;
+ enableACME = true;
};
};