Compare commits
19 Commits
zitadel
...
e5685cb361
Author | SHA1 | Date | |
---|---|---|---|
e5685cb361
|
|||
1f911b0bcb
|
|||
3338ebf695
|
|||
a685860680
|
|||
e35154a5ea
|
|||
367d5f08a1
|
|||
decc27afd7
|
|||
bdd73f1ef8
|
|||
a3d1b16bec
|
|||
b70b4cd14f
|
|||
36a6ccf65c
|
|||
2def8145b4
|
|||
413869266e
|
|||
0cb2740a86
|
|||
3a77365452
|
|||
8ca88da93a
|
|||
cf6898565b
|
|||
cc97ede099
|
|||
6ddb31c36f
|
62
flake.lock
generated
62
flake.lock
generated
@@ -107,11 +107,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1723080788,
|
||||
"narHash": "sha256-C5LbM5VMdcolt9zHeLQ0bYMRjUL+N+AL5pK7/tVTdes=",
|
||||
"lastModified": 1724349583,
|
||||
"narHash": "sha256-zgB1Cfk46irIsto8666yLdKjqKdBrjR48Dd3lhQ0CnQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "ffc1f95f6c28e1c6d1e587b51a2147027a3e45ed",
|
||||
"rev": "435737144be0259559ca3b43f7d72252b1fdcc1b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -233,11 +233,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722857853,
|
||||
"narHash": "sha256-3Zx53oz/MSIyevuWO/SumxABkrIvojnB7g9cimxkhiE=",
|
||||
"lastModified": 1724440431,
|
||||
"narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "06939f6b7ec4d4f465bf3132a05367cccbbf64da",
|
||||
"rev": "c8a54057aae480c56e28ef3e14e4960628ac495b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -373,11 +373,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722924007,
|
||||
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=",
|
||||
"lastModified": 1724469941,
|
||||
"narHash": "sha256-+U5152FwmDD9EUOiFi5CFxCK6/yFESyDei9jEIlmUtI=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705",
|
||||
"rev": "ea319a737939094b48fda9063fa3201ef2479aac",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -388,11 +388,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1723310128,
|
||||
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
|
||||
"lastModified": 1724575805,
|
||||
"narHash": "sha256-OB/kEL3GAhUZmUfkbPfsPhKs0pRqJKs0EEBiLfyKZw8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
|
||||
"rev": "9fc19be21f0807d6be092d70bf0b1de0c00ac895",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -459,11 +459,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1723175592,
|
||||
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=",
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -490,11 +490,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1723282977,
|
||||
"narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=",
|
||||
"lastModified": 1724316499,
|
||||
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc",
|
||||
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -517,11 +517,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722925293,
|
||||
"narHash": "sha256-saXm5dd/e3PMsYTEcp1Qbzifm3KsZtNFkrWjmLhXHGE=",
|
||||
"lastModified": 1724502615,
|
||||
"narHash": "sha256-g206hhNghyxMO9Sdv9fD22MRgWQppws10x+oDHKDVdU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "170df9814c3e41d5a4d6e3339e611801b1f02ce2",
|
||||
"rev": "764b89aa14543da7266719757cfcf0cce8c1679f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -541,11 +541,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1723232379,
|
||||
"narHash": "sha256-F4Y3f9305aHGWKqAd3s2GyNRONdpDBuNuK4TCSdaHz8=",
|
||||
"lastModified": 1724556439,
|
||||
"narHash": "sha256-gPR3sxkKxISUvydnqoj54znpUkK8av/HVFuFJuYUw3w=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "22bea90404c5ff6457913a03c1a54a3caa5b1c57",
|
||||
"rev": "5c97fe8af2a2e561f14195ed357d8c451fdbff4c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -576,11 +576,11 @@
|
||||
"secrets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1723385164,
|
||||
"narHash": "sha256-/z4nBwpHsGWl1gmGv7FQQgoOcPwUaVzL7rfjI5nTOLg=",
|
||||
"lastModified": 1724093899,
|
||||
"narHash": "sha256-VohYwTIBq7NEssFibuu+HMXXwuCoLmMOmEwQf7sESSI=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "b47efe67031e12a2d5560b94fdb4de7dca3df80c",
|
||||
"revCount": 24,
|
||||
"rev": "7f5901bb5d6eeaa94d7e1f18f66093be9df014e4",
|
||||
"revCount": 27,
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
||||
},
|
||||
@@ -658,11 +658,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722330636,
|
||||
"narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=",
|
||||
"lastModified": 1724338379,
|
||||
"narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "768acdb06968e53aa1ee8de207fd955335c754b7",
|
||||
"rev": "070f834771efa715f3e74cd8ab93ecc96fabc951",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -112,7 +112,12 @@
|
||||
magicRollback = true;
|
||||
autoRollback = true;
|
||||
sshUser = "root";
|
||||
nodes = lib.genAttrs [ "mail" "pi" "skycam" "vps1" ] mkDeployNode;
|
||||
nodes = lib.genAttrs [
|
||||
"mail"
|
||||
# "pi"
|
||||
# "skycam"
|
||||
"vps1"
|
||||
] mkDeployNode;
|
||||
};
|
||||
|
||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(import ../overlays/gnome)
|
||||
(import ../overlays/gnome.nix)
|
||||
];
|
||||
|
||||
services.printing.enable = true;
|
||||
|
@@ -55,7 +55,7 @@
|
||||
'';
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(import ./../../overlays/libcamera)
|
||||
(import ./../../overlays/libcamera.nix)
|
||||
];
|
||||
|
||||
networking = {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{ config, lib, self, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -37,91 +37,44 @@
|
||||
groups = {
|
||||
jellyfin = { };
|
||||
};
|
||||
extraGroups.acme.members = [ "kanidm" "nginx" ];
|
||||
};
|
||||
|
||||
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
||||
|
||||
services.postgresql = {
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "zitadel";
|
||||
ensureDBOwnership = true;
|
||||
ensureClauses = {
|
||||
superuser = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
ensureDatabases = [ "zitadel" ];
|
||||
security.acme.certs."auth.vimium.com" = {
|
||||
postRun = "systemctl restart kanidm.service";
|
||||
group = "acme";
|
||||
};
|
||||
|
||||
age.secrets."files/services/zitadel/masterkey" = {
|
||||
file = "${self.inputs.secrets}/files/services/zitadel/masterkey.age";
|
||||
owner = "zitadel";
|
||||
group = "zitadel";
|
||||
};
|
||||
|
||||
systemd.services.zitadel = {
|
||||
requires = [ "postgresql.service" ];
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
|
||||
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";
|
||||
services.kanidm = let
|
||||
baseDomain = "vimium.com";
|
||||
domain = "auth.${baseDomain}";
|
||||
uri = "https://${domain}";
|
||||
in {
|
||||
package = pkgs.unstable.kanidm;
|
||||
enableClient = true;
|
||||
enableServer = true;
|
||||
clientSettings = {
|
||||
inherit uri;
|
||||
};
|
||||
steps.FirstInstance = {
|
||||
InstanceName = "Vimium";
|
||||
Org.Name = "Vimium";
|
||||
Org.Human = {
|
||||
UserName = "jordan@vimium.com";
|
||||
FirstName = "Jordan";
|
||||
LastName = "Holt";
|
||||
Email = {
|
||||
Address = "jordan@vimium.com";
|
||||
Verified = true;
|
||||
};
|
||||
Password = "Password1!";
|
||||
PasswordChangeRequired = true;
|
||||
};
|
||||
LoginPolicy.AllowRegister = false;
|
||||
serverSettings = {
|
||||
bindaddress = "[::1]:3013";
|
||||
ldapbindaddress = "[::1]:636";
|
||||
domain = baseDomain;
|
||||
origin = uri;
|
||||
tls_chain = "${config.security.acme.certs.${domain}.directory}/full.pem";
|
||||
tls_key = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."id.vimium.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
extraConfig = ''
|
||||
grpc_pass grpc://localhost:${builtins.toString config.services.zitadel.settings.Port};
|
||||
grpc_set_header Host $host:$server_port;
|
||||
'';
|
||||
services.nginx.virtualHosts = {
|
||||
"auth.vimium.com" = {
|
||||
useACMEHost = "auth.vimium.com";
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "https://[::1]:3013";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -17,7 +17,6 @@ in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
enableJIT = true;
|
||||
initdbArgs = [
|
||||
"--allow-group-access"
|
||||
"--encoding=UTF8"
|
||||
|
@@ -32,6 +32,7 @@
|
||||
./editors/neovim
|
||||
./editors/vscode.nix
|
||||
./hardware/presonus-studio.nix
|
||||
./networking/netbird.nix
|
||||
./networking/tailscale.nix
|
||||
./networking/wireless.nix
|
||||
./security/gpg.nix
|
||||
|
70
modules/networking/netbird.nix
Normal file
70
modules/networking/netbird.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{ config, lib, self, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.networking.netbird;
|
||||
hostname = config.networking.hostName;
|
||||
in {
|
||||
options.modules.networking.netbird = {
|
||||
enable = lib.mkEnableOption "netbird";
|
||||
coordinatorDomain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "netbird.vimium.net";
|
||||
};
|
||||
meshDomain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "mesh.vimium.net";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
age.secrets."passwords/services/netbird/data-store-encryption-key" = {
|
||||
file = "${self.inputs.secrets}/passwords/services/netbird/data-store-encryption-key.age";
|
||||
};
|
||||
|
||||
services.netbird = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.netbird.server = {
|
||||
domain = cfg.coordinatorDomain;
|
||||
enable = true;
|
||||
enableNginx = true;
|
||||
dashboard.settings = {
|
||||
AUTH_AUTHORITY = "https://auth.vimium.com/oauth2/openid/netbird";
|
||||
};
|
||||
management = rec {
|
||||
disableAnonymousMetrics = true;
|
||||
dnsDomain = cfg.meshDomain;
|
||||
oidcConfigEndpoint = "https://auth.vimium.com/oauth2/openid/netbird/.well-known/openid-configuration";
|
||||
settings = {
|
||||
DataStoreEncryptionKey = {
|
||||
_secret = config.age.secrets."passwords/services/netbird/data-store-encryption-key".path;
|
||||
};
|
||||
HttpConfig = {
|
||||
AuthAudience = "netbird";
|
||||
};
|
||||
StoreConfig = { Engine = "sqlite"; };
|
||||
TURNConfig = {
|
||||
Secret._secret = config.age.secrets."passwords/services/coturn/static-auth-secret".path;
|
||||
TimeBasedCredentials = true;
|
||||
};
|
||||
PKCEAuthorizationFlow.ProviderConfig = {
|
||||
AuthorizationEndpoint = "https://auth.vimium.com/ui/oauth2";
|
||||
TokenEndpoint = "https://auth.vimium.com/oauth2/token";
|
||||
};
|
||||
};
|
||||
singleAccountModeDomain = dnsDomain;
|
||||
turnDomain = config.services.coturn.realm;
|
||||
turnPort = config.services.coturn.listening-port;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.netbird-signal.serviceConfig.RestartSec = "60";
|
||||
systemd.services.netbird-management.serviceConfig.RestartSec = "60";
|
||||
|
||||
services.nginx.virtualHosts."netbird.vimium.net" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
};
|
||||
}
|
@@ -171,6 +171,10 @@ in {
|
||||
};
|
||||
} else {});
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"jitsi-meet-1.0.8043"
|
||||
];
|
||||
|
||||
services.matrix-synapse = {
|
||||
enable = true;
|
||||
enableRegistrationScript = true;
|
||||
|
@@ -118,8 +118,12 @@ in {
|
||||
serverAliases = [ "www.jdholt.com" ];
|
||||
extraConfig = nginxErrorPages + nginxEdgeHeaders + nginxStrictHeaders;
|
||||
locations."/skycam/snapshot.jpg" = {
|
||||
proxyPass = "http://skycam.mesh.vimium.net:8080/snapshot";
|
||||
extraConfig = ''
|
||||
set $backend "skycam.mesh.vimium.net:8080";
|
||||
|
||||
resolver 100.100.100.100;
|
||||
|
||||
proxy_pass http://$backend/snapshot;
|
||||
proxy_cache skycam_cache;
|
||||
proxy_cache_valid any 10s;
|
||||
proxy_ignore_headers Cache-Control Expires Set-Cookie;
|
||||
|
@@ -4,7 +4,7 @@ final: prev:
|
||||
mutter = gsuper.mutter.overrideAttrs (oldAttrs: {
|
||||
src = prev.fetchurl {
|
||||
url = "https://gitlab.gnome.org/Community/Ubuntu/mutter/-/archive/triple-buffering-v4-46/mutter-triple-buffering-v4-46.tar.gz";
|
||||
sha256 = "mmFABDsRMzYnLO3+Cf3CJ60XyUBl3y9NAUj+vs7nLqE=";
|
||||
sha256 = "9MVb53tcOTkcXJ025bF2kX1+fGSfffliA43q00x2c/Y=";
|
||||
};
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user