✨ make use of mkEnableOption
This commit is contained in:
parent
a98589b6f8
commit
5c0752b891
43 changed files with 73 additions and 329 deletions
|
|
@ -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; [
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 [
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue