1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 11:37:44 +00:00

Don't repeat the hostname

This commit is contained in:
RGBCube 2024-04-24 11:46:26 +03:00
parent 9c9c945b20
commit eae2bf434e
No known key found for this signature in database
3 changed files with 10 additions and 8 deletions

View file

@ -7,7 +7,7 @@ systemConfiguration {
passwordFile = config.secrets.resticPassword.path; passwordFile = config.secrets.resticPassword.path;
initialize = true; initialize = true;
repository = "sftp:backup@${self.disk.networking.ipv4}:cube-varlib"; repository = "sftp:backup@disk:${config.networking.hostName}-varlib";
paths = [ "/var/lib" ]; paths = [ "/var/lib" ];

View file

@ -13,11 +13,11 @@ in systemConfiguration {
services.nginx = enabled { services.nginx = enabled {
appendHttpConfig = '' appendHttpConfig = ''
map $http_origin $allow_origin { map $http_origin $allow_origin {
~^https://.+\.rgbcu.be$ $http_origin; ~^https://.+\.${domain}$ $http_origin;
} }
map $http_origin $allow_methods { map $http_origin $allow_methods {
~^https://.+\.rgbcu.be$ "GET, HEAD, OPTIONS"; ~^https://.+\.${domain}$ "GET, HEAD, OPTIONS";
} }
''; '';

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }: with lib; merge { self, lib, pkgs, ... }: with lib; merge
(systemConfiguration { (systemConfiguration {
environment.shellAliases = { environment.shellAliases = {
@ -64,7 +64,9 @@
}; };
}) })
(homeConfiguration { (let
gitHost = self.cube.networking.hostName;
in homeConfiguration {
programs.nushell.configFile.text = mkAfter '' programs.nushell.configFile.text = mkAfter ''
# Sets the remote origin to the specified user and repository on my git instance # Sets the remote origin to the specified user and repository on my git instance
def gsr [user_and_repo: string] { def gsr [user_and_repo: string] {
@ -74,7 +76,7 @@
"RGBCube/" + $user_and_repo "RGBCube/" + $user_and_repo
} }
git remote add origin ("https://git.rgbcu.be/" + $user_and_repo) git remote add origin ("https://git.${gitHost}/" + $user_and_repo)
} }
''; '';
@ -82,7 +84,7 @@
package = pkgs.gitFull; package = pkgs.gitFull;
userName = "RGBCube"; userName = "RGBCube";
userEmail = "git@rgbcu.be"; userEmail = "git@${gitHost}";
lfs = enabled; lfs = enabled;
@ -123,7 +125,7 @@
core.sshCommand = "ssh -i ~/.ssh/id"; core.sshCommand = "ssh -i ~/.ssh/id";
url."ssh://git@github.com/".insteadOf = "https://github.com/"; url."ssh://git@github.com/".insteadOf = "https://github.com/";
url."ssh://forgejo@rgbcu.be:2222/".insteadOf = "https://git.rgbcu.be/"; url."ssh://forgejo@${gitHost}:2222/".insteadOf = "https://git.${gitHost}/";
} (mkIf isDesktop { } (mkIf isDesktop {
commit.gpgSign = true; commit.gpgSign = true;
tag.gpgSign = true; tag.gpgSign = true;