diff --git a/flake.nix b/flake.nix index 9157e0b..94a7871 100644 --- a/flake.nix +++ b/flake.nix @@ -101,6 +101,8 @@ (filter (value: value ? overlays.default)) (map (value: value.overlays.default)) ]; + + nixpkgs.config.allowUnfree = true; # IDGAF anymore. }; homeManagerModule = { lib, ... }: with lib; { diff --git a/modules/discord.nix b/modules/discord.nix index b1fda87..dd0ddda 100644 --- a/modules/discord.nix +++ b/modules/discord.nix @@ -1,9 +1,5 @@ { config, lib, pkgs, ... }: with lib; merge -(desktopSystemConfiguration { - nixpkgs.config.allowUnfree = true; -}) - (desktopUserHomeConfiguration { xdg.configFile."Vencord/settings/quickCss.css".text = config.theme.discordCss; }) diff --git a/modules/endlessh-go.nix b/modules/endlessh-go.nix index ac56d7b..b60da92 100644 --- a/modules/endlessh-go.nix +++ b/modules/endlessh-go.nix @@ -4,20 +4,25 @@ let fakeSSHPort = 22; prometheusPort = 9050; in serverSystemConfiguration { - services.prometheus.scrapeConfigs = [{ - job_name = "endlessh-go"; + services.prometheus = { + exporters.endlessh-go = enabled { + listenAddress = "[::1]"; + port = prometheusPort; + }; - static_configs = [{ - labels.job = "endlessh-go"; - targets = [ - "[::1]:${toString prometheusPort}" - ]; + scrapeConfigs = [{ + job_name = "endlessh-go"; + + static_configs = [{ + labels.job = "endlessh-go"; + targets = [ + "[::1]:${toString prometheusPort}" + ]; + }]; }]; - }]; + }; - nixpkgs.config.allowUnfree = true; # For pkgs.clash-geoip. - - # services.endlessh-go.openFirewall exposes both the Prometheus + # `services.endlessh-go.openFirewall` exposes both the Prometheus # exporters port and the SSH port, and we don't want the metrics # to leak, so we manually expose this like so. networking.firewall.allowedTCPPorts = [ fakeSSHPort ]; @@ -31,10 +36,5 @@ in serverSystemConfiguration { "-geoip_supplier max-mind-db" "-max_mind_db ${pkgs.clash-geoip}/etc/clash/Country.mmdb" ]; - - prometheus = enabled { - listenAddress = "[::1]"; - port = prometheusPort; - }; }; } diff --git a/modules/steam.nix b/modules/steam.nix index 14727b5..9f37d5b 100644 --- a/modules/steam.nix +++ b/modules/steam.nix @@ -3,8 +3,6 @@ (desktopSystemConfiguration { # Steam uses 32-bit drivers for some unholy fucking reason. hardware.opengl.driSupport32Bit = true; - - nixpkgs.config.allowUnfree = true; }) (desktopUserHomePackages (with pkgs; [ diff --git a/options/endlessh-go-exporter-alias.nix b/options/endlessh-go-exporter-alias.nix new file mode 100644 index 0000000..e9e6af4 --- /dev/null +++ b/options/endlessh-go-exporter-alias.nix @@ -0,0 +1,13 @@ +# And yes, I've tried lib.mkAliasOptionModule. +# It doesn't work for a mysterious reason, +# says it can't find `services.prometheus.exporters.endlessh-go`. +# +# This works, however. + +{ config, lib, ... }: { + options.services.prometheus.exporters.endlessh-go = lib.mkOption { + default = {}; + }; + + config.services.endlessh-go.prometheus = config.services.prometheus.exporters.endlessh-go; +}