diff --git a/flake.nix b/flake.nix index 9c1a76a..96b46c9 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,12 @@ defaultPackage = packages.youmubot; + overlays.default = final: prev: { + youmubot = final.callPackage ./package.nix { + naersk = final.callPackage inputs.naersk { }; + }; + }; + # `nix run` apps.youmubot = flake-utils.lib.mkApp { drv = packages.youmubot; diff --git a/module.nix b/module.nix index b8afb05..720f11a 100644 --- a/module.nix +++ b/module.nix @@ -7,6 +7,10 @@ in { options.services.youmubot = { enable = mkEnableOption "Enable youmubot, the discord bot made with Rust."; + package = mkOption { + type = types.package; + default = youmubot; + }; envFile = mkOption { type = types.path; @@ -35,7 +39,7 @@ in description = "the discord bot made with Rust"; documentation = [ "https://github.com/natsukagami/youmubot" ]; - script = "${youmubot}/bin/youmubot"; + script = "${cfg.package}/bin/youmubot"; environment = { DBPATH = cfg.databasePath;