set age key dir to be in persist dir
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
systemd.services.launchAuthentik = {
|
||||
|
||||
enable = true;
|
||||
enable = false;
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
|
||||
@@ -7,34 +7,20 @@
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.virtualization.gitlab.enable {
|
||||
|
||||
sops.secrets."gitlab/db_pass" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/root_pass" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/secrets/secret" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/secrets/otp" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/secrets/db" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/secrets/jws" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/oidc/id" = {
|
||||
owner = "sshd";
|
||||
};
|
||||
sops.secrets."gitlab/oidc/secret" = {
|
||||
owner = "sshd";
|
||||
sops.secrets = {
|
||||
"gitlab/db_pass" = {};
|
||||
"gitlab/root_pass" = {};
|
||||
"gitlab/secrets/secret" = {};
|
||||
"gitlab/secrets/otp" = {};
|
||||
"gitlab/secrets/db" = {};
|
||||
"gitlab/secrets/jws" = {};
|
||||
"gitlab/oidc/id" = {};
|
||||
"gitlab/oidc/secret" = {};
|
||||
};
|
||||
|
||||
containers.gitlab = {
|
||||
|
||||
autoStart = false;
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "192.168.100.10";
|
||||
localAddress = "192.168.100.16";
|
||||
@@ -43,51 +29,49 @@
|
||||
hostPath = "/ssd1/Gitlab/data";
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/dbpass" = {
|
||||
hostPath = config.sops.secrets."gitlab/db_pass".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/rootpass" = {
|
||||
hostPath = config.sops.secrets."gitlab/root_pass".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/db" = {
|
||||
hostPath = config.sops.secrets."gitlab/secrets/db".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/secret" = {
|
||||
hostPath = config.sops.secrets."gitlab/secrets/secret".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/jws" = {
|
||||
hostPath = config.sops.secrets."gitlab/secrets/jws".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/otp" = {
|
||||
hostPath = config.sops.secrets."gitlab/secrets/otp".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/oidc-id" = {
|
||||
hostPath = config.sops.secrets."gitlab/oidc/id".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/gitlab/oidc-secret" = {
|
||||
hostPath = config.sops.secrets."gitlab/oidc/secret".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
extraFlags = [
|
||||
"--load-credential=dbpass:${config.sops.secrets."gitlab/db_pass".path}"
|
||||
"--load-credential=rootpass:${config.sops.secrets."gitlab/root_pass".path}"
|
||||
"--load-credential=secret:${config.sops.secrets."gitlab/secrets/secret".path}"
|
||||
"--load-credential=otp:${config.sops.secrets."gitlab/secrets/otp".path}"
|
||||
"--load-credential=db:${config.sops.secrets."gitlab/secrets/db".path}"
|
||||
"--load-credential=jws:${config.sops.secrets."gitlab/secrets/jws".path}"
|
||||
"--load-credential=oidc_id:${config.sops.secrets."gitlab/oidc/id".path}"
|
||||
"--load-credential=oidc_secret:${config.sops.secrets."gitlab/oidc/secret".path}"
|
||||
];
|
||||
config = {
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"z /etc/gitlab/dbpass - gitlab gitlab"
|
||||
"z /etc/gitlab/rootpass - gitlab gitlab"
|
||||
"z /etc/gitlab/db - gitlab gitlab"
|
||||
"z /etc/gitlab/secret - gitlab gitlab"
|
||||
"z /etc/gitlab/jws - gitlab gitlab"
|
||||
"z /etc/gitlab/otp - gitlab gitlab"
|
||||
"z /etc/gitlab/oidc-id - gitlab gitlab"
|
||||
"z /etc/gitlab/oidc-secret - gitlab gitlab"
|
||||
];
|
||||
systemd.services.secrets_setup = {
|
||||
wantedBy = [ "gitlab.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
LoadCredential = [
|
||||
"dbpass"
|
||||
"rootpass"
|
||||
"secret"
|
||||
"db"
|
||||
"otp"
|
||||
"jws"
|
||||
"oidc_id"
|
||||
"oidc_secret"
|
||||
];
|
||||
};
|
||||
|
||||
script = ''
|
||||
cat ''${CREDENTIALS_DIRECTORY}/dbpass > /etc/gitlab/dbpass
|
||||
cat ''${CREDENTIALS_DIRECTORY}/rootpass > /etc/gitlab/rootpass
|
||||
cat ''${CREDENTIALS_DIRECTORY}/secret > /etc/gitlab/secret
|
||||
cat ''${CREDENTIALS_DIRECTORY}/db > /etc/gitlab/db
|
||||
cat ''${CREDENTIALS_DIRECTORY}/otp > /etc/gitlab/otp
|
||||
cat ''${CREDENTIALS_DIRECTORY}/jws > /etc/gitlab/jws
|
||||
cat ''${CREDENTIALS_DIRECTORY}/oidc_id > /etc/gitlab/oidc-id
|
||||
cat ''${CREDENTIALS_DIRECTORY}/oidc_secret > /etc/gitlab/oidc-secret
|
||||
|
||||
chown gitlab:gitlab /etc/gitlab/*
|
||||
'';
|
||||
};
|
||||
|
||||
services.gitlab = {
|
||||
enable = true;
|
||||
@@ -162,7 +146,7 @@
|
||||
systemd.services.gitlab-backup.environment.BACKUP = "dump";
|
||||
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
|
||||
networking.firewall.allowedTCPPorts = [ 22 80 ];
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
containers.nextcloud = {
|
||||
|
||||
autoStart = false;
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "192.168.100.10";
|
||||
localAddress = "192.168.100.15";
|
||||
@@ -48,47 +48,70 @@
|
||||
bindMounts = {
|
||||
|
||||
"/etc/nextcloud" = {
|
||||
hostPath = "/ssd1/Nextcloud";
|
||||
hostPath = "/ssd1/Nextcloud/data";
|
||||
isReadOnly = false;
|
||||
};
|
||||
|
||||
"/etc/nextcloud-admin-pass" = {
|
||||
hostPath = config.sops.secrets."nextcloud/pass".path;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
extraFlags = [
|
||||
"--load-credential=nextcloud-admin-pass:${config.sops.secrets."nextcloud/pass".path}"
|
||||
];
|
||||
|
||||
config = { config, lib, pkgs, ... }: {
|
||||
|
||||
/*systemd.tmpfiles.rules = [
|
||||
"Z /etc/nextcloud - nextcloud nextcloud"
|
||||
];*/
|
||||
|
||||
systemd.services.secrets_setup = {
|
||||
wantedBy = [ "nextcloud-setup.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
LoadCredential = [
|
||||
"nextcloud-admin-pass"
|
||||
];
|
||||
};
|
||||
|
||||
script = ''
|
||||
cat $CREDENTIALS_DIRECTORY/nextcloud-admin-pass > /etc/nextcloud-admin-pass
|
||||
chown nextcloud:nextcloud /etc/nextcloud-admin-pass
|
||||
'';
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
services.nginx.virtualHosts."192.168.100.15".listen = [ { addr = "0.0.0.0"; port = 80; } ];
|
||||
services.nginx = {
|
||||
virtualHosts."192.168.100.15".listen = [ { addr = "0.0.0.0"; port = 80; } ];
|
||||
user = "nextcloud";
|
||||
group = "nextcloud";
|
||||
};
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud30;
|
||||
hostName = "localhost";
|
||||
hostName = "192.168.100.15";
|
||||
config = {
|
||||
adminpassFile = "/etc/nextcloud-admin-pass";
|
||||
adminuser = "root";
|
||||
dbtype = "mysql";
|
||||
};
|
||||
https = true;
|
||||
datadir = "/ssd1/Nextcloud/data";
|
||||
home = "/ssd1/Nextcloud/nextcloud_home";
|
||||
appstoreEnable = true;
|
||||
#datadir = "/etc/nextcloud/data";
|
||||
#home = "/etc/nextcloud/nextcloud_home";
|
||||
#appstoreEnable = true;
|
||||
extraApps = with config.services.nextcloud.package.packages.apps; {
|
||||
inherit mail contacts calendar tasks user_oidc;
|
||||
};
|
||||
extraAppsEnable = true;
|
||||
settings = {
|
||||
overwriteprotocol = "https";
|
||||
trusted_domains = [ "nextcloud.blunkall.us" "dummy.blunkall.us" ];
|
||||
trusted_domains = [ "nextcloud.blunkall.us" ];
|
||||
trusted_proxies = [ "192.168.100.11" ];
|
||||
default_phone_region = "US";
|
||||
};
|
||||
database.createLocally = true;
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
system.stateVersion = "24.05";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
};
|
||||
systemd.services.launchPihole = {
|
||||
|
||||
enable = true;
|
||||
enable = false;
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
pihole.loadBalancer.servers = [ { url = "http://192.168.100.10:8080"; } ];
|
||||
|
||||
nextcloud.loadBalancer.servers = [ { url = "http://192.168.100.10:8081"; } ];
|
||||
nextcloud.loadBalancer.servers = [ { url = "http://192.168.100.15:80"; } ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user