-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nixos): add plain git server service
- Loading branch information
1 parent
a44a65a
commit cad9115
Showing
5 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,16 @@ sudo rm -rf /var/lib/soft-serve | |
update-switch | ||
``` | ||
|
||
### Git server | ||
|
||
```bash | ||
# create a repo on the server | ||
sudo -u git bash -c "git init --bare ~/myproject.git" | ||
|
||
# then you can use it via the following url | ||
[email protected]:myproject.git | ||
``` | ||
|
||
### Fileserver | ||
|
||
```bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ config, lib, pkgs, ... }: { | ||
options.ruben.gitserver = { | ||
enable = lib.mkEnableOption "git server"; | ||
}; | ||
|
||
config = lib.mkIf (config.ruben.gitserver.enable) | ||
{ | ||
users.users.git = { | ||
isSystemUser = true; | ||
group = "git"; | ||
home = "/var/lib/git-server"; | ||
createHome = true; | ||
shell = "${pkgs.git}/bin/git-shell"; | ||
openssh.authorizedKeys.keys = [ | ||
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIGz2voOKRU2i2BECmdXRw+1okyV+Kwm6PSN0ghaD8zuqAAAABHNzaDo=" | ||
"[email protected] AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIPsnp3qCYwCpb49UptuZ8csHzIZzZr0Buyl7uVW9udFdAAAABHNzaDo=" | ||
]; | ||
uid = 976; | ||
}; | ||
users.groups.git.gid = 974; | ||
|
||
services.openssh = { | ||
enable = true; | ||
extraConfig = '' | ||
Match user git | ||
AllowTcpForwarding no | ||
AllowAgentForwarding no | ||
PasswordAuthentication no | ||
PermitTTY no | ||
X11Forwarding no | ||
''; | ||
}; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
./filebrowser.nix | ||
./fileserver.nix | ||
./gatus.nix | ||
./gitserver.nix | ||
./homer.nix | ||
./ssh.nix | ||
./soft-serve.nix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters