From 6d393aec4075ca7ca8672c697f775135bcdff93f Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Mon, 9 Mar 2026 19:40:50 +0100 Subject: [PATCH] working on zsh --- Droidnix/README.html | 741 +++++++++--------- Droidnix/README.org | 75 +- .../system/applications/packages.nix | 184 +---- 3 files changed, 439 insertions(+), 561 deletions(-) diff --git a/Droidnix/README.html b/Droidnix/README.html index 0c59d9983..a0216d569 100644 --- a/Droidnix/README.html +++ b/Droidnix/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Droidnix: A Dendritic NixOS + Home Manager Configuration NixOS Configuration Structure @@ -204,121 +204,121 @@

Table of Contents

-
-

Shortcuts

-
+
+

Shortcuts

+

Introduction The Assets Folder @@ -334,26 +334,26 @@

Introduction   intro

-
-

What is Droidnix

-
+
+

What is Droidnix

+

Droidnix is a modular, declarative NixOS + Home Manager configuration system. It allows users to choose between Hyprland and Mangowc as their window manager, with shared and WM-specific configurations managed via Emacs Org and Nix Flakes. The project is designed for reproducibility, maintainability, and cross-machine compatibility.

-
-

Installed components:

-
+
+

Installed components:

+
    -
  • Core
  • -
  • Hyprland
  • -
  • Mangowc
  • +
  • Core
  • +
  • Hyprland
  • +
  • Mangowc
-
-

Goals, project Structure, import hierarchy

-
+
+

Goals, project Structure, import hierarchy

+

This project uses a modular NixOS configuration with Hyprland and MangoWC support, designed for literate programming and cross-device reusability. The Droidnix repository is organized into two main parts: @@ -366,9 +366,9 @@ The Droidnix repository is organized into two main parts:

-
-

Root Level

-
+
+

Root Level

+
  • flake.nix is the entry point and imports:
      @@ -380,23 +380,23 @@ The Droidnix repository is organized into two main parts:
-
-

Generated Structure

-
+
+

Generated Structure

+

The generated/ directory contains all generated configurations, divided into three main groups: system, hyprland, and mangowc.

-
-

System (generated/system/)

-
+
+

System (generated/system/)

+

This directory contains system-wide configurations that are independent of the window manager.

-
-

Applications (applications/)

-
+
+

Applications (applications/)

+
  • file_management/: Configurations for file managers and storage solutions.
  • gaming/: Settings for gaming-related software.
  • @@ -406,9 +406,9 @@ This directory contains system-wide configurations that are independent of the w
-
-

Development (development/)

-
+
+

Development (development/)

+
  • databases/: Settings for local databases.
  • devops_ci_cd/: Configurations for DevOps tools.
  • @@ -418,9 +418,9 @@ This directory contains system-wide configurations that are independent of the w
-
-

System Management (system_management/)

-
+
+

System Management (system_management/)

+
  • backups/: Settings for backup software.
  • bluetooth/: Configurations for Bluetooth devices and services.
  • @@ -439,9 +439,9 @@ This directory contains system-wide configurations that are independent of the w
-
-

Hyprland (generated/hyprland/)

-
+
+

Hyprland (generated/hyprland/)

+

This directory contains configurations specific to Hyprland.

@@ -458,9 +458,9 @@ This directory contains configurations specific to Hyprland.
-
-

MangoWC (generated/mangowc/)

-
+
+

MangoWC (generated/mangowc/)

+

This directory contains configurations specific to MangoWC.

