hm modules: gate behind enable options, always import

This commit is contained in:
müde 2026-05-03 15:19:06 +02:00
parent 6ee82131cd
commit c8cfa37bb9
8 changed files with 67 additions and 36 deletions

View file

@ -18,7 +18,7 @@
};
in
{
enable = mkDefaultEnabledOption "gnome extended options";
enable = lib.mkEnableOption "gnome extended options";
appindicator.enable = mkDefaultEnabledOption "appindicator";
caffeine.enable = mkDefaultEnabledOption "caffeine";
tailscale-qs.enable = lib.mkOption {

View file

@ -1,9 +1,14 @@
{ lib, config, ... }:
{
home = {
sessionVariables.EDITOR = "nano";
file.".nanorc".text = ''
set linenumbers
set mouse
'';
options.my.nano.enable = lib.mkEnableOption "nano editor config";
config = lib.mkIf config.my.nano.enable {
home = {
sessionVariables.EDITOR = "nano";
file.".nanorc".text = ''
set linenumbers
set mouse
'';
};
};
}

View file

@ -1,4 +1,12 @@
{ osConfig, thisDevice, ... }:
{ lib, config, osConfig, thisDevice, ... }:
{
services.tailscale-systray.enable = (thisDevice.isDesktop or false) && osConfig.my.tailscale.enable;
options.my.tailscale.enable = lib.mkOption {
type = lib.types.bool;
default = (thisDevice.isDesktop or false) && osConfig.my.tailscale.enable;
description = "Whether to enable the Tailscale system tray applet. Defaults to true on desktops with Tailscale enabled.";
};
config = lib.mkIf config.my.tailscale.enable {
services.tailscale-systray.enable = true;
};
}

View file

@ -1,12 +1,17 @@
{ lib, config, ... }:
{
home.file = {
"Templates/Empty file".text = "";
"Templates/Empty bash script".text = ''
#!/usr/bin/env bash
# abort on error, undefined variables
set -eu
# print commands before execution
set -x
'';
options.my.templates.enable = lib.mkEnableOption "file templates";
config = lib.mkIf config.my.templates.enable {
home.file = {
"Templates/Empty file".text = "";
"Templates/Empty bash script".text = ''
#!/usr/bin/env bash
# abort on error, undefined variables
set -eu
# print commands before execution
set -x
'';
};
};
}

View file

@ -1,13 +1,18 @@
{ lib, config, ... }:
{
programs = {
command-not-found.enable = true;
dircolors.enable = true;
options.my.zsh.enable = lib.mkEnableOption "zsh with basic settings";
zsh = {
enable = true;
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
enableVteIntegration = true;
config = lib.mkIf config.my.zsh.enable {
programs = {
command-not-found.enable = true;
dircolors.enable = true;
zsh = {
enable = true;
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
enableVteIntegration = true;
};
};
};
}