diff --git a/Droidnix/README.org b/Droidnix/README.org index 2e3a31338..8a13bc581 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -782,31 +782,18 @@ in ** =generated/modules/apps/zenbrowser.nix= This is top file of this level which contains just an import statement for all relevant files and/or the subfolder in this folder #+BEGIN_SRC nix :tangle generated/modules/apps/zenbrowser.nix :noweb tangle :mkdirp yes :eval never-html -# ./generated/modules/apps/zenbrowser.nix -{ config, pkgs, lib, ... }: +{ pkgs, lib, ... }: let - username = "henrov"; # optional, if you want user-specific stuff + packageRef = "zen-browser"; in { - # Declare a module option for enabling Zen Browser options.mySystem.apps.zenBrowser.enable = lib.mkEnableOption "Enable Zen Browser"; - # Declare a module option for the package reference - options.mySystem.apps.zenBrowser.packageRef = - lib.mkOption { - type = lib.types.str; - default = "zen-browser"; - description = "Package reference for Zen Browser"; - }; - - # Apply the configuration if the module is enabled - config = lib.mkIf (config.mySystem.apps.zenBrowser.enable) { - # Add the package to systemPackages - environment.systemPackages = [ - pkgs.${config.mySystem.apps.zenBrowser.packageRef} - ]; + # Top-level config without touching `config` inside + config = lib.mkIf (lib.getOption "mySystem.apps.zenBrowser.enable") { + environment.systemPackages = [ pkgs.${packageRef} ]; }; } #+END_SRC diff --git a/Droidnix/generated/modules/apps/zenbrowser.nix b/Droidnix/generated/modules/apps/zenbrowser.nix index d6bced1b1..432e152af 100644 --- a/Droidnix/generated/modules/apps/zenbrowser.nix +++ b/Droidnix/generated/modules/apps/zenbrowser.nix @@ -1,27 +1,14 @@ -# ./generated/modules/apps/zenbrowser.nix -{ config, pkgs, lib, ... }: +{ pkgs, lib, ... }: let - username = "henrov"; # optional, if you want user-specific stuff + packageRef = "zen-browser"; in { - # Declare a module option for enabling Zen Browser options.mySystem.apps.zenBrowser.enable = lib.mkEnableOption "Enable Zen Browser"; - # Declare a module option for the package reference - options.mySystem.apps.zenBrowser.packageRef = - lib.mkOption { - type = lib.types.str; - default = "zen-browser"; - description = "Package reference for Zen Browser"; - }; - - # Apply the configuration if the module is enabled - config = lib.mkIf (config.mySystem.apps.zenBrowser.enable) { - # Add the package to systemPackages - environment.systemPackages = [ - pkgs.${config.mySystem.apps.zenBrowser.packageRef} - ]; + # Top-level config without touching `config` inside + config = lib.mkIf (lib.getOption "mySystem.apps.zenBrowser.enable") { + environment.systemPackages = [ pkgs.${packageRef} ]; }; }