Skip to content

Commit

Permalink
fix module invocation: revert to passing flake as argument, add packa…
Browse files Browse the repository at this point in the history
…ge option with default from flake
  • Loading branch information
jurraca committed Feb 7, 2025
1 parent 0c038a2 commit d5bd6cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
default = kartograf;
});

nixosModules.default = import ./nix/module.nix;
nixosModules.kartograf = import ./nix/module.nix self;
};
}
9 changes: 7 additions & 2 deletions nix/module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
flake: { config, pkgs, lib, ... }:

with lib;

Expand All @@ -16,6 +16,11 @@ in
{
options.services.kartograf = {
enable = mkEnableOption "kartograf";
package = mkOption {
type = types.package;
default = (flake.packages.${pkgs.stdenv.hostPlatform.system}).kartograf;
description = mdDoc "kartograf binary to use";
};
clean = mkEnableOption "cleaning up of temporary artifacts after processing." // { default = true; };
useIRR = mkEnableOption "using Internet Routing Registry (IRR) data" // { default = true; };
useRV = mkEnableOption "using RouteViews (RV) data" // { default = true; };
Expand Down Expand Up @@ -59,7 +64,7 @@ in
serviceConfig = {
Environment = "PYTHONUNBUFFERED=1";
ExecStopPost = "${postScript}/bin/post-script";
ExecStart = ''${kartograf}/bin/kartograf map \
ExecStart = ''${cfg.package}/bin/kartograf map \
${optionalString cfg.clean "--cleanup" } \
${optionalString cfg.useIRR "--irr" } \
${optionalString cfg.useRV "--routeviews" } \
Expand Down

0 comments on commit d5bd6cc

Please sign in to comment.