@@ -494,7 +494,7 @@ This directory contains configurations specific to MangoWC.
  • Scalability: Easy to add new machines or configurations.
  • -
    +
     .
     ├── assets
     │   ├── common
    @@ -676,9 +676,9 @@ This directory contains configurations specific to MangoWC.
     
    -
    -

    First Setup

    -
    +
    +

    First Setup

    +
    1. Clone this repository.
    2. Run the setup script: ./setup_droidnix.sh.
    3. @@ -700,9 +700,9 @@ This directory contains configurations specific to MangoWC. The .assets/ folder contains all static files, such as configs, scripts, and themes. These files are not generated and can be edited directly.

    -
    -

    .assets/common/

    -
    +
    +

    .assets/common/

    +

    This folder contains files shared across both window managers, such as wallpapers, shell configs, and common scripts.

    @@ -713,9 +713,9 @@ This folder contains files shared across both window managers, such as wallpaper
    -
    -

    .assets/hyprland/

    -
    +
    +

    .assets/hyprland/

    +

    Hyprland-specific assets, including configs, themes, and scripts.

    @@ -727,9 +727,9 @@ Hyprland-specific assets, including configs, themes, and scripts.
    -
    -

    .assets/mangowc/

    -
    +
    +

    .assets/mangowc/

    +

    Mangowc-specific assets, including configs, themes, and scripts.

    @@ -741,9 +741,9 @@ Mangowc-specific assets, including configs, themes, and scripts.
    -
    -

    .assets/machines/

    -
    +
    +

    .assets/machines/

    +

    Machine-specific NixOS configurations (e.g., configuration.nix for maindroid and traveldroid).

    @@ -761,9 +761,9 @@ Machine-specific NixOS configurations (e.g., configuration.nix for This section contains the Org blocks for tangling Nix code into the generated folders.

    -
    -

    flake.nix

    -
    +
    +

    flake.nix

    +

    The Nix flake definition for Droidnix.

    @@ -848,13 +848,13 @@ The Nix flake definition for Droidnix.
    -
    -

    First the nix-files that flake really needs and that do not fit wel in the hierarchical structure

    -
    +
    +

    First the nix-files that flake really needs and that do not fit wel in the hierarchical structure

    +
    -
    -

    assets/flake/users/henrov.nix

    -
    +
    +

    assets/flake/users/henrov.nix

    +

    This is the default user, just search and replace henrov another name if you want to change

    @@ -870,9 +870,9 @@ This is the default user, just search and replace henrov another name if you wan
    -
    -

    assets/flake/terminal_shell/devshell.nix

    -
    +
    +

    assets/flake/terminal_shell/devshell.nix

    +

    This code defines a Nix shell environment (also called a "devShell") that you can enter using the nix develop command. When you enter this shell, Nix will provide the tools and dependencies listed in buildInputs.

    @@ -888,9 +888,9 @@ mkShell {
    -
    -

    assets/flake/machines/traveldroid/top.nix

    -
    +
    +

    assets/flake/machines/traveldroid/top.nix

    +

    This code defines the machine to build. Just search and replace traveldroid to provision another machine.

    @@ -932,9 +932,9 @@ This code defines the machine to build. Just search and replace traveldroid to p
    -
    -

    assets/flake/machines/traveldroid/boot.nix

    -
    +
    +

    assets/flake/machines/traveldroid/boot.nix

    +

    This file has most of the settings the control how the computer boots up.

    @@ -969,13 +969,13 @@ This file has most of the settings the control how the computer boots up.
    -
    -

    Now we reach the top of the hierarchy which will call all other imports

    -
    +
    +

    Now we reach the top of the hierarchy which will call all other imports

    +
    -
    -

    generated/top.nix

    -
    +
    +

    generated/top.nix

    +

    The ./generated/top.nix file acts as an anchor or entry point for the entire chain of imports in the pyramid structure.

    @@ -992,9 +992,9 @@ The ./generated/top.nix file acts as an anchor or entry point for the entire cha
    -
    -

    generated/hyprland/top.nix

    -
    +
    +

    generated/hyprland/top.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

    @@ -1017,9 +1017,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/hyprland.nix

    -
    +
    +

    generated/hyprland/hyprland.nix

    +

    The ./generated/top.nix file acts as an anchor or entry point for the entire chain of imports in the pyramid structure.

    @@ -1070,9 +1070,9 @@ in
    -
    -

    generated/mangowc/top.nix

    -
    +
    +

    generated/mangowc/top.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

    @@ -1095,9 +1095,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/top.nix

    -
    +
    +

    generated/system/top.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

    @@ -1116,9 +1116,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/top.nix

    -
    +
    +

    generated/system/applications/top.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

    @@ -1141,67 +1141,64 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/packages.nix

    -
    +
    +

    generated/system/applications/packages.nix

    +

    This will import all packages listed in ./assets/common/apps/packlages.conf

    -
    { config, pkgs, lib, user, inputs, flakeRoot,... }:
    -{
    -  config,
    -  lib,
    -  pkgs,
    -  flakeRoot,
    -  inputs,
    -  ...
    -}:
    +
    { config, lib, pkgs, flakeRoot, inputs, ... }:
     let
    -  packagesConfPath = "${builtins.toString flakeRoot.outPath}/assets/common/apps/packages.conf";
    +  packagesConfPath = flakeRoot.outPath + "/assets/conf/apps/packages.conf";
       raw = builtins.readFile packagesConfPath;
       # IMPORTANT: explicit "\n" so we never accidentally split into characters
       rawLines = lib.splitString "\n" raw;
       # Guard: if we accidentally split into characters, rawLines length ~= stringLength raw
    -  _guard =
    -    assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw);
    -    true;
    -  cleanLine =
    -    l:
    -    let
    -      noCR = lib.replaceStrings [ "\r" ] [ "" ] l;
    -      noInlineComment = lib.head (lib.splitString "#" noCR);
    -    in
    -    lib.strings.trim noInlineComment;
    -  entries = builtins.filter (l: l != "") (map cleanLine rawLines);
    -  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   : ${toString packagesConfPath}
    -        Hint     : check the attribute name on search.nixos.org/packages
    -      ''
    -    else
    -      found;
    +  _guard = assert !(
    +  builtins.stringLength raw > 1 &&
    +  builtins.length rawLines == builtins.stringLength raw
    +  ); true;
    +  cleanLine = l:
    +  let
    +  noCR = lib.replaceStrings [ "\r" ] [ "" ] l;
    +  noInlineComment = lib.head (lib.splitString "#" noCR);
    +  in
    +  lib.strings.trim noInlineComment;
    +  entries =
    +  builtins.filter (l: l != "")
    +  (map cleanLine rawLines);
    +  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   : ${toString packagesConfPath}
    +    Hint     : check the attribute name on search.nixos.org/packages
    +    ''
    +  else
    +    found;
       packages = builtins.seq _guard (map resolvePkg entries);
    -  zenBrowser = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
    +  zenBrowser =
    +  inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
     in
     {
    -  environment.systemPackages = packages ++ [ zenBrowser ];
    +  environment.systemPackages =
    +  packages
    +  ++ [ zenBrowser ];
     }
    +
     
    -
    -

    generated/system/applications/flatpaks.nix

    -
    +
    +

    generated/system/applications/flatpaks.nix

    +

    This will import all packages listed in ./assets/common/apps/flatpaks.conf

    @@ -1322,9 +1319,9 @@ in
    -
    -

    generated/system/core/top.nix

    -
    +
    +

    generated/system/core/top.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

    @@ -1342,9 +1339,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/core/login-tuigreeter.nix

    -
    +
    +

    generated/system/core/login-tuigreeter.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

    @@ -1367,9 +1364,9 @@ settings = {
    -
    -

    generated/system/core/wayland.nix

    -
    +
    +

    generated/system/core/wayland.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

    @@ -1413,9 +1410,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/development/top.nix

    -
    +
    +

    generated/system/development/top.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

    @@ -1435,9 +1432,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/top.nix

    -
    +
    +

    generated/system/system_management/top.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

    @@ -1465,9 +1462,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/animations_effects/top.nix

    -
    +
    +

    generated/hyprland/animations_effects/top.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

    @@ -1483,9 +1480,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/decorations/top.nix

    -
    +
    +

    generated/hyprland/decorations/top.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

    @@ -1501,9 +1498,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/keyboard_binds/top.nix

    -
    +
    +

    generated/hyprland/keyboard_binds/top.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

    @@ -1532,9 +1529,9 @@ in
    -
    -

    generated/hyprland/notifications/top.nix

    -
    +
    +

    generated/hyprland/notifications/top.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

    @@ -1550,9 +1547,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/statusbar_tray/top.nix

    -
    +
    +

    generated/hyprland/statusbar_tray/top.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

    @@ -1568,9 +1565,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/task_launcher/top.nix

    -
    +
    +

    generated/hyprland/task_launcher/top.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

    @@ -1586,9 +1583,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/task_launcher/wofi.nix

    -
    +
    +

    generated/hyprland/task_launcher/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

    @@ -1633,9 +1630,9 @@ in
    -
    -

    generated/hyprland/task_window_workspace_switcher/top.nix

    -
    +
    +

    generated/hyprland/task_window_workspace_switcher/top.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

    @@ -1651,9 +1648,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/hyprland/window_rules/top.nix

    -
    +
    +

    generated/hyprland/window_rules/top.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

    @@ -1669,9 +1666,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/animations_effects/top.nix

    -
    +
    +

    generated/mangowc/animations_effects/top.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

    @@ -1687,9 +1684,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/decorations/top.nix

    -
    +
    +

    generated/mangowc/decorations/top.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

    @@ -1705,9 +1702,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/keyboard_binds/top.nix

    -
    +
    +

    generated/mangowc/keyboard_binds/top.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

    @@ -1740,9 +1737,9 @@ in
    -
    -

    generated/mangowc/notifications/top.nix

    -
    +
    +

    generated/mangowc/notifications/top.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

    @@ -1758,9 +1755,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/statusbar_tray/top.nix

    -
    +
    +

    generated/mangowc/statusbar_tray/top.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

    @@ -1776,9 +1773,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/task_launcher/top.nix

    -
    +
    +

    generated/mangowc/task_launcher/top.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

    @@ -1794,9 +1791,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/task_launcher/wofi.nix

    -
    +
    +

    generated/mangowc/task_launcher/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

    @@ -1809,9 +1806,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/task_window_workspace_switcher/top.nix

    -
    +
    +

    generated/mangowc/task_window_workspace_switcher/top.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

    @@ -1827,9 +1824,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/mangowc/window_rules/top.nix

    -
    +
    +

    generated/mangowc/window_rules/top.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

    @@ -1845,9 +1842,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/accessibility/top.nix

    -
    +
    +

    generated/system/applications/accessibility/top.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

    @@ -1863,9 +1860,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/file_management/top.nix

    -
    +
    +

    generated/system/applications/file_management/top.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

    @@ -1881,9 +1878,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/gaming/top.nix

    -
    +
    +

    generated/system/applications/gaming/top.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

    @@ -1899,9 +1896,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/media_playback_editing/top.nix

    -
    +
    +

    generated/system/applications/media_playback_editing/top.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

    @@ -1917,9 +1914,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/office_productivity/top.nix

    -
    +
    +

    generated/system/applications/office_productivity/top.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

    @@ -1935,9 +1932,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/terminal_shell/top.nix

    -
    +
    +

    generated/system/applications/terminal_shell/top.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

    @@ -1955,9 +1952,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/applications/terminal_shell/kitty.nix

    -
    +
    +

    generated/system/applications/terminal_shell/kitty.nix

    +

    This file sets up Kitty terminal

    @@ -1985,9 +1982,9 @@ in
    -
    -

    generated/system/applications/terminal_shell/starship.nix

    -
    +
    +

    generated/system/applications/terminal_shell/starship.nix

    +

    This file sets up starship prompt

    @@ -2007,9 +2004,9 @@ This file sets up starship prompt
    -
    -

    generated/system/applications/terminal_shell/zsh.nix

    -
    +
    +

    generated/system/applications/terminal_shell/zsh.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

    @@ -2056,9 +2053,9 @@ in
    -
    -

    generated/system/development/databases/top.nix

    -
    +
    +

    generated/system/development/databases/top.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

    @@ -2074,9 +2071,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/development/devops_ci_cd/top.nix

    -
    +
    +

    generated/system/development/devops_ci_cd/top.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

    @@ -2092,9 +2089,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/development/programming_languages/top.nix

    -
    +
    +

    generated/system/development/programming_languages/top.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

    @@ -2110,9 +2107,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/development/virtualization/top.nix

    -
    +
    +

    generated/system/development/virtualization/top.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

    @@ -2128,9 +2125,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/development/web_development/top.nix

    -
    +
    +

    generated/system/development/web_development/top.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

    @@ -2146,9 +2143,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/audio/top.nix

    -
    +
    +

    generated/system/system_management/audio/top.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

    @@ -2164,9 +2161,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/backups/top.nix

    -
    +
    +

    generated/system/system_management/backups/top.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

    @@ -2182,9 +2179,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/bluetooth/top.nix

    -
    +
    +

    generated/system/system_management/bluetooth/top.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

    @@ -2200,9 +2197,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/disk_management/top.nix

    -
    +
    +

    generated/system/system_management/disk_management/top.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

    @@ -2218,9 +2215,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/hardware_sensors/top.nix

    -
    +
    +

    generated/system/system_management/hardware_sensors/top.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

    @@ -2236,9 +2233,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/logging_monitoring/top.nix

    -
    +
    +

    generated/system/system_management/logging_monitoring/top.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

    @@ -2254,9 +2251,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/login_manager/top.nix

    -
    +
    +

    generated/system/system_management/login_manager/top.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

    @@ -2272,9 +2269,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/monitor_setup/top.nix

    -
    +
    +

    generated/system/system_management/monitor_setup/top.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

    @@ -2290,9 +2287,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/networking/top.nix

    -
    +
    +

    generated/system/system_management/networking/top.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

    @@ -2308,9 +2305,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/power_management/top.nix

    -
    +
    +

    generated/system/system_management/power_management/top.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

    @@ -2326,9 +2323,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/printers_scanners/top.nix

    -
    +
    +

    generated/system/system_management/printers_scanners/top.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

    @@ -2344,9 +2341,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/security/top.nix

    -
    +
    +

    generated/system/system_management/security/top.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

    @@ -2362,9 +2359,9 @@ This is top file of this level which contains just an import statement for all r
    -
    -

    generated/system/system_management/system_updates/top.nix

    -
    +
    +

    generated/system/system_management/system_updates/top.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

    @@ -2384,7 +2381,7 @@ This is top file of this level which contains just an import statement for all r

    Author: Henro Veijer

    -

    Created: 2026-03-09 ma 19:37

    +

    Created: 2026-03-09 ma 19:40

    Validate

    diff --git a/Droidnix/README.org b/Droidnix/README.org index 5aa20bfff..75228c022 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -648,58 +648,55 @@ This is top file of this level which contains just an import statement for all r ** =generated/system/applications/packages.nix= This will import all packages listed in ./assets/common/apps/packlages.conf #+BEGIN_SRC nix :tangle generated/system/applications/packages.nix :noweb tangle :mkdirp yes :eval never-html -{ config, pkgs, lib, user, inputs, flakeRoot,... }: -{ - config, - lib, - pkgs, - flakeRoot, - inputs, - ... -}: +{ config, lib, pkgs, flakeRoot, inputs, ... }: let - packagesConfPath = "${builtins.toString flakeRoot.outPath}/assets/common/apps/packages.conf"; + packagesConfPath = flakeRoot.outPath + "/assets/conf/apps/packages.conf"; raw = builtins.readFile packagesConfPath; # IMPORTANT: explicit "\n" so we never accidentally split into characters rawLines = lib.splitString "\n" raw; # Guard: if we accidentally split into characters, rawLines length ~= stringLength raw - _guard = - assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw); - true; - cleanLine = - l: - let - noCR = lib.replaceStrings [ "\r" ] [ "" ] l; - noInlineComment = lib.head (lib.splitString "#" noCR); - in - lib.strings.trim noInlineComment; - entries = builtins.filter (l: l != "") (map cleanLine rawLines); - 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 : ${toString packagesConfPath} - Hint : check the attribute name on search.nixos.org/packages - '' - else - found; + _guard = assert !( + builtins.stringLength raw > 1 && + builtins.length rawLines == builtins.stringLength raw + ); true; + cleanLine = l: + let + noCR = lib.replaceStrings [ "\r" ] [ "" ] l; + noInlineComment = lib.head (lib.splitString "#" noCR); + in + lib.strings.trim noInlineComment; + entries = + builtins.filter (l: l != "") + (map cleanLine rawLines); + 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 : ${toString packagesConfPath} + Hint : check the attribute name on search.nixos.org/packages + '' + else + found; packages = builtins.seq _guard (map resolvePkg entries); - zenBrowser = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default; + zenBrowser = + inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default; in { - environment.systemPackages = packages ++ [ zenBrowser ]; + environment.systemPackages = + packages + ++ [ zenBrowser ]; } + #+END_SRC ** =generated/system/applications/flatpaks.nix= This will import all packages listed in ./assets/common/apps/flatpaks.conf -#+BEGIN_SRC nix :tangle generated/system/applications/packages.nix :noweb tangle :mkdirp yes :eval never-html +#+BEGIN_SRC nix :tangle generated/system/applications/flatpaks.nix :noweb tangle :mkdirp yes :eval never-html { config, pkgs, diff --git a/Droidnix/generated/system/applications/packages.nix b/Droidnix/generated/system/applications/packages.nix index 536906df9..a8a29312e 100644 --- a/Droidnix/generated/system/applications/packages.nix +++ b/Droidnix/generated/system/applications/packages.nix @@ -1,159 +1,43 @@ -{ config, pkgs, lib, user, inputs, flakeRoot,... }: -{ - config, - lib, - pkgs, - flakeRoot, - inputs, - ... -}: +{ config, lib, pkgs, flakeRoot, inputs, ... }: let - packagesConfPath = "${builtins.toString flakeRoot.outPath}/assets/common/apps/packages.conf"; + packagesConfPath = flakeRoot.outPath + "/assets/conf/apps/packages.conf"; raw = builtins.readFile packagesConfPath; # IMPORTANT: explicit "\n" so we never accidentally split into characters rawLines = lib.splitString "\n" raw; # Guard: if we accidentally split into characters, rawLines length ~= stringLength raw - _guard = - assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw); - true; - cleanLine = - l: - let - noCR = lib.replaceStrings [ "\r" ] [ "" ] l; - noInlineComment = lib.head (lib.splitString "#" noCR); - in - lib.strings.trim noInlineComment; - entries = builtins.filter (l: l != "") (map cleanLine rawLines); - 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 : ${toString packagesConfPath} - Hint : check the attribute name on search.nixos.org/packages - '' - else - found; + _guard = assert !( + builtins.stringLength raw > 1 && + builtins.length rawLines == builtins.stringLength raw + ); true; + cleanLine = l: + let + noCR = lib.replaceStrings [ "\r" ] [ "" ] l; + noInlineComment = lib.head (lib.splitString "#" noCR); + in + lib.strings.trim noInlineComment; + entries = + builtins.filter (l: l != "") + (map cleanLine rawLines); + 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 : ${toString packagesConfPath} + Hint : check the attribute name on search.nixos.org/packages + '' + else + found; packages = builtins.seq _guard (map resolvePkg entries); - zenBrowser = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default; + zenBrowser = + inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default; in { - environment.systemPackages = packages ++ [ zenBrowser ]; -} - -{ - config, - pkgs, - lib, - flakeRoot, - ... -}: -let - moduleName = "install-flatpaks"; - flatpakConfPath = flakeRoot.outPath + "/assets/common/apps/flatpaks.conf"; - raw = builtins.readFile flatpakConfPath; - # Explicit "\n" so we never accidentally split into characters - rawLines = lib.splitString "\n" raw; - - # Guard: if we accidentally split into characters, rawLines length ~= stringLength raw - _guard = - assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw); - true; - - cleanLine = - l: - let - noCR = lib.replaceStrings [ "\r" ] [ "" ] l; - noInlineComment = lib.head (lib.splitString "#" noCR); - in - lib.strings.trim noInlineComment; - - entries = builtins.filter (l: l != "") (map cleanLine rawLines); - - # Flatpak app IDs are reverse-DNS style like org.example.App (at least 2 dots). - # We'll validate and fail early with a clear message. - dotCount = s: builtins.length (lib.splitString "." s) - 1; - - isValidId = s: (dotCount s) >= 2; # matches the error you're seeing: "at least 2 periods" - - _validate = builtins.seq _guard ( - builtins.map ( - id: - if isValidId id then - true - else - throw '' - ${moduleName}: invalid Flatpak ID in flatpaks.conf (needs reverse-DNS with at least 2 dots) - - Token : ${builtins.toJSON id} - flatpaks.conf : ${toString flatpakConfPath} - - Fix: remove stray tokens/headers, or comment them out with '#'. - '' - ) entries - ); - - # Use validated entries - flatpakApps = builtins.seq _validate entries; - - syncFlatpaks = pkgs.writeShellScript "sync-flatpaks" '' - set -euo pipefail - - # Use the deployed config path (matches environment.etc below) - CONF="/etc/flatpak/flatpaks.conf" - if [[ -f "$CONF" ]]; then - echo "flatpak-sync: using $CONF" - else - echo "flatpak-sync: WARNING: $CONF not found, using embedded list" - fi - - if ! flatpak remotes --system --columns=name | grep -qx flathub; then - flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo - fi - - desired_apps=( - ${lib.concatStringsSep "\n" (map (a: ''"${a}"'') flatpakApps)} - ) - - for app in "''${desired_apps[@]}"; do - if ! flatpak info --system "$app" >/dev/null 2>&1; then - flatpak install --system -y --noninteractive flathub "$app" - fi - done - ''; -in -{ - services.flatpak.enable = true; - - xdg.portal = { - enable = true; - }; - - # Deploy the config file for runtime visibility/debugging - environment.etc."flatpak/flatpaks.conf".source = lib.mkForce flatpakConfPath; - - systemd.services.flatpak-sync = { - description = "Install Flatpak apps listed in flatpaks.conf"; - wantedBy = [ "multi-user.target" ]; - wants = [ "network-online.target" ]; - after = [ "network-online.target" ]; - - serviceConfig = { - Type = "oneshot"; - ExecStart = syncFlatpaks; - }; - - restartTriggers = [ flatpakConfPath ]; - path = [ - pkgs.flatpak - pkgs.coreutils - pkgs.gnugrep - pkgs.gnused - ]; - }; + environment.systemPackages = + packages + ++ [ zenBrowser ]; }