My Nix Configuration
1{ 2 config, 3 lib, 4 ... 5}: 6let 7 cfg = config.py.services.scrutiny.collector; 8 apiUrl = "https://marvin.${lib.py.data.tsNet}:${toString lib.py.data.services.scrutiny.port}"; 9in 10{ 11 options.py.services.scrutiny = { 12 collector = { 13 enable = lib.mkEnableOption "Scrutiny Collector"; 14 extraSettings = lib.mkOption { 15 type = lib.types.attrs; 16 description = "Extra settings to merge to the default scrutiny collector options"; 17 default = { }; 18 }; 19 }; 20 }; 21 config.services.scrutiny.collector = lib.mkIf cfg.enable { 22 enable = true; 23 settings = { 24 host.id = config.networking.hostName; 25 api.endpoint = apiUrl; 26 } // cfg.extraSettings; 27 }; 28}