use namespace for my options

This commit is contained in:
Osman Faruk Bayram 2025-02-04 23:53:13 +03:00
parent 64fcba43f0
commit 1b1e7f792f
9 changed files with 49 additions and 50 deletions

View file

@ -5,7 +5,7 @@
...
}: {
options = {
arduinoSetup = lib.mkOption {
myModules.arduinoSetup = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Installs arduino-ide and adafruit-nrfutil and sets udev rules";
@ -13,7 +13,7 @@
};
config = lib.mkMerge [
(lib.mkIf config.arduinoSetup {
(lib.mkIf config.myModules.arduinoSetup {
environment.systemPackages = with pkgs; [
arduino-ide
adafruit-nrfutil

View file

@ -5,25 +5,27 @@
...
}: {
options = {
blockYoutube = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Disables youtube using /etc/hosts file";
};
blockTwitter = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Disables twitter using /etc/hosts file";
};
blockBluesky = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Disables bluesky using /etc/hosts file";
myModules = {
blockYoutube = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Disables youtube using /etc/hosts file";
};
blockTwitter = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Disables twitter using /etc/hosts file";
};
blockBluesky = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Disables bluesky using /etc/hosts file";
};
};
};
config = lib.mkMerge [
(lib.mkIf config.blockYoutube {
(lib.mkIf config.myModules.blockYoutube {
networking.extraHosts = ''
0.0.0.0 youtube.com
::0 youtube.com
@ -32,7 +34,7 @@
::0 www.youtube.com
'';
})
(lib.mkIf config.blockTwitter {
(lib.mkIf config.myModules.blockTwitter {
networking.extraHosts = ''
0.0.0.0 twitter.com
::0 twitter.com
@ -41,7 +43,7 @@
::0 www.twitter.com
'';
})
(lib.mkIf config.blockBluesky {
(lib.mkIf config.myModules.blockBluesky {
networking.extraHosts = ''
0.0.0.0 bsky.app
::0 bsky.app

View file

@ -5,7 +5,7 @@
...
}: {
options = {
enableFonts = lib.mkOption {
myModules.enableFonts = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable my favorite fonts";
@ -13,7 +13,7 @@
};
config = lib.mkMerge [
(lib.mkIf config.enableFonts {
(lib.mkIf config.myModules.enableFonts {
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans

View file

@ -5,7 +5,7 @@
...
}: {
options = {
enableKDE = lib.mkOption {
myModules.enableKDE = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable KDE Plasma Desktop Environment with my favorite packages";
@ -13,7 +13,7 @@
};
config = lib.mkMerge [
(lib.mkIf config.enableKDE {
(lib.mkIf config.myModules.enableKDE {
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true;

View file

@ -5,7 +5,7 @@
...
}: {
options = {
enableTailscale = lib.mkOption {
myModules.enableTailscale = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable Tailscale VPN";
@ -19,7 +19,7 @@
# and i have a laptop named tartarus
config = lib.mkMerge [
(lib.mkIf config.enableTailscale {
(lib.mkIf config.myModules.enableTailscale {
services.tailscale = {
enable = true;
port = 51513;