diff --git a/nethack.nix b/nethack.nix index dd3c59c..af7fd73 100644 --- a/nethack.nix +++ b/nethack.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: +{ config, lib, pkgs, ... }: with lib; with types; @@ -56,6 +52,12 @@ in options.programs.nethack = { enable = mkEnableOption "nethack configuration"; + package = mkOption { + type = types.package; + default = pkgs.nethack; + description = "Nethack package to install"; + }; + nethack_options = mkOption { type = attrsOf (oneOf [bool int str]); default = {}; @@ -199,10 +201,20 @@ in }; # }}} - config = { - home.file.".nethackrc" = with config.programs.nethack; { - inherit enable; - text = generateNethackrc config.programs.nethack; + config = let + cfg = config.programs.nethack; + in { + home = { + packages = mkIf cfg.enable [ + cfg.package + ]; + + file = { + ".nethackrc" = { + inherit (cfg) enable; + text = generateNethackrc cfg; + }; + }; }; }; }