Skip to content

Commit

Permalink
modules (git-server): Init module and enable on srv-prod-2
Browse files Browse the repository at this point in the history
  • Loading branch information
britter committed Jan 8, 2025
1 parent d421ecb commit 43a7101
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ in {
./disko
./fonts
./gaming
./git-server
./grafana
./homelab
./home-manager
Expand Down
24 changes: 24 additions & 0 deletions modules/git-server/default.nix
Original file line number Diff line number Diff line change
@@ -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 = {};
};
}
1 change: 1 addition & 0 deletions systems/x86_64-linux/srv-prod-2/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
bootDisk = "/dev/sda";
storageDisk = "/dev/sdb";
};
git-server.enable = true;
nextcloud = {
enable = true;
stage = "production";
Expand Down
11 changes: 1 addition & 10 deletions systems/x86_64-linux/srv-test-2/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
bootDisk = "/dev/sda";
storageDisk = "/dev/sdb";
};
git-server.enable = true;
nextcloud = {
enable = true;
stage = "test";
Expand All @@ -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
Expand Down

0 comments on commit 43a7101

Please sign in to comment.