Working on reshuffling
This commit is contained in:
+17
-14
@@ -782,28 +782,31 @@ in
|
|||||||
** =generated/modules/apps/zenbrowser.nix=
|
** =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
|
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
|
#+BEGIN_SRC nix :tangle generated/modules/apps/zenbrowser.nix :noweb tangle :mkdirp yes :eval never-html
|
||||||
|
# ./generated/modules/apps/zenbrowser.nix
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
username = "henrov"; # optional, if you want user-specific stuff
|
username = "henrov"; # optional, if you want user-specific stuff
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.mySystem = {
|
# Declare a module option for enabling Zen Browser
|
||||||
apps = {
|
options.mySystem.apps.zenBrowser.enable =
|
||||||
zenBrowser = {
|
lib.mkEnableOption "Enable Zen Browser";
|
||||||
enable = lib.mkEnableOption "Enable Zen Browser";
|
|
||||||
packageRef = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "zen-browser";
|
|
||||||
description = "Package reference for 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) {
|
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
|
#+END_SRC
|
||||||
|
|||||||
@@ -1,24 +1,27 @@
|
|||||||
|
# ./generated/modules/apps/zenbrowser.nix
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
username = "henrov"; # optional, if you want user-specific stuff
|
username = "henrov"; # optional, if you want user-specific stuff
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.mySystem = {
|
# Declare a module option for enabling Zen Browser
|
||||||
apps = {
|
options.mySystem.apps.zenBrowser.enable =
|
||||||
zenBrowser = {
|
lib.mkEnableOption "Enable Zen Browser";
|
||||||
enable = lib.mkEnableOption "Enable Zen Browser";
|
|
||||||
packageRef = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "zen-browser";
|
|
||||||
description = "Package reference for 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) {
|
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}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user