feat: initial commit
This commit is contained in:
commit
a28c2b5563
19 changed files with 314 additions and 0 deletions
7
services/default.nix
Normal file
7
services/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./openssh.nix
|
||||
./forgejo.nix
|
||||
];
|
||||
}
|
||||
22
services/forgejo.nix
Normal file
22
services/forgejo.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{...}:
|
||||
let
|
||||
serv = import ../config/services.nix;
|
||||
git = serv.git;
|
||||
in
|
||||
{
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
database.type = "postgres";
|
||||
lfs.enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = git.domain;
|
||||
ROOT_URL = "https://${git.domain}/";
|
||||
HTTP_PORT = git.port;
|
||||
};
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ git.port ];
|
||||
}
|
||||
17
services/openssh.nix
Normal file
17
services/openssh.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ ... }:
|
||||
let
|
||||
opensshConfig = import ../config/openssh.nix;
|
||||
usersWithKeys = opensshConfig.ssh_users;
|
||||
in
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
PermitRootLogin = "no";
|
||||
AllowUsers = usersWithKeys;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue