mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 19:47:47 +00:00
Configure new site
This commit is contained in:
parent
12da49d348
commit
39c92a88c4
5 changed files with 25 additions and 141 deletions
107
flake.lock
generated
107
flake.lock
generated
|
@ -1,21 +1,5 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"advisory-db": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1703184318,
|
|
||||||
"narHash": "sha256-vx2/goSpegxiFc7e1jKNHzBkhnsIQjriV4GZLaVe17M=",
|
|
||||||
"owner": "rustsec",
|
|
||||||
"repo": "advisory-db",
|
|
||||||
"rev": "a5fb72de318a74eb69a2c241c0e46705684a35d0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rustsec",
|
|
||||||
"repo": "advisory-db",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"agenix": {
|
"agenix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
|
@ -55,27 +39,6 @@
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"crane": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"site",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1703439018,
|
|
||||||
"narHash": "sha256-VT+06ft/x3eMZ1MJxWzQP3zXFGcrxGo5VR2rB7t88hs=",
|
|
||||||
"owner": "ipetkov",
|
|
||||||
"repo": "crane",
|
|
||||||
"rev": "afdcd41180e3dfe4dac46b5ee396e3b12ccc967a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "ipetkov",
|
|
||||||
"repo": "crane",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"darwin": {
|
"darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -119,30 +82,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fenix_2": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"site",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"rust-analyzer-src": [
|
|
||||||
"site"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1703917281,
|
|
||||||
"narHash": "sha256-fmhKbANx4PLG/Rt/QvKBsAdmyl8vAGQfROtccenMonw=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "fenix",
|
|
||||||
"rev": "8ad4353759945bec3a5f4bfc53efe818bb41e12a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "fenix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -855,7 +794,6 @@
|
||||||
"nixSuper": "nixSuper",
|
"nixSuper": "nixSuper",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nuScripts": "nuScripts",
|
"nuScripts": "nuScripts",
|
||||||
"site": "site",
|
|
||||||
"themes": "themes",
|
"themes": "themes",
|
||||||
"zig": "zig_2",
|
"zig": "zig_2",
|
||||||
"zls": "zls_2"
|
"zls": "zls_2"
|
||||||
|
@ -878,30 +816,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"site": {
|
|
||||||
"inputs": {
|
|
||||||
"advisory-db": "advisory-db",
|
|
||||||
"crane": "crane",
|
|
||||||
"fenix": "fenix_2",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"tools": "tools"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1707067915,
|
|
||||||
"narHash": "sha256-3utx587jbTHclu58TYDz/JvMZ0lBBs9pHRuCgc6oY1Q=",
|
|
||||||
"owner": "RGBCube",
|
|
||||||
"repo": "Site",
|
|
||||||
"rev": "b61b4c3da1992b69ff86a69cec670e2cf8d85f33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "RGBCube",
|
|
||||||
"repo": "Site",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
|
@ -977,27 +891,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tools": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"site",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1700815030,
|
|
||||||
"narHash": "sha256-x24obS8VMX5tmf8MkJMyjG7UxxJxSiH+k063Xwyfzqg=",
|
|
||||||
"owner": "RGBCube",
|
|
||||||
"repo": "FlakeTools",
|
|
||||||
"rev": "7fd62102ff360783e0fcd1f4eb434d90d06694c8",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "RGBCube",
|
|
||||||
"repo": "FlakeTools",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1605370193,
|
"lastModified": 1605370193,
|
||||||
|
|
|
@ -79,11 +79,6 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
site = {
|
|
||||||
url = "github:RGBCube/Site";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
themes = {
|
themes = {
|
||||||
url = "github:RGBCube/ThemeNix";
|
url = "github:RGBCube/ThemeNix";
|
||||||
};
|
};
|
||||||
|
@ -94,7 +89,6 @@
|
||||||
agenix,
|
agenix,
|
||||||
mail,
|
mail,
|
||||||
homeManager,
|
homeManager,
|
||||||
site,
|
|
||||||
themes,
|
themes,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
|
@ -193,7 +187,6 @@
|
||||||
./secrets
|
./secrets
|
||||||
|
|
||||||
mail.nixosModules.default
|
mail.nixosModules.default
|
||||||
site.nixosModules.default
|
|
||||||
|
|
||||||
defaultConfiguration
|
defaultConfiguration
|
||||||
] ++ (importDirectory ./hosts/${host})
|
] ++ (importDirectory ./hosts/${host})
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
let
|
let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
|
|
||||||
|
sitePath = "/var/www/site";
|
||||||
|
|
||||||
chatDomain = "chat.${domain}";
|
chatDomain = "chat.${domain}";
|
||||||
syncDomain = "sync.${domain}";
|
syncDomain = "sync.${domain}";
|
||||||
|
|
||||||
|
@ -95,11 +97,11 @@ in serverSystemConfiguration {
|
||||||
locations."/_matrix".proxyPass = "http://[::]:${toString synapsePort}";
|
locations."/_matrix".proxyPass = "http://[::]:${toString synapsePort}";
|
||||||
locations."/_synapse/client".proxyPass = "http://[::]:${toString synapsePort}";
|
locations."/_synapse/client".proxyPass = "http://[::]:${toString synapsePort}";
|
||||||
|
|
||||||
locations."/".proxyPass = "http://[::]:${toString config.services.site.port}/404/";
|
locations."/".alias = "${sitePath}/404.html";
|
||||||
locations."/assets" = {
|
locations."/assets/"= {
|
||||||
proxyPass = "http://[::]:${toString config.services.site.port}/assets";
|
alias = "${sitePath}/assets/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Cache-Control "public, max-age=10800, immutable";
|
add_header Cache-Control "public, max-age=86400, immutable";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -120,11 +122,11 @@ in serverSystemConfiguration {
|
||||||
locations."~ ^(\\/_matrix|\\/_synapse\\/client)"
|
locations."~ ^(\\/_matrix|\\/_synapse\\/client)"
|
||||||
.proxyPass = "http://[::]:${toString syncPort}";
|
.proxyPass = "http://[::]:${toString syncPort}";
|
||||||
|
|
||||||
locations."/".proxyPass = "http://[::]:${toString config.services.site.port}/404/";
|
locations."/".alias = "${sitePath}/404.html";
|
||||||
locations."/assets" = {
|
locations."/assets/" = {
|
||||||
proxyPass = "http://[::]:${toString config.services.site.port}/assets";
|
alias = "${sitePath}/assets/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Cache-Control "public, max-age=10800, immutable";
|
add_header Cache-Control "public, max-age=86400, immutable";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,21 +3,23 @@
|
||||||
let
|
let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
|
|
||||||
port = 8003;
|
path = "/var/www/site";
|
||||||
in serverSystemConfiguration {
|
|
||||||
services.site = enabled {
|
|
||||||
inherit port;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = (sslTemplate domain) // {
|
assetsLocation = {
|
||||||
locations."/".proxyPass = "http://[::]:${toString port}";
|
locations."/assets/" = {
|
||||||
locations."/assets" = {
|
alias = "${path}/assets/";
|
||||||
proxyPass = "http://[::]:${toString port}/assets";
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Cache-Control "public, max-age=10800, immutable";
|
add_header Cache-Control "public, max-age=86400, immutable";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
in serverSystemConfiguration {
|
||||||
|
services.nginx.virtualHosts.${domain} = (sslTemplate domain) // assetsLocation // {
|
||||||
|
locations."/" = {
|
||||||
|
alias = "${path}/";
|
||||||
|
tryFiles = "$uri $uri/ $uri.html $uri/index.html =404";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."www.${domain}" = (sslTemplate domain) // {
|
services.nginx.virtualHosts."www.${domain}" = (sslTemplate domain) // {
|
||||||
locations."/".extraConfig = ''
|
locations."/".extraConfig = ''
|
||||||
|
@ -25,13 +27,7 @@ in serverSystemConfiguration {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts._ = (sslTemplate domain) // {
|
services.nginx.virtualHosts._ = (sslTemplate domain) // assetsLocation // {
|
||||||
locations."/".proxyPass = "http://[::]:${toString port}/404/";
|
locations."/".alias = "${path}/404.html";
|
||||||
locations."/assets" = {
|
|
||||||
proxyPass = "http://[::]:${toString port}/assets";
|
|
||||||
extraConfig = ''
|
|
||||||
add_header Cache-Control "public, max-age=10800, immutable";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ def main --wrapped [
|
||||||
if $host == (hostname) or $host == "" {
|
if $host == (hostname) or $host == "" {
|
||||||
sudo sh -c $"nixos-rebuild switch ($flags | str join ' ') |& nom --json"
|
sudo sh -c $"nixos-rebuild switch ($flags | str join ' ') |& nom --json"
|
||||||
} else {
|
} else {
|
||||||
git ls-files | rsync --rsh "ssh -q" --delete --files-from - ./ cube:Configuration
|
git ls-files | rsync --rsh "ssh -q" --delete --compress --files-from - ./ cube:Configuration
|
||||||
|
|
||||||
ssh -q $host $"sh -c '
|
ssh -q $host $"sh -c '
|
||||||
cd Configuration
|
cd Configuration
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue