From 5c0752b891f436dca516f297be59f6b183840361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 15 Oct 2022 20:00:09 +0200 Subject: [PATCH] :sparkles: make use of mkEnableOption --- modules/config/bin/default.nix | 8 +---- modules/config/nix.nix | 19 +++++----- modules/config/theming/default.nix | 6 +--- modules/config/wallpapers.nix | 8 +---- modules/config/yubikey.nix | 8 +---- modules/profiles/base.nix | 11 ++++-- modules/profiles/desktop.nix | 2 +- modules/programs/adb.nix | 8 +---- modules/programs/bspwm/default.nix | 8 +---- modules/programs/code.nix | 9 ++--- modules/programs/default.nix | 1 - modules/programs/direnv.nix | 8 +---- modules/programs/emacs.nix | 9 ++--- modules/programs/email.nix | 25 -------------- modules/programs/firefox.nix | 6 +--- modules/programs/fish.nix | 8 +---- modules/programs/git.nix | 6 +--- modules/programs/gnome.nix | 8 +---- modules/programs/gpg.nix | 9 ++--- modules/programs/helix.nix | 8 +---- modules/programs/hub.nix | 9 ++--- modules/programs/kakoune.nix | 8 +---- modules/programs/kitty.nix | 8 +---- modules/programs/ledger/default.nix | 8 +---- modules/programs/logseq.nix | 8 +---- modules/programs/python.nix | 9 ++++- modules/programs/rofi/default.nix | 42 +---------------------- modules/programs/spotify.nix | 8 +---- modules/programs/sway.nix | 8 +---- modules/programs/thunar.nix | 8 +---- modules/programs/xmonad/default.nix | 8 +---- modules/programs/zathura.nix | 8 +---- modules/programs/zsh.nix | 8 +---- modules/services/dunst.nix | 8 +---- modules/services/kdeconnect.nix | 8 +---- modules/services/mullvad.nix | 8 +---- modules/services/openconnect.nix | 8 +---- modules/services/openvpn.nix | 8 +---- modules/services/picom.nix | 8 +---- modules/services/printing.nix | 8 +---- modules/services/redshift.nix | 8 +---- modules/virtualisation/podman.nix | 8 +---- modules/virtualisation/virtualisation.nix | 15 ++++---- 43 files changed, 73 insertions(+), 329 deletions(-) delete mode 100644 modules/programs/email.nix diff --git a/modules/config/bin/default.nix b/modules/config/bin/default.nix index f001be9..7f4520e 100644 --- a/modules/config/bin/default.nix +++ b/modules/config/bin/default.nix @@ -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; [ diff --git a/modules/config/nix.nix b/modules/config/nix.nix index 5747c41..0dbd9ff 100644 --- a/modules/config/nix.nix +++ b/modules/config/nix.nix @@ -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"; }; diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index 882b3cc..eb9180f 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -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 [ diff --git a/modules/config/wallpapers.nix b/modules/config/wallpapers.nix index 0ea8f62..526a017 100644 --- a/modules/config/wallpapers.nix +++ b/modules/config/wallpapers.nix @@ -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 = { diff --git a/modules/config/yubikey.nix b/modules/config/yubikey.nix index 889c7a5..4695434 100644 --- a/modules/config/yubikey.nix +++ b/modules/config/yubikey.nix @@ -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 ]; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index b41b3ab..d00a341 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -22,6 +22,11 @@ with lib; time.timeZone = "Europe/Berlin"; my = { + nix = { + gc.enable = true; + optimise.enable = true; + }; + bin.enable = true; shell = { abbreviations = { us = "systemctl --user"; @@ -43,10 +48,13 @@ with lib; variables = { EDITOR = "vim"; }; }; programs = { + direnv.enable = true; fish.enable = true; - vim.enable = true; + git.enable = true; + gpg.enable = true; helix.enable = true; kakoune.enable = true; + vim.enable = true; }; }; @@ -82,7 +90,6 @@ with lib; entr exa gparted - hub hut lazygit neofetch diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 63a09b3..d8b8e12 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -23,7 +23,6 @@ with lib; { bspwm.enable = true; code.enable = true; emacs.enable = true; - email.enable = true; firefox = { enable = true; arkenfox = { @@ -119,6 +118,7 @@ with lib; { signal-desktop tlaplusToolbox vlc + thunderbird ]; home-manager.users.moritz = { diff --git a/modules/programs/adb.nix b/modules/programs/adb.nix index e52d43d..c839ce6 100644 --- a/modules/programs/adb.nix +++ b/modules/programs/adb.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.adb; in { - options.my.programs.adb = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.adb.enable = mkEnableOption "adb"; config = mkIf cfg.enable { programs.adb.enable = true; diff --git a/modules/programs/bspwm/default.nix b/modules/programs/bspwm/default.nix index dff5175..ffb5448 100644 --- a/modules/programs/bspwm/default.nix +++ b/modules/programs/bspwm/default.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.bspwm; in { - options.my.programs.bspwm = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.bspwm.enable = mkEnableOption "true"; config = lib.mkIf cfg.enable { services = { diff --git a/modules/programs/code.nix b/modules/programs/code.nix index 0f58530..93cda16 100644 --- a/modules/programs/code.nix +++ b/modules/programs/code.nix @@ -9,13 +9,8 @@ let cfg = config.my.programs.code; in { - options.my.programs.code = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.code.enable = mkEnableOption "code"; + config = mkIf cfg.enable { home-manager.users.moritz = { programs.vscode = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index e72d357..02ef7d9 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -11,7 +11,6 @@ ./code.nix ./direnv.nix ./emacs.nix - ./email.nix ./firefox.nix ./fish.nix ./git.nix diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 83489cc..1235326 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.direnv; in { - options.my.programs.direnv = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.direnv.enable = mkEnableOption "direnv"; config = mkIf cfg.enable { home-manager.users.moritz.programs.direnv = { diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 6544ed9..d9e884c 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -12,13 +12,8 @@ let (epkgs: [ epkgs.vterm ])); in { - options.my.programs.emacs = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.emacs.enable = mkEnableOption "emacs"; + config = mkIf cfg.enable { my.shell.aliases = { emacs = "emacsclient -t -a 'emacs -t'"; diff --git a/modules/programs/email.nix b/modules/programs/email.nix deleted file mode 100644 index 4717780..0000000 --- a/modules/programs/email.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.email; -in -{ - options.my.programs.email = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; - - config = mkIf cfg.enable { - # Email Applications - users.users.moritz.packages = with pkgs; [ thunderbird ]; - networking.firewall.allowedTCPPorts = [ 33728 1025 1143 ]; - }; -} diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index ee4cab0..d0f8e4d 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -12,11 +12,7 @@ let in { options.my.programs.firefox = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; + enable = mkEnableOption "firefox"; arkenfox = { enable = mkEnableOption "arkenfox"; overrides = mkOption { diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 8df6f75..a2d64c8 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -14,13 +14,7 @@ let exportedVariables = lib.concatStringsSep "\n" exportVariables; in { - options.my.programs.fish = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.fish.enable = mkEnableOption "fish"; config = lib.mkIf cfg.enable { # set as default shell diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 46c2885..42497af 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -10,11 +10,7 @@ let in { options.my.programs.git = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; + enable = mkEnableOption "git"; signing = mkOption { default = false; type = types.bool; diff --git a/modules/programs/gnome.nix b/modules/programs/gnome.nix index 8e7c2ee..f60df75 100644 --- a/modules/programs/gnome.nix +++ b/modules/programs/gnome.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.gnome; in { - options.my.programs.gnome = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.gnome.enable = mkEnableOption "gnome"; config = lib.mkIf cfg.enable { hardware = { diff --git a/modules/programs/gpg.nix b/modules/programs/gpg.nix index eb2c845..5371d62 100644 --- a/modules/programs/gpg.nix +++ b/modules/programs/gpg.nix @@ -9,13 +9,8 @@ let cfg = config.my.programs.gpg; in { - options.my.programs.gpg = { - enable = mkOption { - default = true; - type = types.bool; - example = true; - }; - }; + options.my.programs.gpg.enable = mkEnableOption "gpg"; + config = mkIf cfg.enable { home-manager.users.moritz.programs.gpg.enable = true; environment.shellInit = '' diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index 93bb5ab..821a09c 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.helix; in { - options.my.programs.helix = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.helix.enable = mkEnableOption "helix"; config = mkIf cfg.enable { home-manager.users.moritz.programs.helix = { diff --git a/modules/programs/hub.nix b/modules/programs/hub.nix index 8759d23..14b9c60 100644 --- a/modules/programs/hub.nix +++ b/modules/programs/hub.nix @@ -9,13 +9,8 @@ let cfg = config.my.programs.hub; in { - options.my.programs.hub = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.hub.enable = mkEnableOption "hub"; + config = mkIf cfg.enable { age.secrets = { github = { diff --git a/modules/programs/kakoune.nix b/modules/programs/kakoune.nix index a4efa50..874ef2d 100644 --- a/modules/programs/kakoune.nix +++ b/modules/programs/kakoune.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.kakoune; in { - options.my.programs.kakoune = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.kakoune.enable = mkEnableOption "kakoune"; config = mkIf cfg.enable { home-manager.users.moritz = { diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index f55f40f..8ab1958 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.kitty; in { - options.my.programs.kitty = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.kitty.enable = mkEnableOption "kitty"; config = mkIf cfg.enable { my.shell.aliases.ssh = "kitty +kitten ssh"; diff --git a/modules/programs/ledger/default.nix b/modules/programs/ledger/default.nix index 8ed7a1b..348e0e1 100644 --- a/modules/programs/ledger/default.nix +++ b/modules/programs/ledger/default.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.ledger; in { - options.my.programs.ledger = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.ledger.enable = mkEnableOption "ledger"; config = mkIf cfg.enable { my.shell = { diff --git a/modules/programs/logseq.nix b/modules/programs/logseq.nix index 7d6fc03..948e39c 100644 --- a/modules/programs/logseq.nix +++ b/modules/programs/logseq.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.logseq; in { - options.my.programs.logseq = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.logseq.enable = mkEnableOption "logseq"; config = mkIf cfg.enable { users.users.moritz.packages = with pkgs; [ diff --git a/modules/programs/python.nix b/modules/programs/python.nix index 7480cb5..f0dadfb 100644 --- a/modules/programs/python.nix +++ b/modules/programs/python.nix @@ -30,7 +30,14 @@ in example = [ "python39" ]; }; packages = mkOption { - default = [ "isort" "pytest" "flake8" "python-lsp-server" ]; + default = [ + "flake8" + "isort" + "mypy" + "poetry" + "pytest" + "python-lsp-server" + ]; type = with types; listOf (enum commonPackages); }; }; diff --git a/modules/programs/rofi/default.nix b/modules/programs/rofi/default.nix index ec02515..56fa79a 100644 --- a/modules/programs/rofi/default.nix +++ b/modules/programs/rofi/default.nix @@ -7,49 +7,9 @@ with lib; let cfg = config.my.programs.rofi; - - rofi-bluetooth = with pkgs; stdenv.mkDerivation rec { - pname = "rofi-bluetooth"; - version = "unstable-2021-03-05"; - - src = fetchFromGitHub { - repo = pname; - owner = "nickclyde"; - # https://github.com/nickclyde/rofi-bluetooth/issues/19 - rev = "893db1f2b549e7bc0e9c62e7670314349a29cdf2"; - sha256 = "sha256-3oROJKEQCuSnLfbJ+JSSc9hcmJTPrLHRQJsrUcaOMss="; - }; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - runHook preInstall - - install -D --target-directory=$out/bin/ ./rofi-bluetooth - - wrapProgram $out/bin/rofi-bluetooth \ - --prefix PATH ":" ${lib.makeBinPath [ rofi-unwrapped bluez ] } - - runHook postInstall - ''; - - meta = with lib; { - description = "Rofi-based interface to connect to bluetooth devices and display status info"; - homepage = "https://github.com/nickclyde/rofi-bluetooth"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ MoritzBoehme ]; - platforms = platforms.linux; - }; - }; in { - options.my.programs.rofi = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.rofi.enable = mkEnableOption "rofi"; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/programs/spotify.nix b/modules/programs/spotify.nix index 7010d7f..f6d39bd 100644 --- a/modules/programs/spotify.nix +++ b/modules/programs/spotify.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.spotify; in { - options.my.programs.spotify = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.spotify.enable = mkEnableOption "spotify"; config = mkIf cfg.enable { age.secrets.spotifyd = { diff --git a/modules/programs/sway.nix b/modules/programs/sway.nix index a3b6716..f7ae605 100644 --- a/modules/programs/sway.nix +++ b/modules/programs/sway.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.sway; in { - options.my.programs.sway = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.sway.enable = mkEnableOption "sway"; config = lib.mkIf cfg.enable { hardware.opengl = { diff --git a/modules/programs/thunar.nix b/modules/programs/thunar.nix index 99ba7b4..3a6a6c7 100644 --- a/modules/programs/thunar.nix +++ b/modules/programs/thunar.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.thunar; in { - options.my.programs.thunar = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.thunar.enable = mkEnableOption "thunar"; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/programs/xmonad/default.nix b/modules/programs/xmonad/default.nix index dcaab68..80ceb83 100644 --- a/modules/programs/xmonad/default.nix +++ b/modules/programs/xmonad/default.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.xmonad; in { - options.my.programs.xmonad = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.xmonad.enable = mkEnableOption "xmonad"; config = lib.mkIf cfg.enable { services = { diff --git a/modules/programs/zathura.nix b/modules/programs/zathura.nix index 0389b1e..4eb23e3 100644 --- a/modules/programs/zathura.nix +++ b/modules/programs/zathura.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.zathura; in { - options.my.programs.zathura = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.zathura.enable = mkEnableOption "zathura"; config = mkIf cfg.enable { home-manager.users.moritz.programs.zathura = { diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index d5e775b..8088627 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -11,13 +11,7 @@ let shellConfig = config.my.shell; in { - options.my.programs.zsh = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.zsh.enable = mkEnableOption "zsh"; config = lib.mkIf cfg.enable { environment.pathsToLink = [ "/share/zsh" ]; diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index 80b330c..898faaa 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -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 = { diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 6d66419..3ce2e31 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -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; diff --git a/modules/services/mullvad.nix b/modules/services/mullvad.nix index dac4f74..3840016 100644 --- a/modules/services/mullvad.nix +++ b/modules/services/mullvad.nix @@ -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; diff --git a/modules/services/openconnect.nix b/modules/services/openconnect.nix index 8203acb..ad38514 100644 --- a/modules/services/openconnect.nix +++ b/modules/services/openconnect.nix @@ -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 = { diff --git a/modules/services/openvpn.nix b/modules/services/openvpn.nix index 900721f..b0b49bc 100644 --- a/modules/services/openvpn.nix +++ b/modules/services/openvpn.nix @@ -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 = { diff --git a/modules/services/picom.nix b/modules/services/picom.nix index 53b565c..13b0024 100644 --- a/modules/services/picom.nix +++ b/modules/services/picom.nix @@ -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 = { diff --git a/modules/services/printing.nix b/modules/services/printing.nix index fd5e44c..ab7edd9 100644 --- a/modules/services/printing.nix +++ b/modules/services/printing.nix @@ -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 = { diff --git a/modules/services/redshift.nix b/modules/services/redshift.nix index d4878ae..6e75b5e 100644 --- a/modules/services/redshift.nix +++ b/modules/services/redshift.nix @@ -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; diff --git a/modules/virtualisation/podman.nix b/modules/virtualisation/podman.nix index 15c8547..f3fdf35 100644 --- a/modules/virtualisation/podman.nix +++ b/modules/virtualisation/podman.nix @@ -9,13 +9,7 @@ let cfg = config.my.virtualisation.podman; in { - options.my.virtualisation.podman = { - enable = mkOption { - default = false; - type = types.bool; - example = false; - }; - }; + options.my.virtualisation.podman.enable = mkEnableOption "podman"; config = mkIf cfg.enable { virtualisation.podman = { diff --git a/modules/virtualisation/virtualisation.nix b/modules/virtualisation/virtualisation.nix index bd84cda..f51862f 100644 --- a/modules/virtualisation/virtualisation.nix +++ b/modules/virtualisation/virtualisation.nix @@ -9,20 +9,17 @@ let cfg = config.my.virtualisation.libvirtd; in { - options.my.virtualisation.libvirtd = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.virtualisation.libvirtd.enable = mkEnableOption "libvirtd"; config = mkIf cfg.enable { virtualisation.libvirtd = { enable = true; package = pkgs.libvirt; }; - environment.systemPackages = with pkgs; [ virt-manager ]; - users.users.moritz.extraGroups = [ "libvirtd" ]; + + users.users.moritz = { + extraGroups = [ "libvirtd" ]; + packages = with pkgs; [ virt-manager ]; + }; }; }