Simplify use of lib

This commit is contained in:
Oliver Davies 2024-12-10 21:40:33 +00:00
parent 3d4bca0ada
commit 0f90bcfd70
25 changed files with 124 additions and 74 deletions

View file

@ -4,10 +4,12 @@
...
}:
{
options.features.desktop.alacritty.enable = lib.mkEnableOption "Enable Alacritty";
with lib;
config = lib.mkIf config.features.desktop.alacritty.enable {
{
options.features.desktop.alacritty.enable = mkEnableOption "Enable Alacritty";
config = mkIf config.features.desktop.alacritty.enable {
programs.alacritty = {
enable = true;

View file

@ -1,9 +1,11 @@
{ config, lib, ... }:
{
options.features.desktop.copyq.enable = lib.mkEnableOption "Enable copyq";
with lib;
config = lib.mkIf config.features.desktop.copyq.enable {
{
options.features.desktop.copyq.enable = mkEnableOption "Enable copyq";
config = mkIf config.features.desktop.copyq.enable {
services.copyq.enable = true;
};
}

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.discord.enable = lib.mkEnableOption "Enable Discord";
with lib;
config = lib.mkIf config.features.desktop.discord.enable {
{
options.features.desktop.discord.enable = mkEnableOption "Enable Discord";
config = mkIf config.features.desktop.discord.enable {
home.packages = with pkgs; [ discord ];
};
}

View file

@ -1,9 +1,11 @@
{ config, lib, ... }:
{
options.features.desktop.espanso.enable = lib.mkEnableOption "Enable espanso";
with lib;
config = lib.mkIf config.features.desktop.espanso.enable {
{
options.features.desktop.espanso.enable = mkEnableOption "Enable espanso";
config = mkIf config.features.desktop.espanso.enable {
services.espanso = {
enable = true;

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.flameshot.enable = lib.mkEnableOption "Enable flameshot";
with lib;
config = lib.mkIf config.features.desktop.flameshot.enable {
{
options.features.desktop.flameshot.enable = mkEnableOption "Enable flameshot";
config = mkIf config.features.desktop.flameshot.enable {
services.flameshot = {
enable = true;

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.gtk.enable = lib.mkEnableOption "Enable gtk";
with lib;
config = lib.mkIf config.features.desktop.gtk.enable {
{
options.features.desktop.gtk.enable = mkEnableOption "Enable gtk";
config = mkIf config.features.desktop.gtk.enable {
gtk = {
enable = true;

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.media.gimp.enable = lib.mkEnableOption "Enable gimp";
with lib;
config = lib.mkIf config.features.desktop.media.gimp.enable {
{
options.features.desktop.media.gimp.enable = mkEnableOption "Enable gimp";
config = mkIf config.features.desktop.media.gimp.enable {
home.packages = with pkgs; [ gimp ];
};
}

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.media.handbrake.enable = lib.mkEnableOption "Enable handbrake";
with lib;
config = lib.mkIf config.features.desktop.media.handbrake.enable {
{
options.features.desktop.media.handbrake.enable = mkEnableOption "Enable handbrake";
config = mkIf config.features.desktop.media.handbrake.enable {
home.packages = with pkgs; [ handbrake ];
};
}

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.media.kdenlive.enable = lib.mkEnableOption "Enable kdenlive";
with lib;
config = lib.mkIf config.features.desktop.media.kdenlive.enable {
{
options.features.desktop.media.kdenlive.enable = mkEnableOption "Enable kdenlive";
config = mkIf config.features.desktop.media.kdenlive.enable {
home.packages = with pkgs; [ kdenlive ];
};
}

View file

@ -1,9 +1,11 @@
{ config, lib, ... }:
{
options.features.desktop.media.mpv.enable = lib.mkEnableOption "Enable mpv media player";
with lib;
config = lib.mkIf config.features.desktop.media.mpv.enable {
{
options.features.desktop.media.mpv.enable = mkEnableOption "Enable mpv media player";
config = mkIf config.features.desktop.media.mpv.enable {
programs.mpv = {
enable = true;

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.media.pocket-casts.enable = lib.mkEnableOption "Enable Pocket Casts";
with lib;
config = lib.mkIf config.features.desktop.media.pocket-casts.enable {
{
options.features.desktop.media.pocket-casts.enable = mkEnableOption "Enable Pocket Casts";
config = mkIf config.features.desktop.media.pocket-casts.enable {
home.packages = with pkgs; [ pocket-casts ];
};
}

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.slack.enable = lib.mkEnableOption "Enable Slack";
with lib;
config = lib.mkIf config.features.desktop.slack.enable {
{
options.features.desktop.slack.enable = mkEnableOption "Enable Slack";
config = mkIf config.features.desktop.slack.enable {
home.packages = with pkgs; [ slack ];
};
}

View file

@ -5,10 +5,12 @@
...
}:
{
options.features.desktop.zoom.enable = lib.mkEnableOption "Enable zoom";
with lib;
config = lib.mkIf config.features.desktop.zoom.enable {
{
options.features.desktop.zoom.enable = mkEnableOption "Enable zoom";
config = mkIf config.features.desktop.zoom.enable {
home.packages = with pkgs; [ nixpkgs-2405.zoom-us ];
};
}