From 5146328d65063dfc1cfbcd88e4fa8e8632a9062f Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Thu, 19 Mar 2026 07:29:42 +0000 Subject: [PATCH] Working on reshuffling --- Droidnix/README.org | 31 ++++++++++--------- .../generated/modules/apps/zenbrowser.nix | 31 ++++++++++--------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Droidnix/README.org b/Droidnix/README.org index ea44a2d01..e752cd33c 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -782,28 +782,31 @@ 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, ... }: let username = "henrov"; # optional, if you want user-specific stuff in { - options.mySystem = { - apps = { - zenBrowser = { - enable = lib.mkEnableOption "Enable Zen Browser"; - packageRef = lib.mkOption { - type = lib.types.str; - default = "zen-browser"; - description = "Package reference for Zen Browser"; - }; - }; - }; - }; + # Declare a module option for enabling Zen Browser + options.mySystem.apps.zenBrowser.enable = + lib.mkEnableOption "Enable Zen Browser"; - # This is now evaluated with config in scope + # 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) { - environment.systemPackages = [ pkgs.zen-browser ]; + # Add the package to systemPackages + environment.systemPackages = [ + pkgs.${config.mySystem.apps.zenBrowser.packageRef} + ]; }; } #+END_SRC diff --git a/Droidnix/generated/modules/apps/zenbrowser.nix b/Droidnix/generated/modules/apps/zenbrowser.nix index 61a1ff1c2..d6bced1b1 100644 --- a/Droidnix/generated/modules/apps/zenbrowser.nix +++ b/Droidnix/generated/modules/apps/zenbrowser.nix @@ -1,24 +1,27 @@ +# ./generated/modules/apps/zenbrowser.nix { config, pkgs, lib, ... }: let username = "henrov"; # optional, if you want user-specific stuff in { - options.mySystem = { - apps = { - zenBrowser = { - enable = lib.mkEnableOption "Enable Zen Browser"; - packageRef = lib.mkOption { - type = lib.types.str; - default = "zen-browser"; - description = "Package reference for Zen Browser"; - }; - }; - }; - }; + # Declare a module option for enabling Zen Browser + options.mySystem.apps.zenBrowser.enable = + lib.mkEnableOption "Enable Zen Browser"; - # This is now evaluated with config in scope + # 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) { - environment.systemPackages = [ pkgs.zen-browser ]; + # Add the package to systemPackages + environment.systemPackages = [ + pkgs.${config.mySystem.apps.zenBrowser.packageRef} + ]; }; }