feat: Add package option and installation, improve styling

This commit is contained in:
xezo360hye 2024-08-06 17:30:23 +03:00
parent 56ff4000d9
commit 8f8ed82ac1

View File

@ -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;
};
};
};
};
}