Non stop entertainment! The wackiest NixOS configuration to-date. thevoid.cafe/projects/puzzlevision
nixos flake flake-parts dotfiles home-manager nix

✨🚧 Add mkService helper

thevoid.cafe 5dc4ddb4 3818dd25

verified
+18 -1
+18 -1
lib/options/default.nix
··· 15 15 inherit default description; 16 16 type = lib.types.bool; 17 17 }; 18 + 19 + # Create a full service option definition 20 + mkService = 21 + name: 22 + { 23 + subdomain ? name, 24 + sopsFile ? null, 25 + sopsFormat ? "dotenv", 26 + extraOptions ? { }, 27 + }: 28 + { 29 + enable = lib.mkEnableOption "${name} service."; 30 + sopsFile = mkOpt (lib.types.nullOr lib.types.path) sopsFile "Sops secret file for ${name}."; 31 + sopsFormat = mkOpt lib.types.str sopsFormat "Sops secret file format for ${name}."; 32 + subdomain = mkOpt lib.types.str subdomain "Subdomain to expose ${name} on."; 33 + } 34 + // extraOptions; 18 35 in 19 36 { 20 - options = { inherit mkOpt mkBool; }; 37 + options = { inherit mkOpt mkBool mkService; }; 21 38 }