Compare commits
7 Commits
zitadel
...
413869266e
Author | SHA1 | Date | |
---|---|---|---|
413869266e
|
|||
0cb2740a86
|
|||
3a77365452
|
|||
8ca88da93a
|
|||
cf6898565b
|
|||
cc97ede099
|
|||
6ddb31c36f
|
14
flake.lock
generated
14
flake.lock
generated
@@ -541,11 +541,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723232379,
|
"lastModified": 1723391864,
|
||||||
"narHash": "sha256-F4Y3f9305aHGWKqAd3s2GyNRONdpDBuNuK4TCSdaHz8=",
|
"narHash": "sha256-nX/aloqD8ZHcuPS7sk7fx1txTaXCi+o6iYm0mIX4uIE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "plasma-manager",
|
"repo": "plasma-manager",
|
||||||
"rev": "22bea90404c5ff6457913a03c1a54a3caa5b1c57",
|
"rev": "f843f4258eea57c5ba60f6ce1d96d12d6494b56e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -576,11 +576,11 @@
|
|||||||
"secrets": {
|
"secrets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723385164,
|
"lastModified": 1723415003,
|
||||||
"narHash": "sha256-/z4nBwpHsGWl1gmGv7FQQgoOcPwUaVzL7rfjI5nTOLg=",
|
"narHash": "sha256-zSzDvI0sHayG5se7ALXhJhl41tConoWYbdqeow6OmBo=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "b47efe67031e12a2d5560b94fdb4de7dca3df80c",
|
"rev": "db951141cab2de0b4176f4f6fc42a50b30dd3950",
|
||||||
"revCount": 24,
|
"revCount": 26,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
||||||
},
|
},
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import ../overlays/gnome)
|
(import ../overlays/gnome.nix)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
@@ -55,7 +55,7 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import ./../../overlays/libcamera)
|
(import ./../../overlays/libcamera.nix)
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, lib, self, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -37,91 +37,42 @@
|
|||||||
groups = {
|
groups = {
|
||||||
jellyfin = { };
|
jellyfin = { };
|
||||||
};
|
};
|
||||||
|
extraGroups.acme.members = [ "kanidm" "nginx" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
||||||
|
|
||||||
services.postgresql = {
|
security.acme.certs."auth.vimium.com" = {
|
||||||
ensureUsers = [
|
postRun = "systemctl restart kanidm.service";
|
||||||
{
|
group = "acme";
|
||||||
name = "zitadel";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
ensureClauses = {
|
|
||||||
superuser = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
ensureDatabases = [ "zitadel" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets."files/services/zitadel/masterkey" = {
|
services.kanidm = let
|
||||||
file = "${self.inputs.secrets}/files/services/zitadel/masterkey.age";
|
baseDomain = "vimium.com";
|
||||||
owner = "zitadel";
|
domain = "auth.${baseDomain}";
|
||||||
group = "zitadel";
|
uri = "https://${domain}";
|
||||||
};
|
in {
|
||||||
|
enableClient = true;
|
||||||
systemd.services.zitadel = {
|
enableServer = true;
|
||||||
requires = [ "postgresql.service" ];
|
clientSettings = {
|
||||||
after = [ "postgresql.service" ];
|
inherit uri;
|
||||||
};
|
|
||||||
|
|
||||||
services.zitadel = {
|
|
||||||
enable = true;
|
|
||||||
masterKeyFile = config.age.secrets."files/services/zitadel/masterkey".path;
|
|
||||||
settings = {
|
|
||||||
Database.postgres = {
|
|
||||||
Host = "/run/postgresql";
|
|
||||||
Port = 5432;
|
|
||||||
Database = "zitadel";
|
|
||||||
User = {
|
|
||||||
Username = "zitadel";
|
|
||||||
SSL.Mode = "disable";
|
|
||||||
};
|
|
||||||
Admin = {
|
|
||||||
ExistingDatabase = "zitadel";
|
|
||||||
Username = "zitadel";
|
|
||||||
SSL.Mode = "disable";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
ExternalDomain = "id.vimium.com";
|
|
||||||
ExternalPort = 443;
|
|
||||||
ExternalSecure = true;
|
|
||||||
Machine = {
|
|
||||||
Identification = {
|
|
||||||
Hostname.Enabled = true;
|
|
||||||
PrivateIp.Enabled = false;
|
|
||||||
Webhook.Enabled = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
Port = 8081;
|
|
||||||
WebAuthNName = "Vimium";
|
|
||||||
};
|
};
|
||||||
steps.FirstInstance = {
|
serverSettings = {
|
||||||
InstanceName = "Vimium";
|
bindaddress = "[::1]:3013";
|
||||||
Org.Name = "Vimium";
|
domain = baseDomain;
|
||||||
Org.Human = {
|
origin = uri;
|
||||||
UserName = "jordan@vimium.com";
|
tls_chain = "${config.security.acme.certs.${domain}.directory}/full.pem";
|
||||||
FirstName = "Jordan";
|
tls_key = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
||||||
LastName = "Holt";
|
|
||||||
Email = {
|
|
||||||
Address = "jordan@vimium.com";
|
|
||||||
Verified = true;
|
|
||||||
};
|
|
||||||
Password = "Password1!";
|
|
||||||
PasswordChangeRequired = true;
|
|
||||||
};
|
|
||||||
LoginPolicy.AllowRegister = false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."id.vimium.com" = {
|
services.nginx.virtualHosts = {
|
||||||
enableACME = true;
|
"auth.vimium.com" = {
|
||||||
forceSSL = true;
|
useACMEHost = "auth.vimium.com";
|
||||||
locations."/" = {
|
forceSSL = true;
|
||||||
extraConfig = ''
|
locations."/" = {
|
||||||
grpc_pass grpc://localhost:${builtins.toString config.services.zitadel.settings.Port};
|
proxyPass = "https://[::1]:3013";
|
||||||
grpc_set_header Host $host:$server_port;
|
};
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -17,7 +17,6 @@ in {
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableJIT = true;
|
|
||||||
initdbArgs = [
|
initdbArgs = [
|
||||||
"--allow-group-access"
|
"--allow-group-access"
|
||||||
"--encoding=UTF8"
|
"--encoding=UTF8"
|
||||||
|
@@ -118,8 +118,12 @@ in {
|
|||||||
serverAliases = [ "www.jdholt.com" ];
|
serverAliases = [ "www.jdholt.com" ];
|
||||||
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
||||||
locations."/skycam/snapshot.jpg" = {
|
locations."/skycam/snapshot.jpg" = {
|
||||||
proxyPass = "http://skycam.mesh.vimium.net:8080/snapshot";
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
set $backend "skycam.mesh.vimium.net:8080";
|
||||||
|
|
||||||
|
resolver 100.100.100.100;
|
||||||
|
|
||||||
|
proxy_pass http://$backend/snapshot;
|
||||||
proxy_cache skycam_cache;
|
proxy_cache skycam_cache;
|
||||||
proxy_cache_valid any 10s;
|
proxy_cache_valid any 10s;
|
||||||
proxy_ignore_headers Cache-Control Expires Set-Cookie;
|
proxy_ignore_headers Cache-Control Expires Set-Cookie;
|
||||||
|
Reference in New Issue
Block a user