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

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

View file

@ -13,13 +13,7 @@ let
cfg = config.my.services.kdeconnect;
in
{
options.my.services.kdeconnect = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.services.kdeconnect.enable = mkEnableOption "kdeconnect";
config = mkIf cfg.enable {
home-manager.users.moritz.services.kdeconnect.enable = mkIf (!config.my.programs.gnome.enable) true;

View file

@ -9,13 +9,7 @@ let
cfg = config.my.services.mullvad;
in
{
options.my.services.mullvad = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.services.mullvad.enable = mkEnableOption "mullvad";
config = lib.mkIf cfg.enable {
services.mullvad-vpn.enable = true;

View file

@ -9,13 +9,7 @@ let
cfg = config.my.services.openconnect;
in
{
options.my.services.openconnect = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.services.openconnect.enable = mkEnableOption "openconnect";
config = lib.mkIf cfg.enable {
networking.openconnect.interfaces = {

View file

@ -9,13 +9,7 @@ let
cfg = config.my.services.openvpn;
in
{
options.my.services.openvpn = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.services.openvpn.enable = mkEnableOption "openvpn";
config = lib.mkIf cfg.enable {
age.secrets = {

View file

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

View file

@ -5,13 +5,7 @@ let
cfg = config.my.services.printing;
in
{
options.my.services.printing = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.services.printing.enable = mkEnableOption "printing";
config = lib.mkIf cfg.enable {
services = {

View file

@ -5,13 +5,7 @@ let
cfg = config.my.services.redshift;
in
{
options.my.services.redshift = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
options.my.services.redshift.enable = mkEnableOption "redshift";
config = lib.mkIf cfg.enable {
services.redshift.enable = true;