Skip to content

Commit

Permalink
Updated to nixos 23.11 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding authored and tanneberger committed Jan 5, 2024
1 parent 1cfcf56 commit f8d73e5
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 62 deletions.
76 changes: 31 additions & 45 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "dresden internet exchange nixos config";

inputs = {
nixpkgs.url = "github:revol-xut/nixpkgs/listmonk-patch-tassilo";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";

presence = {
url = "github:dd-ix/presence";
Expand All @@ -22,6 +22,7 @@
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};

keycloak-theme = {
Expand Down
11 changes: 4 additions & 7 deletions modules/management/keycloak.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ pkgs, config, lib, ... }:
let
database_name = "keycloak";
username = "keycloak";
http_port = 5000;
in
{
Expand All @@ -17,10 +16,8 @@ in
ensureDatabases = [ database_name ];
ensureUsers = [
{
name = username;
ensurePermissions = {
"DATABASE ${database_name}" = "ALL PRIVILEGES";
};
name = database_name;
ensureDBOwnership = true;
}
];
};
Expand All @@ -33,7 +30,7 @@ in
host = "127.0.0.1";
port = config.services.postgresql.port;
name = database_name;
username = username;
username = database_name;
passwordFile = config.sops.secrets.postgres_keycloak.path;
useSSL = false;
};
Expand Down Expand Up @@ -96,7 +93,7 @@ in

path = [ pkgs.sudo config.services.postgresql.package ];
script = ''
sudo -u ${config.services.postgresql.superUser} psql -c "ALTER ROLE ${username} WITH PASSWORD '$(cat ${config.sops.secrets.postgres_keycloak.path})'"
sudo -u ${config.services.postgresql.superUser} psql -c "ALTER ROLE ${database_name} WITH PASSWORD '$(cat ${config.sops.secrets.postgres_keycloak.path})'"
'';
};
}
4 changes: 1 addition & 3 deletions modules/management/netbox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
ensureUsers = [
{
name = "netbox";
ensurePermissions = {
"DATABASE netbox" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
}
];
ensureDatabases = [ "netbox" ];
Expand Down
4 changes: 1 addition & 3 deletions modules/management/nextcloud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ in
ensureUsers = [
{
name = "nextcloud";
ensurePermissions = {
"DATABASE nextcloud" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
}
];
ensureDatabases = [ "nextcloud" ];
Expand Down
4 changes: 1 addition & 3 deletions modules/management/vaultwarden.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
ensureUsers = [
{
name = "vaultwarden";
ensurePermissions = {
"DATABASE vaultwarden" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
}
];
ensureDatabases = [ "vaultwarden" ];
Expand Down

0 comments on commit f8d73e5

Please sign in to comment.