Reshuffling stuff

This commit is contained in:
2026-03-18 18:45:49 +00:00
parent 5c634c439e
commit b383ea45f3
2 changed files with 11 additions and 41 deletions
+6 -21
View File
@@ -766,27 +766,20 @@ This is top file of this level which contains just an import statement for all r
#+END_SRC
** =generated/modules/apps/packages.nix=
This will import all packages listed in ./assets/system/apps/packlages.conf
This will import all packages listed in ./assets/system/apps/packages.conf
#+BEGIN_SRC nix :tangle generated/modules/apps/packages.nix :noweb tangle :mkdirp yes :eval never-html
{ config, lib, pkgs, flakeRoot, inputs, ... }:
{ config, pkgs, lib, inputs, ... }:
let
# --- Path to your packages.conf ---
packagesConfPath = "${flakeRoot}/assets/conf/apps/packages.conf";
# Gebruik een relatief pad, geen flakeRoot
packagesConfPath = ./assets/system/apps/packages.conf;
# --- Read raw content ---
raw = builtins.readFile packagesConfPath;
# --- Split into lines explicitly on "\n" to avoid accidental char splitting ---
rawLines = lib.splitString "\n" raw;
# --- Guard against accidental character splitting ---
_guard = assert !(
builtins.stringLength raw > 1 &&
builtins.length rawLines == builtins.stringLength raw
); true;
_guard = assert !(builtins.stringLength raw > 1 &&
builtins.length rawLines == builtins.stringLength raw); true;
# --- Clean each line: remove CR, inline comments, trim ---
cleanLine = line:
let
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
@@ -794,10 +787,8 @@ let
in
lib.strings.trim noComment;
# --- Filter empty lines ---
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
# --- Resolve a package name from pkgs ---
resolvePkg = name:
let
parts = lib.splitString "." name;
@@ -813,16 +804,10 @@ let
else
found;
# --- Map entries to actual pkgs ---
packages = builtins.seq _guard (map resolvePkg entries);
# --- Zen Browser package from inputs ---
zenBrowser =
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
in
{
# --- Add the packages to systemPackages ---
environment.systemPackages = packages ++ [ zenBrowser ];
}
#+END_SRC