Files
nixos/Droidnix/generated/modules/apps/packages.nix
T
2026-03-18 18:27:00 +00:00

34 lines
900 B
Nix

# ./modules/apps/packages.nix
{ lib, config, flakeRoot, ... }:
let
packagesConfPath = "${flakeRoot}/assets/system/apps/packages.conf";
raw = builtins.readFile packagesConfPath;
# split lines safely
rawLines = lib.splitString "\n" raw;
# guard against accidental character splitting
_guard = assert !(
builtins.stringLength raw > 1 &&
builtins.length rawLines == builtins.stringLength raw
); true;
# clean a line (remove CR, inline comments, whitespace)
cleanLine = line:
let
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
noInlineComment = lib.head (lib.splitString "#" noCR);
in
lib.strings.trim noInlineComment;
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
in {
# --- symbolic config only ---
mySystem.apps.packages = {
enable = true;
packageNames = entries; # just the names, no pkgs references
};
}