make use of mkEnableOption

This commit is contained in:
Moritz Böhme 2022-10-15 20:00:09 +02:00
parent a98589b6f8
commit 5c0752b891
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
43 changed files with 73 additions and 329 deletions

View file

@ -14,13 +14,7 @@ let
sxhkdHelp = import ./sxhkdHelp.nix { inherit pkgs; };
in
{
options.my.bin = {
enable = mkOption {
default = true;
type = types.bool;
example = false;
};
};
options.my.bin.enable = mkEnableOption "bin";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [

View file

@ -11,22 +11,21 @@ let
in
{
options.my.nix = {
gc.enable = mkOption {
default = true;
type = types.bool;
example = false;
};
optimise.enable = mkOption {
default = true;
type = types.bool;
example = false;
gc = {
enable = mkEnableOption "nix-gc";
minimumFreedGB = mkOption {
default = 32;
type = types.int;
apply = number: toString (number * 1024 * 1024 * 1024);
};
};
optimise.enable = mkEnableOption "nix-optimise";
};
config.nix = {
gc = {
automatic = cfg.gc.enable;
options = "--max-freed $((32 * 1024**3)) --delete-older-than 14d";
options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d";
dates = "weekly";
};

View file

@ -19,11 +19,7 @@ in
];
options.my.theming = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
enable = mkEnableOption "theming";
scheme = mkOption {
default = "catppuccin-macchiato";
type = types.enum [

View file

@ -9,13 +9,7 @@ let
cfg = config.my.wallpapers;
in
{
options.my.wallpapers = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.wallpapers.enable = mkEnableOption "wallpapers";
config = mkIf cfg.enable {
home-manager.users.moritz.xdg = {

View file

@ -9,13 +9,7 @@ let
cfg = config.my.yubikey;
in
{
options.my.yubikey = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.yubikey = mkEnableOption "yubikey";
config = {
services.udev.packages = [ pkgs.yubikey-personalization ];