Regenerated

This commit is contained in:
2026-03-30 11:56:29 +00:00
parent 8e61b4cd12
commit 698bffbe00
4 changed files with 538 additions and 383 deletions
+359 -326
View File
File diff suppressed because it is too large Load Diff
+75 -42
View File
@@ -288,24 +288,22 @@ in
* generated/traveldroid/modules/apps
** =generated/modules/traveldroid/apps/packages.nix=
** =generated/modules/traveldroid/apps/2_b_installed.nix=
This installs a list of apps
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/packages.nix :noweb yes :mkdirp yes :eval never
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/2_b_installed.nix :noweb yes :mkdirp yes :eval never
{ lib, config, pkgs, flakeRoot, ... }:
let
#################################
# Read package list from config file
# FILE
#################################
packagesConfPath = "${flakeRoot}/generated/assets/packages.conf";
raw = builtins.readFile packagesConfPath;
confPath = "${flakeRoot}/generated/assets/packages.conf";
raw = builtins.readFile confPath;
lines = lib.splitString "\n" raw;
rawLines = lib.splitString "\n" raw;
# Guard against splitting into characters accidentally
_guard = assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw); true;
# Clean each line: remove CRs, comments, trim whitespace
#################################
# CLEAN LINE
#################################
cleanLine = line:
let
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
@@ -313,52 +311,94 @@ let
in
lib.strings.trim noInlineComment;
# Filter out empty lines
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
#################################
# PARSE SECTION
#################################
parseSection = section:
let
result =
builtins.foldl'
(acc: line:
let
l = lib.strings.trim line;
in
if l == section then
acc // { active = true; }
else if lib.hasPrefix "#" l then
acc // { active = false; }
else if acc.active then
acc // { entries = acc.entries ++ [ l ]; }
else
acc
)
{ active = false; entries = []; }
lines;
in
builtins.filter (l: l != "") (map cleanLine result.entries);
#################################
# NIX PACKAGES
#################################
packageEntries = parseSection "#packages";
# Resolve attribute paths in pkgs
resolvePkg = name:
let
parts = lib.splitString "." name;
found = lib.attrByPath parts null pkgs;
in
if found == null then
(throw ''
packages.nix: package not found in pkgs
Token : ${builtins.toJSON name}
packages.conf : ${packagesConfPath}
Hint : check the attribute name on search.nixos.org/packages
'')
throw ''
packages.nix: package not found
Token: ${name}
File : ${confPath}
''
else
found;
# Final system-wide package list
packages = builtins.seq _guard (map resolvePkg entries);
packages = map resolvePkg packageEntries;
#################################
# FLATPAKS
#################################
flatpakEntries = parseSection "#flatpaks";
in {
#################################
# Allow unfree packages globally
# Allow unfree
#################################
nixpkgs.config = { allowUnfree = true; };
nixpkgs.config.allowUnfree = true;
#################################
# System packages
# System packages (Nix)
#################################
environment.systemPackages = packages;
#################################
# Flatpak setup
#################################
services.flatpak.enable = true;
services.flatpak.remotes = [
{
name = "flathub";
location = "https://flathub.org/repo/flathub.flatpakrepo";
}
];
#################################
# Flatpak apps
#################################
services.flatpak.packages = flatpakEntries;
}
#+END_SRC
** =generated/assets/packages.conf=
** =generated/assets/2_b_installed.conf=
This is a list of additional apps to install
#+BEGIN_SRC conf :tangle generated/assets/packages.conf :noweb yes :mkdirp yes :eval never
#productivity
#+BEGIN_SRC conf :tangle generated/assets/2_b_installed.conf :noweb yes :mkdirp yes :eval never
#packages
todoist
# browsers
brave
chromium
# utils
git
direnv
ripgrep
@@ -379,30 +419,23 @@ zed-editor
eza
z-lua
qdirstat
# office
obsidian
onlyoffice-desktopeditors
# development
postman
tea
#jetbrains.pycharm
python3
# communication
nextcloud-client
nextcloud-talk-desktop
signal-desktop
openssl
# multimedia
audacity
handbrake
spotify
vlc
#flatpaks
eu.betterbird.Betterbird
com.todoist.Todoist
#+END_SRC
** =generated/modules/traveldroid/apps/kitty.nix=
@@ -1,11 +1,7 @@
#productivity
#packages
todoist
# browsers
brave
chromium
# utils
git
direnv
ripgrep
@@ -26,26 +22,20 @@ zed-editor
eza
z-lua
qdirstat
# office
obsidian
onlyoffice-desktopeditors
# development
postman
tea
#jetbrains.pycharm
python3
# communication
nextcloud-client
nextcloud-talk-desktop
signal-desktop
openssl
# multimedia
audacity
handbrake
spotify
vlc
#flatpaks
eu.betterbird.Betterbird
com.todoist.Todoist
@@ -0,0 +1,99 @@
{ lib, config, pkgs, flakeRoot, ... }:
let
#################################
# FILE
#################################
confPath = "${flakeRoot}/generated/assets/packages.conf";
raw = builtins.readFile confPath;
lines = lib.splitString "\n" raw;
#################################
# CLEAN LINE
#################################
cleanLine = line:
let
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
noInlineComment = lib.head (lib.splitString "#" noCR);
in
lib.strings.trim noInlineComment;
#################################
# PARSE SECTION
#################################
parseSection = section:
let
result =
builtins.foldl'
(acc: line:
let
l = lib.strings.trim line;
in
if l == section then
acc // { active = true; }
else if lib.hasPrefix "#" l then
acc // { active = false; }
else if acc.active then
acc // { entries = acc.entries ++ [ l ]; }
else
acc
)
{ active = false; entries = []; }
lines;
in
builtins.filter (l: l != "") (map cleanLine result.entries);
#################################
# NIX PACKAGES
#################################
packageEntries = parseSection "#packages";
resolvePkg = name:
let
parts = lib.splitString "." name;
found = lib.attrByPath parts null pkgs;
in
if found == null then
throw ''
packages.nix: package not found
Token: ${name}
File : ${confPath}
''
else
found;
packages = map resolvePkg packageEntries;
#################################
# FLATPAKS
#################################
flatpakEntries = parseSection "#flatpaks";
in {
#################################
# Allow unfree
#################################
nixpkgs.config.allowUnfree = true;
#################################
# System packages (Nix)
#################################
environment.systemPackages = packages;
#################################
# Flatpak setup
#################################
services.flatpak.enable = true;
services.flatpak.remotes = [
{
name = "flathub";
location = "https://flathub.org/repo/flathub.flatpakrepo";
}
];
#################################
# Flatpak apps
#################################
services.flatpak.packages = flatpakEntries;
}