diff --git a/modules/default.nix b/modules/default.nix index 900fef1..f0fde5b 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -8,6 +8,7 @@ in { ./disko ./fonts ./gaming + ./git-server ./grafana ./homelab ./home-manager diff --git a/modules/git-server/default.nix b/modules/git-server/default.nix new file mode 100644 index 0000000..78f43a7 --- /dev/null +++ b/modules/git-server/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.my.modules.git-server; +in { + options.my.modules.git-server = { + enable = lib.mkEnableOption "default"; + }; + + config = lib.mkIf cfg.enable { + users.users.git = { + isSystemUser = true; + group = "git"; + description = "git user"; + home = "/srv/git"; + shell = "${pkgs.git}/bin/git-shell"; + openssh.authorizedKeys.keyFiles = [../ssh-access/id_ed25519.pub]; + }; + users.groups.git = {}; + }; +} diff --git a/systems/x86_64-linux/srv-prod-2/configuration.nix b/systems/x86_64-linux/srv-prod-2/configuration.nix index 20de5eb..efe691c 100644 --- a/systems/x86_64-linux/srv-prod-2/configuration.nix +++ b/systems/x86_64-linux/srv-prod-2/configuration.nix @@ -14,6 +14,7 @@ bootDisk = "/dev/sda"; storageDisk = "/dev/sdb"; }; + git-server.enable = true; nextcloud = { enable = true; stage = "production"; diff --git a/systems/x86_64-linux/srv-test-2/configuration.nix b/systems/x86_64-linux/srv-test-2/configuration.nix index da3803a..27402a0 100644 --- a/systems/x86_64-linux/srv-test-2/configuration.nix +++ b/systems/x86_64-linux/srv-test-2/configuration.nix @@ -15,6 +15,7 @@ bootDisk = "/dev/sda"; storageDisk = "/dev/sdb"; }; + git-server.enable = true; nextcloud = { enable = true; stage = "test"; @@ -23,16 +24,6 @@ }; }; - users.users.git = { - isSystemUser = true; - group = "git"; - description = "git user"; - home = "/srv/git"; - shell = "${pkgs.git}/bin/git-shell"; - openssh.authorizedKeys.keyFiles = [../../../modules/ssh-access/id_ed25519.pub]; - }; - users.groups.git = {}; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave