mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-11-22 11:17:56 +01:00
vps1: move some settings into a separate file
This commit is contained in:
parent
8699da4a85
commit
9c820fa600
5 changed files with 24 additions and 9 deletions
|
@ -68,8 +68,12 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nixosConfigurations.lgm-vps1 = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.lgm-vps1 = let
|
||||||
|
data = import ./hosts/vps1/data;
|
||||||
|
in
|
||||||
|
nixpkgs.lib.nixosSystem rec {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
specialArgs = { inherit data; };
|
||||||
modules = [
|
modules = [
|
||||||
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
|
({ config, pkgs, ... }: { nixpkgs.overlays = my-overlays; })
|
||||||
./hosts/vps1/configuration.nix
|
./hosts/vps1/configuration.nix
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, data, ... }:
|
||||||
let
|
let
|
||||||
rootDomain = "lgmrszd.xyz";
|
inherit (data.services) rootDomain;
|
||||||
gtnhDomain = "gtnh.${rootDomain}";
|
gtnhDomain = "gtnh.${rootDomain}";
|
||||||
discDomain = "discourse.testdrive.${rootDomain}";
|
discDomain = "discourse.testdrive.${rootDomain}";
|
||||||
akkoDomain = "akko429164.testdrive.${rootDomain}";
|
akkoDomain = "akko429164.testdrive.${rootDomain}";
|
||||||
iceDomain = "ice758549.testdrive.${rootDomain}";
|
iceDomain = "ice758549.testdrive.${rootDomain}";
|
||||||
|
gitSSHPort = data.services.git.sshPort;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -32,11 +33,11 @@ in
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ports = [ 37163 22631 ];
|
ports = [ 37163 gitSSHPort ];
|
||||||
settings.PermitRootLogin = "no";
|
settings.PermitRootLogin = "no";
|
||||||
settings.PasswordAuthentication = false;
|
settings.PasswordAuthentication = false;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
Match LocalPort 22631
|
Match LocalPort ${toString gitSSHPort}
|
||||||
AllowUsers forgejo
|
AllowUsers forgejo
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
3
hosts/vps1/data/default.nix
Normal file
3
hosts/vps1/data/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
services = builtins.fromTOML (builtins.readFile ./services.toml);
|
||||||
|
}
|
6
hosts/vps1/data/services.toml
Normal file
6
hosts/vps1/data/services.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
rootDomain = "lgmrszd.xyz"
|
||||||
|
|
||||||
|
[git]
|
||||||
|
subdomain = "git"
|
||||||
|
sshPort = 22631
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# Big thanks to Pyrox for their config! https://git.pyrox.dev/pyrox/nix/src/branch/main/hosts/marvin/services/git.nix
|
# Big thanks to Pyrox for their config! https://git.pyrox.dev/pyrox/nix/src/branch/main/hosts/marvin/services/git.nix
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, data, ... }:
|
||||||
let
|
let
|
||||||
rootDomain = "lgmrszd.xyz";
|
inherit (data.services) rootDomain;
|
||||||
domain = "git.${rootDomain}";
|
domain = "${data.services.git.subdomain}.${rootDomain}";
|
||||||
|
gitSSHPort = data.services.git.sshPort;
|
||||||
|
|
||||||
cfg = config.services.forgejo;
|
cfg = config.services.forgejo;
|
||||||
srv = cfg.settings.server;
|
srv = cfg.settings.server;
|
||||||
|
@ -39,7 +40,7 @@ in
|
||||||
ROOT_URL = "https://${srv.DOMAIN}/";
|
ROOT_URL = "https://${srv.DOMAIN}/";
|
||||||
HTTP_ADDR = "127.0.0.1";
|
HTTP_ADDR = "127.0.0.1";
|
||||||
HTTP_PORT = 3001;
|
HTTP_PORT = 3001;
|
||||||
SSH_PORT = 22631;
|
SSH_PORT = gitSSHPort;
|
||||||
};
|
};
|
||||||
DEFAULT = {
|
DEFAULT = {
|
||||||
APP_NAME = "Lgmrszd's git";
|
APP_NAME = "Lgmrszd's git";
|
||||||
|
|
Loading…
Reference in a new issue