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