From 3dda311dbda394c65454ba8be4ec6215b52b083f Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Thu, 19 Mar 2026 09:21:04 +0000 Subject: [PATCH] Working on reshuffling --- Droidnix/README.org | 181 ++++++++++-------- Droidnix/generated/hosts/traveldroid/nix.nix | 19 +- .../generated/modules/apps/emacs/emacs.nix | 147 +++++++------- Droidnix/generated/modules/apps/wofi.nix | 15 +- 4 files changed, 202 insertions(+), 160 deletions(-) diff --git a/Droidnix/README.org b/Droidnix/README.org index 88a87df30..423dce8a5 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -360,19 +360,26 @@ let coreEnabled = config.mySystem.system.core.enable or false; in { + # Top-level option for this module options.mySystem.system.locale.enable = - lib.mkEnableOption "Flake & Nix settings"; + lib.mkEnableOption "Enable Nix & Flake specific settings"; + # Top-level container for all custom program configs (your myPrograms idea) + options.myPrograms = lib.mkOption { + type = lib.types.attrsOf lib.types.any; + default = {}; + description = "Container for all custom program configurations"; + }; + + # Apply the configuration only if core or locale is enabled config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) { - - # --- Flakes & Nix Settings --- nix.settings = { experimental-features = [ "nix-command" "flakes" ]; download-buffer-size = 536870912; # 512 MB - cores = 2; - max-jobs = 1; - }; + cores = 2; + max-jobs = 1; }; + }; } #+END_SRC @@ -1411,84 +1418,87 @@ This sets up the emacs terminal #+BEGIN_SRC nix :tangle generated/modules/apps/emacs/emacs.nix :noweb tangle :mkdirp yes :eval never-html { lib, ... }: +let + enableEmacs = true; # Toggle to enable/disable Emacs module +in { - flake.nixosModules.emacs = { config, pkgs, lib, ... }: + # Top-level option to enable Emacs + options.enableEmacs = lib.mkEnableOption "Enable Emacs configuration"; - { - # Optie om de module aan/uit te zetten - options.mySystem.system.emacs.enable = lib.mkEnableOption "Enable Emacs config"; + # Module configuration wrapped safely with mkIf + config = lib.mkIf enableEmacs { + myApps = { + emacs = { + enable = true; - config = lib.mkIf (config.mySystem.system.emacs.enable or false) { - # System packages (optioneel) - environment.systemPackages = with pkgs; [ - # Voeg systeem-brede packages toe als je wilt - ]; + # Home Manager user (top-level default can be used) + user = config.defaultUser or "henrov"; - # Home Manager configuratie - home-manager.users.henrov = { - programs.emacs = { - enable = true; - package = pkgs.emacs-pgtk.override { withTreeSitter = true; }; - - extraPackages = epkgs: with epkgs; [ - # Tree-sitter and language support - manualPackages.treesit-grammars.with-all-grammars - rust-mode - rustic - nix-mode - hcl-mode - - # UI/UX and navigation - nerd-icons - doom-modeline - diminish - eldoc - eldoc-box - pulsar - which-key - avy - consult - vertico - marginalia - crux - shell-pop - - # Completion and snippets - nerd-icons-corfu - corfu - cape - orderless - yasnippet - yasnippet-snippets - - # Utilities and tools - rg - exec-path-from-shell - eat - f - gptel - nixpkgs-fmt - envrc - - # Theming - catppuccin-theme - - # Git - magit - - # Editing and workflow - expreg - vundo - puni - - # Error and side panel support - sideline - sideline-flymake - sideline-eglot - ]; + # Emacs package specification and extra packages + package = { + name = "emacs-pgtk"; + withTreeSitter = true; }; - home.sessionVariables = { + extraPackages = [ + # Tree-sitter and language support + "manualPackages.treesit-grammars.with-all-grammars" + "rust-mode" + "rustic" + "nix-mode" + "hcl-mode" + + # UI/UX and navigation + "nerd-icons" + "doom-modeline" + "diminish" + "eldoc" + "eldoc-box" + "pulsar" + "which-key" + "avy" + "consult" + "vertico" + "marginalia" + "crux" + "shell-pop" + + # Completion and snippets + "nerd-icons-corfu" + "corfu" + "cape" + "orderless" + "yasnippet" + "yasnippet-snippets" + + # Utilities and tools + "rg" + "exec-path-from-shell" + "eat" + "f" + "gptel" + "nixpkgs-fmt" + "envrc" + + # Theming + "catppuccin-theme" + + # Git + "magit" + + # Editing and workflow + "expreg" + "vundo" + "puni" + + # Error and side panel support + "sideline" + "sideline-flymake" + "sideline-eglot" + ]; + + # Optional environment/session variables + sessionVariables = { EDITOR = "emacs"; XDG_SCREENSHOTS_DIR = "~/screenshots"; }; @@ -2006,27 +2016,38 @@ the top of the file." ** =generated/modules/apps/wofi.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/wofi.nix :noweb tangle :mkdirp yes :eval never-html -# wofi.nix -{ lib, ... }: +{ lib, config, ... }: let + # Path to your configuration assets wofiAssets = ../../../assets/system/conf/wofi; + + # Read the files in that directory wofiFiles = builtins.readDir wofiAssets; + + # Build an attribute set mapping filenames to their full paths wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: { src = "${wofiAssets}/${name}"; }); + # Toggle for enabling Wofi enableWofi = true; in { + # Module option to enable/disable Wofi options.enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher"; + # Everything in config is wrapped safely with mkIf config = lib.mkIf enableWofi { + # Use myApps as a container for all your programs myApps = { wofi = { enable = true; assetsDir = wofiAssets; files = wofiConfs; + + # Example: you could reference a top-level user option + user = config.defaultUser or "henrov"; }; }; }; diff --git a/Droidnix/generated/hosts/traveldroid/nix.nix b/Droidnix/generated/hosts/traveldroid/nix.nix index 733fd122c..e26960407 100644 --- a/Droidnix/generated/hosts/traveldroid/nix.nix +++ b/Droidnix/generated/hosts/traveldroid/nix.nix @@ -4,17 +4,24 @@ let coreEnabled = config.mySystem.system.core.enable or false; in { + # Top-level option for this module options.mySystem.system.locale.enable = - lib.mkEnableOption "Flake & Nix settings"; + lib.mkEnableOption "Enable Nix & Flake specific settings"; + # Top-level container for all custom program configs (your myPrograms idea) + options.myPrograms = lib.mkOption { + type = lib.types.attrsOf lib.types.any; + default = {}; + description = "Container for all custom program configurations"; + }; + + # Apply the configuration only if core or locale is enabled config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) { - - # --- Flakes & Nix Settings --- nix.settings = { experimental-features = [ "nix-command" "flakes" ]; download-buffer-size = 536870912; # 512 MB - cores = 2; - max-jobs = 1; - }; + cores = 2; + max-jobs = 1; }; + }; } diff --git a/Droidnix/generated/modules/apps/emacs/emacs.nix b/Droidnix/generated/modules/apps/emacs/emacs.nix index 0ca795268..4529790bd 100644 --- a/Droidnix/generated/modules/apps/emacs/emacs.nix +++ b/Droidnix/generated/modules/apps/emacs/emacs.nix @@ -1,83 +1,86 @@ { lib, ... }: +let + enableEmacs = true; # Toggle to enable/disable Emacs module +in { - flake.nixosModules.emacs = { config, pkgs, lib, ... }: + # Top-level option to enable Emacs + options.enableEmacs = lib.mkEnableOption "Enable Emacs configuration"; - { - # Optie om de module aan/uit te zetten - options.mySystem.system.emacs.enable = lib.mkEnableOption "Enable Emacs config"; + # Module configuration wrapped safely with mkIf + config = lib.mkIf enableEmacs { + myApps = { + emacs = { + enable = true; - config = lib.mkIf (config.mySystem.system.emacs.enable or false) { - # System packages (optioneel) - environment.systemPackages = with pkgs; [ - # Voeg systeem-brede packages toe als je wilt - ]; + # Home Manager user (top-level default can be used) + user = config.defaultUser or "henrov"; - # Home Manager configuratie - home-manager.users.henrov = { - programs.emacs = { - enable = true; - package = pkgs.emacs-pgtk.override { withTreeSitter = true; }; - - extraPackages = epkgs: with epkgs; [ - # Tree-sitter and language support - manualPackages.treesit-grammars.with-all-grammars - rust-mode - rustic - nix-mode - hcl-mode - - # UI/UX and navigation - nerd-icons - doom-modeline - diminish - eldoc - eldoc-box - pulsar - which-key - avy - consult - vertico - marginalia - crux - shell-pop - - # Completion and snippets - nerd-icons-corfu - corfu - cape - orderless - yasnippet - yasnippet-snippets - - # Utilities and tools - rg - exec-path-from-shell - eat - f - gptel - nixpkgs-fmt - envrc - - # Theming - catppuccin-theme - - # Git - magit - - # Editing and workflow - expreg - vundo - puni - - # Error and side panel support - sideline - sideline-flymake - sideline-eglot - ]; + # Emacs package specification and extra packages + package = { + name = "emacs-pgtk"; + withTreeSitter = true; }; - home.sessionVariables = { + extraPackages = [ + # Tree-sitter and language support + "manualPackages.treesit-grammars.with-all-grammars" + "rust-mode" + "rustic" + "nix-mode" + "hcl-mode" + + # UI/UX and navigation + "nerd-icons" + "doom-modeline" + "diminish" + "eldoc" + "eldoc-box" + "pulsar" + "which-key" + "avy" + "consult" + "vertico" + "marginalia" + "crux" + "shell-pop" + + # Completion and snippets + "nerd-icons-corfu" + "corfu" + "cape" + "orderless" + "yasnippet" + "yasnippet-snippets" + + # Utilities and tools + "rg" + "exec-path-from-shell" + "eat" + "f" + "gptel" + "nixpkgs-fmt" + "envrc" + + # Theming + "catppuccin-theme" + + # Git + "magit" + + # Editing and workflow + "expreg" + "vundo" + "puni" + + # Error and side panel support + "sideline" + "sideline-flymake" + "sideline-eglot" + ]; + + # Optional environment/session variables + sessionVariables = { EDITOR = "emacs"; XDG_SCREENSHOTS_DIR = "~/screenshots"; }; diff --git a/Droidnix/generated/modules/apps/wofi.nix b/Droidnix/generated/modules/apps/wofi.nix index 84a4243dd..da12b86ba 100644 --- a/Droidnix/generated/modules/apps/wofi.nix +++ b/Droidnix/generated/modules/apps/wofi.nix @@ -1,24 +1,35 @@ -# wofi.nix -{ lib, ... }: +{ lib, config, ... }: let + # Path to your configuration assets wofiAssets = ../../../assets/system/conf/wofi; + + # Read the files in that directory wofiFiles = builtins.readDir wofiAssets; + + # Build an attribute set mapping filenames to their full paths wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: { src = "${wofiAssets}/${name}"; }); + # Toggle for enabling Wofi enableWofi = true; in { + # Module option to enable/disable Wofi options.enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher"; + # Everything in config is wrapped safely with mkIf config = lib.mkIf enableWofi { + # Use myApps as a container for all your programs myApps = { wofi = { enable = true; assetsDir = wofiAssets; files = wofiConfs; + + # Example: you could reference a top-level user option + user = config.defaultUser or "henrov"; }; }; };