No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

71 líneas
1.9KB

  1. {
  2. description = "MariaDB flake usage example";
  3. inputs = {
  4. nixpkgs.url = "nixpkgs/nixos-25.11";
  5. sops-nix = {
  6. url = "github:Mic92/sops-nix";
  7. inputs.nixpkgs.follows = "nixpkgs";
  8. };
  9. mariadb-server = {
  10. url = "./services/mariadb/";
  11. inputs.nixpkgs.follows = "nixpkgs";
  12. };
  13. };
  14. outputs = {
  15. self, nixpkgs, sops-nix, mariadb-server, ...
  16. }: {
  17. # Re-export individual modules
  18. nixosModules = {
  19. mariadb = mariadb-server.nixosModules.mariadb;
  20. };
  21. # Convenience module: imports all service modules + sets default config
  22. nixosModules.ogc = {config, lib, ...}:
  23. let
  24. cfg = config.ogc;
  25. in {
  26. imports = [
  27. mariadb-server.nixosModules.mariadb
  28. sops-nix.nixosModules.sops
  29. ];
  30. options.ogc = {
  31. organization = lib.mkOption {
  32. type = lib.types.str;
  33. };
  34. extension = lib.mkOption {
  35. type = lib.types.str;
  36. };
  37. domain = lib.mkOption {
  38. type = lib.types.str;
  39. };
  40. };
  41. config = {
  42. sops = {
  43. defaultSopsFile = ./secrets/ogc.yaml;
  44. # This will automatically import SSH keys as age keys
  45. age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
  46. # This is using an age key that is expected to already be in the filesystem
  47. age.keyFile = "~/.config/sops/age/keys.txt";
  48. # This will generate a new key if the key specified above does not exist
  49. age.generateKey = true;
  50. secrets."mariadb/root" = {};
  51. secrets."mariadb/nextcloud" = {};
  52. };
  53. # MariaDB
  54. mariadb = {
  55. enable = lib.mkDefault true;
  56. rootPasswordFile = lib.mkDefault "/run/secrets/mariadb/root";
  57. nextcloudPasswordFile = lib.mkDefault "/run/secrets/mariadb/nextcloud";
  58. };
  59. };
  60. };
  61. nixosModules.default = self.nixosModules.ogc;
  62. };
  63. }