feat: Add package option and installation, improve styling
This commit is contained in:
parent
56ff4000d9
commit
8f8ed82ac1
30
nethack.nix
30
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user