diff --git a/henrovnix_ok/README.html b/henrovnix_ok/README.html index 0979fdc9c..c9fe38bdf 100644 --- a/henrovnix_ok/README.html +++ b/henrovnix_ok/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -201,153 +201,155 @@

Table of Contents

- -
  • 20. Emacs +
  • 20.1. default.nix
  • +
  • 20.2. Ollama
  • +
  • 20.3. Powermenu
  • +
  • 20.4. Animated Wallpaper
  • +
  • 20.5. Rotating Wallpaper
  • +
  • 20.6. Waybar
  • +
  • 20.7. Lock Screen
  • +
  • 20.8. Idle Screen
  • +
  • 20.9. hyprscrolling
  • +
  • 20.10. Hyprshell
  • +
  • 20.11. Hyprland
  • +
  • 20.12. Walker
  • +
  • 20.13. Theme
  • +
  • 20.14. Hyperexpo
  • +
  • 20.15. Alacritty
  • +
  • 20.16. Dev Tools
  • +
  • 20.17. Kitty
  • +
  • 20.18. Shells
  • +
  • 20.19. Zsh
  • +
  • 20.20. Starship
  • +
  • 20.21. Other Settings
  • -
  • 21. Machines + +
  • +
  • 21. Emacs +
  • +
  • 22. Machines
  • -
  • 22. README Utils +
  • 23. README Utils @@ -383,8 +385,8 @@ f#+OPTIONS: toc:nil broken-links:t
  • -
    -

    1. Introduction

    +
    +

    1. Introduction

    Screenshot

    @@ -399,8 +401,8 @@ Customization is designed to occur primarily through modular .conf files, allowi Before proceeding with installation, it is strongly recommended to read this documentation carefully. Understanding the structure and design philosophy will help ensure a smooth setup and provide the necessary context for extending the system effectively.

    -
    -

    1.1. What do you get?

    +
    +

    1.1. What do you get?

    This repository delivers a reproducible foundation built on NixOS, Home-Manager, and Flakes. It assumes a clean NixOS installation as a starting point, preferably minimal or headless, onto which the configuration is applied. @@ -409,8 +411,8 @@ Core packages are installed as part of the base configuration. Additional softwa

    -
    -

    1.2. What you do not get

    +
    +

    1.2. What you do not get

    This repository does not provide a fully polished, bug-free desktop system with every default preconfigured and validated across all hardware combinations. It is a structured foundation, not a turnkey end-user distribution. @@ -422,8 +424,8 @@ In short, this repository provides a coherent and extensible base, not a finishe

    -
    -

    2. What Is a Literate System in the Context of NixOS?

    +
    +

    2. What Is a Literate System in the Context of NixOS?

    A literate system combines documentation and implementation into a single, coherent source. @@ -457,8 +459,8 @@ The README is not describing the system. The README is the system.

    -
    -

    2.1. Two Types of Code Blocks

    +
    +

    2.1. Two Types of Code Blocks

    This literate system uses two different kinds of source blocks. @@ -470,7 +472,7 @@ These blocks exist purely for documentation purposes. They generate visible code blocks in the exported documentation, but they do not create files. Example:

    -
    +
     #+begin_src bash :tangle no
     <tekst>
     #+end_src
    @@ -486,10 +488,10 @@ They are never tangled into the filesystem.
     These blocks generate real .nix files and insert the same code into the documentation.
     Example:
     

    -
    -** install_packages.nix
    +
    +** packages.nix
     <tekst>
    -#+begin_src nix :tangle configuration/apps/install_packages.nix :noweb tangle :mkdirp yes
    +#+begin_src nix :tangle configuration/apps/packages.nix :noweb tangle :mkdirp yes
     <nixos code>
     #+end_src
     
    @@ -498,9 +500,9 @@ Example: Explanation:

      -
    • The headline install_packages.nix becomes a documentation chapter.
    • +
    • The headline packages.nix becomes a documentation chapter.
    • The paragraph <tekst> explains what the module does.
    • -
    • <nixos code> is exactly what will be written into the .nix module configuration/apps/install_packages.nix
    • +
    • <nixos code> is exactly what will be written into the .nix module configuration/apps/packages.nix
    • The same source block is rendered as a code block in the documentation.
    @@ -514,8 +516,8 @@ This means:
    -
    -

    2.2. The Two Core Commands

    +
    +

    2.2. The Two Core Commands

    There are exactly two commands that matter. @@ -563,8 +565,8 @@ Both come from the same source.

    -
    -

    2.3. Editing Generated Files

    +
    +

    2.3. Editing Generated Files

    The directories: @@ -590,8 +592,8 @@ Generated directories are output, not source.

    -
    -

    2.4. Recommended Workflow

    +
    +

    2.4. Recommended Workflow

    This workflow allows safe experimentation while preserving literate structure. @@ -632,15 +634,15 @@ If you are confident about your changes, you may skip steps 1–3 and edit READM

    -
    -

    2.5. Folder Structure Explained

    +
    +

    2.5. Folder Structure Explained

    The repository separates generated system code from non-generated supporting files.

    -
    -

    2.5.1. ./assets

    +
    +

    2.5.1. ./assets

    Contains non-generated assisting files such as: @@ -655,8 +657,8 @@ These files are safe to edit directly.

    -
    -

    2.5.2. ./assets/conf

    +
    +

    2.5.2. ./assets/conf

    Contains non-generated assisting configuration files that influence several aspects of builds. @@ -664,8 +666,8 @@ Users are expected to modify these when needed.

    -
    -

    2.5.3. ./configuration

    +
    +

    2.5.3. ./configuration

    Fully (re)generated by README.org. @@ -684,8 +686,8 @@ This directory is output.

    -
    -

    2.5.4. ./hardware

    +
    +

    2.5.4. ./hardware

    Contains non-generated hardware.nix files detailing hardware-specific details. @@ -693,8 +695,8 @@ This directory will likely be deprecated in the future.

    -
    -

    2.5.5. ./home

    +
    +

    2.5.5. ./home

    Fully (re)generated by README.org. @@ -710,8 +712,8 @@ Contains:

    -
    -

    2.5.6. ./machines

    +
    +

    2.5.6. ./machines

    Contains one folder per machine you want to configure. @@ -729,8 +731,8 @@ These determine how shared modules apply to each system.

    -
    -

    2.6. Final Principle

    +
    +

    2.6. Final Principle

    A literate NixOS system guarantees: @@ -749,8 +751,8 @@ You are maintaining a structured narrative that builds an operating system.

    -
    -

    2.7. Base packages

    +
    +

    2.7. Base packages

    The baseline package set is defined explicitly within the repository to ensure reproducibility: @@ -824,8 +826,8 @@ The baseline package set is defined explicitly within the repository to ensure r

    -
    -

    2.8. Additional packages

    +
    +

    2.8. Additional packages

    Additional software can be installed by extending the dedicated configuration files that define system and Flatpak packages: @@ -857,7 +859,7 @@ or by browsing: https://flathub.org/.

    -The behavior and integration of Flatpak installation within the system are defined in install_flatpaks.nix, which reads the corresponding configuration files and ensures declarative installation. +The behavior and integration of Flatpak installation within the system are defined in flatpaks.nix, which reads the corresponding configuration files and ensures declarative installation.

    @@ -866,12 +868,12 @@ This separation maintains clarity between system-level packages and user-facing

    -
    -

    3. Setting up your system manually

    +
    +

    3. Setting up your system manually

    -
    -

    3.1. Pre-requisites to build this setup

    +
    +

    3.1. Pre-requisites to build this setup

    - a NIXOS system installed with a user with sudo rights.
    @@ -881,8 +883,8 @@ This separation maintains clarity between system-level packages and user-facing
     
    -
    -

    3.2. Setup when Emacs not (yet) available

    +
    +

    3.2. Setup when Emacs not (yet) available

    1. Copy the folder henrovnixok to your machine
    2. @@ -951,8 +953,8 @@ Run the build command to set up the system for the first time
    -
    -

    4. Testing and generating builds

    +
    +

    4. Testing and generating builds

    At this stage, you should have a functional and reproducible system that can be edited, rebuilt, and extended according to your needs. The foundational structure is now in place, and further customization can occur incrementally through the modular configuration files. @@ -1015,46 +1017,46 @@ Other important files:

    -
    -

    5. flake.lock for pinning input versions.

    +
    +

    5. flake.lock for pinning input versions.

    -
    -

    6. assets/* for non-Nix-managed artifacts such as images and wallpapers.

    +
    +

    6. assets/* for non-Nix-managed artifacts such as images and wallpapers.

    Generated outputs should not be edited directly. A CI workflow can tangle and commit generated outputs when they differ.

    -
    -

    6.1. Emacs + Org + Tangle

    +
    +

    6.1. Emacs + Org + Tangle

    -
    -

    7. [Emacs](https://www.gnu.org/software/emacs/][Emacs) is used as the editor and execution environment for this literate configuration.

    +
    +

    7. [Emacs](https://www.gnu.org/software/emacs/][Emacs) is used as the editor and execution environment for this literate configuration.

    -
    -

    8. [Org](https://orgmode.org/][Org) mode provides the document structure and the source block execution model used here.

    +
    +

    8. [Org](https://orgmode.org/][Org) mode provides the document structure and the source block execution model used here.

    -
    -

    9. Tangling exports source blocks from this Org document into the corresponding configuration files.

    +
    +

    9. Tangling exports source blocks from this Org document into the corresponding configuration files.

    • References of the form <<code-id>> are noweb placeholders that are expanded from other blocks during tangling.
    -
    -

    9.1. Nix & NixOS

    +
    +

    9.1. Nix & NixOS

    -
    -

    10. [Nix](https://nix.dev/][Nix) is used to define packages, environments, and configuration as pure expressions.

    +
    +

    10. [Nix](https://nix.dev/][Nix) is used to define packages, environments, and configuration as pure expressions.

    -
    -

    11. [NixOS](https://nixos.org/][NixOS) evaluates Nix expressions into a complete system configuration that can be applied by rebuild operations.

    +
    +

    11. [NixOS](https://nixos.org/][NixOS) evaluates Nix expressions into a complete system configuration that can be applied by rebuild operations.

    -
    -

    11.1. Repository layout and folder conventions

    +
    +

    11.1. Repository layout and folder conventions

    <p> @@ -1067,8 +1069,8 @@ Generated outputs should not be edited directly. A CI workflow can tangle and co

    -
    -

    11.2. Shared domain folders

    +
    +

    11.2. Shared domain folders

    <ul> @@ -1082,8 +1084,8 @@ Generated outputs should not be edited directly. A CI workflow can tangle and co

    -
    -

    11.3. Full tree (including unchanged parts)

    +
    +

    11.3. Full tree (including unchanged parts)

    The tree below shows the full repository layout, with the standardized internal structure applied only inside @@ -1149,12 +1151,12 @@ The tree below shows the full repository layout, with the standardized internal │   │   │   └── ssh │   │   │   └── ssh-client.conf │   │   └── services -│   ├── lock.png +│   ├── lockscreen.png │   └── scripts ├── configuration │   ├── apps -│   │   ├── install_flatpaks.nix -│   │   └── install_packages.nix +│   │   ├── flatpaks.nix +│   │   └── packages.nix │   ├── core │   │   ├── boot.nix │   │   ├── files.nix @@ -1217,8 +1219,8 @@ The tree below shows the full repository layout, with the standardized internal

    -
    -

    11.4. Notes

    +
    +

    11.4. Notes

    <ul> @@ -1251,8 +1253,8 @@ This prevents unwanted and surprise updates when rebuilding without changing the

    -
    -

    12. TLDR App List

    +
    +

    12. TLDR App List

    @@ -1326,8 +1328,8 @@ This prevents unwanted and surprise updates when rebuilding without changing the
    -
    -

    13. Configuration Variables

    +
    +

    13. Configuration Variables

    I have a bunch of constant strings that I would rather put in a file. Thats what user.nix is. @@ -1344,8 +1346,8 @@ The values are imported at the beginning and are available to almost all the fun

    -
    -

    14. Flake Inputs

    +
    +

    14. Flake Inputs

    The inputs for my system's configuration are very simple @@ -1381,7 +1383,6 @@ zen-browser = { }; }; <<flake-outputs>> - # Copying ./assets/config/.config to ~/.config # Ensure the script is executable and available environment.systemPackages = [ pkgs.bash ]; @@ -1394,8 +1395,8 @@ system.activationScripts.recreateConfig = lib.mkAfter "setupNetworking" ''

    -
    -

    15. Flake Output

    +
    +

    15. Flake Output

    Now that the inputs are ready, the outputs define what the system will actually look like. I also define the machines that this configuration specifies early on. Finally, I iterate over the machines list and pull files from /.machines/${name} subdirectory. This allows me to have configuration that has machine specific configuration limited to those files while also keeping a modular reusable base. @@ -1403,7 +1404,7 @@ We also add a devshell that makes editing this repository easier in emacs.

    -
    outputs = inputs@{
    +
    outputs = inputs@{
     nixpkgs,
     home-manager,
     emacs-overlay,
    @@ -1464,7 +1465,7 @@ Overlays are a special nix way to override existing packages within a repository
     

    -
    ({ ... }: {
    +
    ({ ... }: {
     nixpkgs.overlays = [ emacs-overlay.overlays.default ];
     })
     
    @@ -1474,7 +1475,7 @@ nixpkgs.overlays = [ emacs-overlay.overlays.default ]; Then the machine specific configuration, in this case, just "traveldroid".

    -
    ./machines/${machine}/configuration.nix
    +
    ./machines/${machine}/configuration.nix
     
    @@ -1484,7 +1485,7 @@ This can be initialized and managed on its own but I'd rather use the nixo

    -
    home-manager.nixosModules.home-manager
    +
    home-manager.nixosModules.home-manager
     {
     home-manager.useGlobalPkgs = true;
     home-manager.useUserPackages = true;
    @@ -1527,8 +1528,8 @@ imports =  [
     
    -
    -

    15.1. Envrc + Direnv

    +
    +

    15.1. Envrc + Direnv

    Editing this file will be much nicer if we have the dev environment configured. @@ -1549,14 +1550,14 @@ fi

    -
    -

    16. Machines

    +
    +

    16. Machines

    The individual machines subdirectory is configured as follows :-

    -
    +--machine
    +
    +--machine
     |  +--configuration.nix
     |  +--home.nix
     |  +--hardware-configuration.nix
    @@ -1577,12 +1578,12 @@ This imported object (or function result) is just trivially merged into a common
     We can take a look at that the common hardware options I have for all my machines.
     

    -
    -

    16.0.1. Other Utils

    +
    +

    16.0.1. Other Utils

      -
    1. Updates
      +
    2. Updates

      To update the computer, I just need to update the flake.lock file to have references to the latest repository. This is done with :- @@ -1596,8 +1597,8 @@ To update the computer, I just need to update the flake.lock file t

    -
    -

    17. Hardware

    +
    +

    17. Hardware

    I'll let the code comments explain the file here. @@ -1631,8 +1632,8 @@ hardware.enableAllFirmware = true; # enable all firmware regardless of license

    -
    -

    18. Configuration

    +
    +

    18. Configuration

    This section describes the main system configuration for the computers that I have. Nix will look for a default.nix file if you give it a path to a folder to import. And default.nix looks as follows :- @@ -1642,8 +1643,8 @@ This section describes the main system configuration for the computers that I ha

      { pkgs, user, ... } :
     {
       imports = [
    -  ./apps/install_flatpaks.nix
    -  ./apps/install_packages.nix
    +  ./apps/flatpaks.nix
    +  ./apps/packages.nix
       ./core/files.nix
       ./core/locale.nix
       ./core/networking.nix
    @@ -1675,16 +1676,17 @@ This section describes the main system configuration for the computers that I ha
     
    -
    -

    18.1. Apps section

    +
    +

    18.1. Apps section

    -This section describes a way of installing packages, either through nixpkgs orr flatpak. What apps to instal is decided in the files ./assets/conf/apps/packages.conf and flatpaks.conf +This section describes a way of installing packages, either through nixpkgs or flatpak. +What extra apps to install is decided in the files ./assets/conf/apps/packages.conf and flatpaks.conf.

    -
    -

    18.2. installpackages.nix

    +
    +

    18.2. packages.nix

    { config, lib, pkgs, flakeRoot, inputs, ... }:
    @@ -1714,7 +1716,7 @@ let
       in
       if found == null then
         throw ''
    -    install_packages.nix: package not found in pkgs
    +    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
    @@ -1734,8 +1736,8 @@ in
     
    -
    -

    18.3. installflatpaks.nix

    +
    +

    18.3. flatpaks.nix

    { config, pkgs, lib, flakeRoot, ... }:
    @@ -1847,8 +1849,8 @@ in
     
    -
    -

    18.4. Nix Settings

    +
    +

    18.4. Nix Settings

    These are global nix settings that configure the settings for the actual tool. @@ -1897,8 +1899,8 @@ nh = {

    -
    -

    18.5. Boot

    +
    +

    18.5. Boot

    This file has most of the settings the control how the computer boots up. @@ -1936,17 +1938,17 @@ This file has most of the settings the control how the computer boots up.

    -
    -

    18.6. Login

    -
    +
    +
    +

    19. Login

    +

    Here we control what the login screen would look like. In configuration/default.nix you can choose whether to use tuigreet (very minimalistic) or LightDM (nicer, themeable)

    -
    -
    -

    18.7. Tuigreet

    -
    +
    +

    19.1. Tuigreet

    +

    Doesn't match the rest of the aesthetic of the system (with hyprland), but I like its simplicity.

    @@ -1970,15 +1972,15 @@ settings = {
    -
    -

    18.8. LightDM

    -
    +
    +

    19.2. LightDM

    +
    { config, pkgs, lib, ... }:
     
     let
       lightdmConf = builtins.readFile ../../assets/conf/core/lightdm.conf;
    -  lockPng   = ../../assets/lock.png;
    +  lockPng   = ../../assets/lockscreen.png;
     
       greeterConfPath = ../../assets/conf/core/lightdm-gtk-greeter.conf;
       greeterRaw  = builtins.readFile greeterConfPath;
    @@ -2002,17 +2004,14 @@ let
         if ms == [] then null else builtins.elemAt ms 0;
       in
       if m == null then null else lib.strings.trim (builtins.elemAt m 0);
    -
       # In your greeter.conf these are *package keys*, not theme names.
       themePkgKey  = getIniValue "theme-name";
       iconPkgKey = getIniValue "icon-theme-name";
       cursorPkgKey = getIniValue "cursor-theme-name";
    -
       cursorSizeStr = getIniValue "cursor-theme-size";
       cursorSize =
       if cursorSizeStr == null then null
       else lib.toInt (lib.strings.trim cursorSizeStr);
    -
       # Map package-keys (from greeter.conf) -> { package, name }
       #
       # IMPORTANT:
    @@ -2118,9 +2117,9 @@ in
     
    -
    -

    18.9. Terminal (default system)

    -
    +
    +

    19.3. Terminal (default system)

    +

    This is the initial system level configuration for the terminal that I use on this machine. Its just zsh.

    @@ -2138,9 +2137,9 @@ This is the initial system level configuration for the terminal that I use on th
    -
    -

    18.10. Files

    -
    +
    +

    19.4. Files

    +

    I use Thunar as the file explorer. Also setup a few plugins for Thunar in this config. Along with that, a few other utilities like zip and enabling services to automount usb drives. @@ -2180,9 +2179,9 @@ Along with that, a few other utilities like zip and enabling services to automou

    -
    -

    18.11. Locale

    -
    +
    +

    19.5. Locale

    +

    I live in Netherlands and would like all my locale and timezone settings to match. Except my default locale.

    @@ -2215,9 +2214,9 @@ LC_TIME = defaultLocale;
    -
    -

    18.12. Networking

    -
    +
    +

    19.6. Networking

    +

    Not much to see here. I want networking to be enabled. I want firewall as well.

    @@ -2247,9 +2246,9 @@ Not much to see here. I want networking to be enabled. I want firewall as well.
    -
    -

    18.13. Hyprland

    -
    +
    +

    19.7. Hyprland

    +

    This is a big one because the DE needs so much configuration. This section mostly installs Hyprland. The configuration is done in the home manager section. @@ -2319,9 +2318,9 @@ The configuration is done in the home manager section.

    -
    -

    18.14. Services

    -
    +
    +

    19.8. Services

    +

    These are some of the services that I enable at the system level. Explanation in the comments.

    @@ -2353,9 +2352,9 @@ users.users.${user.username}.extraGroups = [ "docker" ]; # add self to docker us
    -
    -

    18.15. Audio

    -
    +
    +

    19.9. Audio

    +
    { config, pkgs, lib, ... }:
     
    @@ -2431,14 +2430,14 @@ users.users.${user.username}.extraGroups = [ "docker" ]; # add self to docker us
     
    -
    -

    18.16. Fonts

    -
    +
    +

    19.10. Fonts

    +

    Nothing much to see here. I love Aporetic, and I use it everywhere.

    -
    fonts.packages = with pkgs; [
    +
    fonts.packages = with pkgs; [
     aporetic
     nerd-fonts.iosevka
     ];
    @@ -2446,14 +2445,14 @@ nerd-fonts.iosevka
     
    -
    -

    18.17. User Config

    -
    +
    +

    19.11. User Config

    +

    This creates the user profile that I login with. Initially created during install.

    -
    users.users.${user.username} = {
    +
    users.users.${user.username} = {
     isNormalUser = true;
     description = "henrov";
     extraGroups = [
    @@ -2468,18 +2467,18 @@ extraGroups = [
     
    -
    -

    19. Home

    -
    +
    +

    20. Home

    +

    I use home-manager to manage my user level dotfiles and configurations. Most of the "theme" of the system is decided here. I also use it to install programs that are okay with being installed at the user level instead of the system.

    -
    -

    19.1. default.nix

    -
    +
    +

    20.1. default.nix

    +

    This module will import all necessities.

    @@ -2496,7 +2495,6 @@ This module will import all necessities. ./desktop/hyprlock.nix ./desktop/hyprscrolling.nix ./desktop/hyprshell.nix - ./desktop/powermenu.nix #./desktop/animated_wallpaper.nix ./desktop/rotating_wallpaper.nix ./desktop/waybar.nix @@ -2520,79 +2518,49 @@ This module will import all necessities.
    -
    -

    19.2. Ollama

    -
    +
    +

    20.2. Ollama

    +

    This Home Manager Nix module (ai.nix) installs the Ollama package and configures it by reading a simple key-value configuration file (ollama.conf) for settings like the server host and default model. It sets environment variables (OLLAMAHOST and OLAMADEFAULTMODEL) for easy access in your shell or applications, with fallback defaults if the config file is missing or empty. Optionally, it also defines a user-level systemd service to automatically start the Ollama server on NixOS or systems with Home Manager’s systemd support enabled.

    { config, lib, pkgs, flakeRoot, ... }:
    -let
    -  ollamaConfPath = flakeRoot.outPath + "/assets/conf/apps/ai/ollama/ollama.conf";
    -  envVars = builtins.fromJSON (builtins.readFile ollamaConfPath);
    -in
     {
       services.ollama = {
       enable = true;
       package = pkgs.ollama;
    -  environmentVariables = envVars;
       };
     }
     
    -
    -

    19.3. Powermenu

    -
    +
    +

    20.3. Powermenu

    +

    -Creates a script for a powermenu +This is a script copied from the copystuff folder

    -
    -
    { config, lib, pkgs, flakeRoot, ... }:
    -let
    -  repoScript =
    -  flakeRoot.outPath  + "/assets/conf/desktop/hypr/scripts/powermenu.sh";
    -  targetRel = ".config/hypr/scripts/powermenu.sh";
    -in
    -{
    -  # Ensure script exists in ~/.config/hypr/scripts/
    -  home.file."${targetRel}" = {
    -  source = lib.mkForce repoScript;
    -  executable = true;
    -  };
    -}
    -
    -
    -
    -

    19.4. Animated Wallpaper

    -
    +
    +

    20.4. Animated Wallpaper

    +

    -userRelRoot = "nixosconf/wallpaperstuff"; -animatedwallpaper.nix installs mpvpaper and deploys your wallpaper files from the repo (./assets/conf/desktop/wallpaper) into ~/conf/desktop/wallpaper/pictures. +Sets animated wallpaper ~/nixosconf/wallpaperstuff/videos/myWallpaper.mp4

    { config, pkgs, lib, flakeRoot, ... }:
     let
    -  repoWallpaperDir = flakeRoot.outPath + "/assets/conf/desktop/wallpaper";
    -  userRelRoot = ".config/nixos_conf/wallpaperstuff";
    -  userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}";
    -  userVideoPath = "${userAbsRoot}/videos/myWallpaper.mp4";
    +  userVideoPath = ".config/nixos_conf/wallpaperstuff/videos/myWallpaper.mp4";
     in
     {
       home.packages = [
         pkgs.mpvpaper
         pkgs.mpv
       ];
    -  # Sync repo wallpapers (including videos/) into ~/nixos_conf/wallpaperstuff
    -  home.file."${userRelRoot}" = {
    -    source = lib.mkForce repoWallpaperDir;
    -    recursive = true;
    -  };
       systemd.user.services.mpvpaper-wallpaper = {
         Unit = {
           Description = "Video wallpaper (mpvpaper)";
    @@ -2619,41 +2587,20 @@ in
     
    -
    -

    19.5. Rotating Wallpaper

    -
    +
    +

    20.5. Rotating Wallpaper

    +

    rotatingwallpaper.nix installs wpaperd and deploys your wallpaper files from the repo (./assets/conf/desktop/wallpaper/pictures/) into ~/conf/desktop/wallpaper/pictures. It also deploys the default wallpaper configuration from assets/conf/desktop/wallpaper/wallpaper.conf into ~/conf/desktop/wallpaper/wallpaper.conf, which is the file you can edit as a user override. Finally, it creates a systemd user service (wpaperd.service) that automatically starts wpaperd at login and keeps it running, using your override config so wallpapers rotate according to your settings.

    -
    #+begin_src nix :tangle home/desktop/wallpaper.nix :noweb tangle :mkdirp yes
    -{ config, pkgs, lib, flakeRoot, ... }:
    +
    { config, pkgs, lib, flakeRoot, ... }:
     let
    -  repoWallpaperDir  = flakeRoot.outPath + "/assets/conf/desktop/wallpaper";
    -  repoWallpaperConf = flakeRoot.outPath + "/assets/conf/desktop/wallpaper/wallpaper.conf";
    -  userRelRoot  = "nixos_conf/wallpaperstuff";
    -  userAbsRoot  = "${config.home.homeDirectory}/${userRelRoot}";
    -  userConfPath = "${userAbsRoot}/wallpaper.conf";
    -  # Exclude wallpaper.conf so HM does NOT manage it (avoids backup collisions)
    -  repoWallpapersOnly = lib.cleanSourceWith {
    -    src = repoWallpaperDir;
    -    filter = path: type: (builtins.baseNameOf path) != "wallpaper.conf";
    -  };
    +  userConfPath = "${config.home.homeDirectory}/nixos_conf/wallpaperstuff/wallpaper.conf";
     in
     {
       home.packages = [ pkgs.wpaperd ];
    -  # Sync everything *except* wallpaper.conf into ~/nixos_conf/wallpaperstuff
    -  home.file."${userRelRoot}" = {
    -    source = lib.mkForce repoWallpapersOnly;
    -    recursive = true;
    -  };
    -  # Now safely overwrite the config every activation (no HM collision)
    -  home.activation.wallpaperConfForce = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
    -    set -euo pipefail
    -    mkdir -p "${userAbsRoot}"
    -    install -m 0644 "${repoWallpaperConf}" "${userConfPath}"
    -  '';
       systemd.user.services.wpaperd = {
         Unit = {
           Description = "wpaperd wallpaper daemon";
    @@ -2674,43 +2621,24 @@ in
     
    -
    -

    19.6. Waybar

    -
    - -
    -

    waybar.png -

    -
    - +
    +

    20.6. Waybar

    +

    Mostly styling and enabling modules in the top bar.

    { config, lib, pkgs, flakeRoot, ... }:
    -let
    -  repoWaybarDir = flakeRoot.outPath + "/assets/conf/desktop/waybar";
    -in
     {
       programs.waybar.enable = true;
    -  programs.waybar.style = lib.mkForce "";  # Schakel standaardstijl uit
    -  home.file.".config/waybar/config" = {
    -    source = lib.mkForce "${repoWaybarDir}/config.jsonc";
    -  };
    -  # Overschrijf style.css handmatig na alle andere stappen
    -  home.activation.waybarStyle = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
    -    mkdir -p "${config.xdg.configHome}/waybar"
    -    cp "${repoWaybarDir}/style.css" "${config.xdg.configHome}/waybar/style.css"
    -    chmod 644 "${config.xdg.configHome}/waybar/style.css"
    -  '';
     }
     
    -
    -

    19.7. Lock Screen

    -
    +
    +

    20.7. Lock Screen

    +

    The lock screen configured using hyprlock. I use hypridle to detect idle time and use wlogout to show a logout menu. @@ -2718,117 +2646,61 @@ They are configured below.

    { config, lib, pkgs, flakeRoot, ... }:
    -let
    -  lockPngSrc = flakeRoot.outPath + "/assets/lock.png";
    -  hyprlockConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprlock.conf";
    -in
     {
       home.packages = [ pkgs.hyprlock ];
    -  # Gebruik home.file voor echte bestanden (geen symlinks)
    -  home.file.".config/hypr/lock.png" = {
    -    source = lib.mkForce lockPngSrc;
    -  };
    -  home.file.".config/hypr/hyprlock.conf" = {
    -    source = lib.mkForce hyprlockConf;
    -  };
     }
     
    -
    -

    19.8. Idle Screen

    -
    +
    +

    20.8. Idle Screen

    +
    { config, lib, pkgs, flakeRoot, ... }:
    -let
    -  hypridleConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hypridle.conf";
    -in
     {
       home.packages = [ pkgs.hypridle ];
    -  home.file.".config/hypr/hypridle.conf" = {
    -    source = lib.mkForce hypridleConf;
    -  };
     }
     
    -
    -

    19.9. hyprscrolling

    -
    +
    +

    20.9. hyprscrolling

    +

    This Nix module integrates the hyprscrolling plugin into a Home-Manager managed Hyprland setup in a declarative and reproducible way. It ensures the plugin is installed, optionally switches Hyprland to the scrolling layout, and renders user-defined plugin settings directly into the Hyprland configuration. The goal is to manage the scrolling workspace behavior entirely from Nix instead of maintaining manual edits inside hyprland.conf.

    { config, lib, pkgs, flakeRoot, ... }:
    -let
    -  # Hyprscrolling drop-in config (repo -> ~/.config)
    -  repoConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprscrolling.conf";
    -  targetRel = "hypr/conf.d/90-hyprscrolling.conf";
    -  # Overflow indicator script
    -  repoOverflowScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh";
    -  targetOverflowRel = "hypr/scripts/hyprscroll-overflow.sh";
    -  # Adapt columnsize to monitor
    -  repoPerMonitorScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/hyprscrolling-per-monitor.sh";
    -  targetPerMonitor = "hypr/scripts/hyprscrolling-per-monitor.sh";
    -  # Switch between scrolling/dwindle
    -  repoSwitchScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/toggle-layout-scrolling-dwindle.sh";
    -  targetSwitchScript = "hypr/scripts/toggle-layout-scrolling-dwindle.sh";
    -in
     {
       home.packages = with pkgs; [ jq ];
       wayland.windowManager.hyprland = {
         enable = true;
    -    plugins = [ pkgs.hyprlandPlugins.hyprscrolling ];
    -    extraConfig = ''
    -      source = ${config.xdg.configHome}/${targetRel}
    -    '';
    -  };
    -  # Copy repo configs/scripts into ~/.config (als echte bestanden)
    -  home.file."${targetRel}" = {
    -    source = lib.mkForce repoConf;
    -  };
    -  home.file."${targetOverflowRel}" = {
    -    source = lib.mkForce repoOverflowScript;
    -    executable = true;
    -  };
    -  home.file."${targetPerMonitor}" = {
    -    source = lib.mkForce repoPerMonitorScript;
    -    executable = true;
    -  };
    -  home.file."${targetSwitchScript}" = {
    -    source = lib.mkForce repoSwitchScript;
    -    executable = true;
    +    plugins = [ pkgs.hyprlandPlugins.hyprscrolling
    +                pkgs.hyprlandPlugins.hyprspace
    +                pkgs.hyprlandPlugins.hyprsunset
    +                pkgs.hyprlandPlugins.HyprEasymotion
    +
    +          ];
       };
     }
     
    -
    -

    19.10. Hyprshell

    -
    +
    +

    20.10. Hyprshell

    +

    For nice task-starting and -switching

    # home/desktop/hyprshell.nix  (Home-Manager module)
     { config, pkgs, lib, flakeRoot, ... }:
    -let
    -  repoDir = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprshell";
    -  cfgRon  = repoDir + "/config.ron";
    -  cssFile = repoDir + "/styles.css";
    -in
     {
       xdg.enable = true;
       home.packages = [ pkgs.hyprshell ];
    -  # Gebruik home.file voor echte bestanden (geen symlinks)
    -  home.file.".config/hyprshell/config.ron" = {
    -    source = lib.mkForce cfgRon;
    -  };
    -  home.file.".config/hyprshell/styles.css" = {
    -    source = lib.mkForce cssFile;
       };
       # Autostart (systemd user service)
       systemd.user.services.hyprshell = {
    @@ -2851,25 +2723,22 @@ in
     
    -
    -

    19.11. Hyprland

    -
    +
    +

    20.11. Hyprland

    +

    This configures the desktop environment along with the peripherals. The comments should explain whats happening.

    { config, lib, pkgs, flakeRoot, ... }:
     let
    -  hyprConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprland.conf";
       bindingsConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/bindings.conf";
       lidLockScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/lid-lock.sh";
     in
     {
       wayland.windowManager.hyprland = {
         enable = true;
    -    # Load base config + bindings from repo files
    -    extraConfig = ''
    -      ${builtins.readFile hyprConf}
    +    # Load bindings from repo files
           # --- Repo keybindings ---
           ${builtins.readFile bindingsConf}
         '';
    @@ -2879,11 +2748,6 @@ in
           ];
         };
       };
    -  # Gebruik home.file voor echte bestanden (geen symlinks)
    -  home.file.".config/hypr/scripts/lid-lock.sh" = {
    -    source = lib.mkForce lidLockScript;
    -    executable = true;
    -  };
       xdg.portal = {
         enable = true;
         extraPortals = with pkgs; [
    @@ -2903,9 +2767,9 @@ in
     
    -
    -

    19.12. Walker

    -
    +
    +

    20.12. Walker

    +

    This is how I launch applications. It is bound to Win+Space in the ./asstes/conf/desktop/hypr/bindings.conf.

    @@ -2920,17 +2784,11 @@ let if inputs != null && inputs ? elephant then inputs.elephant.packages.${pkgs.system}.default else pkgs.elephant; - sessionTarget = "graphical-session.target"; - # All theme files now live here - repoThemesDir = flakeRoot.outPath + "/assets/conf/desktop/walker"; + sessionTarget = "graphical-session.target";; in { xdg.enable = true; home.packages = [ walkerPkg elephantPkg ]; - # ~/.config/walker/themes/* - xdg.configFile."walker/themes/frosted/default.css".source = lib.mkForce (repoThemesDir + "/themes/frosted/default.css"); - xdg.configFile."walker/themes/frosted/style.css".source = lib.mkForce (repoThemesDir + "/themes/frosted/style.css"); - xdg.configFile."walker/config.toml".source = lib.mkForce (repoThemesDir + "/config.toml"); # xdg.configFile."walker/themes/default.html".source = lib.mkForce repoThemesDir + "/default.html"; # (services unchanged) systemd.user.services.elephant = { /* ... your existing service ... */ }; @@ -2940,21 +2798,9 @@ in
    -
    -

    19.13. Walker

    -
    -

    -This is how I launch applications. It is bound to Win+Space in the ./asstes/conf/desktop/hypr/bindings.conf. -

    -
    -
    -
    -
    -
    -
    -
    -

    19.14. Theme

    -
    +
    +

    20.13. Theme

    +

    I use the Catppuccin almost everywhere. The nix module integrates almost automatically everywhere (except gtk). You'll notice the color values in multiple places outside this as well. @@ -2986,9 +2832,9 @@ catppuccin.cursors.enable = true;

    -
    -

    19.15. Hyperexpo

    -
    +
    +

    20.14. Hyperexpo

    +

    hyprexpo gets installed and configured

    @@ -3014,8 +2860,8 @@ hyprexpo gets installed and configured gaps_in = 5 gaps_out = 20 - # Optional; comment out if you don't want it - # workspace_method = center current + # Comment out if you don't want it + workspace_method = center current } } ''; @@ -3025,32 +2871,26 @@ hyprexpo gets installed and configured
    -
    -

    19.16. Alacritty

    -
    +
    +

    20.15. Alacritty

    +

    Alacritty gets installed and configured

    { config, pkgs, lib, flakeRoot, ... }:
    -let
    -  repoAlacrittyConf = flakeRoot.outPath + "/assets/conf/dev/alacritty.toml";
    -in
     {
       xdg.enable = true;
       programs.alacritty.enable = true;
    -  # Override the config generated by programs.alacritty
    -  xdg.configFile."alacritty/alacritty.toml".source = lib.mkForce repoAlacrittyConf;
    -  catppuccin.alacritty.enable = true;
       catppuccin.alacritty.flavor = "mocha";
     }
     
    -
    -

    19.17. Dev Tools

    -
    +
    +

    20.16. Dev Tools

    +

    All the miscellaneous dev tools on this computer.

    @@ -3101,37 +2941,22 @@ All the miscellaneous dev tools on this computer.
    -
    -

    19.18. Kitty

    -
    +
    +

    20.17. Kitty

    +

    Kitty gets installed and configured

    { config, pkgs, lib, flakeRoot, ... }:
    -let
    -  catppuccinMochaConf =
    -  builtins.readFile (flakeRoot.outPath + "/assets/conf/dev/terminal/Catppuccin-Mocha.conf");
    -  # Your own keymaps / other settings (but we will NOT rely on it for opacity)
    -  repoKittyConfText =
    -  builtins.readFile (flakeRoot.outPath + "/assets/conf/dev/terminal/kitty.conf");
    -in
     {
       xdg.enable = true;
    -  # Stable theme file so kitty.conf can include it without /nix/store paths
    -  xdg.configFile."kitty/themes/Catppuccin-Mocha.conf".text =  lib.mkForce catppuccinMochaConf;
       programs.kitty = {
       enable = true;
    -  # Home Manager generates ~/.config/kitty/kitty.conf; we append in-order:
    -  # 1) include theme
    -  # 2) your repo config (keymaps etc.)
    -  # 3) force opacity LAST so it always wins
       extraConfig = ''
       # 1) Theme first (stable path)
       include themes/Catppuccin-Mocha.conf
    -  # 2) Your repo config (may also include theme; harmless if duplicated)
    -  ${repoKittyConfText}
    -  # 3) Force transparency last (wins)
    +  # 2) Force transparency last (wins)
       #background_opacity 0.60
       #dynamic_background_opacity yes
       '';
    @@ -3141,11 +2966,11 @@ in
     
    -
    -

    19.19. Shells

    -
    +
    +

    20.18. Shells

    +

    -The aliases mentioned in ./assets/conf/dev/terminal/shells.conf will be added to enabled shells +The aliases mentioned in ./assets/conf/dev/terminal/aliases.conf will be added to enabled shells

    # shells.nix — Home-Manager module
    @@ -3171,7 +2996,7 @@ let
       trim = lib.strings.trim;
       # ---------- minimal INI-ish parser (sections + raw lines) ----------
       readMaybe = p: if builtins.pathExists p then builtins.readFile p else "";
    -  normalizeLine = l: trim (lib.replaceStrings [ "\r" ] [ "" ] l);
    +  normalizeLine = l: trim (l`ib.replaceStrings [ "\r" ] [ "" ] l);
       parseSections = text:
       let
       lines = map normalizeLine (lib.splitString "\n" text);
    @@ -3358,9 +3183,9 @@ EOF
     
    -
    -

    19.20. Zsh

    -
    +
    +

    20.19. Zsh

    +

    Zsh gets installed and configured

    @@ -3395,19 +3220,14 @@ Zsh gets installed and configured
    -
    -

    19.21. Starship

    -
    +
    +

    20.20. Starship

    +

    The configuration mentioned in ./assets/conf/dev/terminal/starship.toml will be added to enabled shells

    { config, pkgs, lib, flakeRoot, ... }:
    -let
    -  repoStarshipToml = flakeRoot.outPath + "/assets/conf/dev/terminal/starship.toml";
    -  # The exact key that appears in the error:
    -  targetKey = "${config.home.homeDirectory}/.config/starship.toml";
    -in
     {
       xdg.enable = true;
       programs.starship = {
    @@ -3416,25 +3236,23 @@ in
       enableBashIntegration = true;
       enableFishIntegration = true;
       };
    -  # Force the *actual conflicting option* (home.file."<abs path>".source)
    -  home.file."${targetKey}".source = lib.mkForce repoStarshipToml;
     }
     
    -
    -

    19.22. Other Settings

    -
    +
    +

    20.21. Other Settings

    +

    Some repeated info from the configuration.

    -
    -

    19.22.1. Home User

    -
    +
    +

    20.21.1. Home User

    +
    -
    home.username = "${user.username}";
    +
    home.username = "${user.username}";
     home.homeDirectory = pkgs.lib.mkDefault "/home/${user.username}";
     home.stateVersion = user.stateVersion;
     
    @@ -3443,9 +3261,9 @@ home.stateVersion = user.stateVersion;
    -
    -

    20. Emacs

    -
    +
    +

    21. Emacs

    +

    I practically live inside emacs. The configuration for it is a mix between init.el and the nix configuration. Nix allows me to install emacs packages as part of the configuration which is most of the following file. @@ -3523,9 +3341,9 @@ enable = true;

    -
    -

    20.1. Early Initialization

    -
    +
    +

    21.1. Early Initialization

    +

    There are some emacs settings that can be configured before the gui shows up. And some of them help increase performance and let the gui show up that much faster. @@ -3629,9 +3447,9 @@ package-archive-priorities '(("gnu" . 99)

    -
    -

    20.2. Initialization

    -
    +
    +

    21.2. Initialization

    +

    Now starts the main emacs configuration.

    @@ -4041,23 +3859,23 @@ the top of the file."
    -
    -

    21. Machines

    -
    +
    +

    22. Machines

    +

    Only a few more things left. Specifically the machine level extra settings.

    -
    -

    21.1. Traveldroid

    -
    +
    +

    22.1. Traveldroid

    +

    The configuration for the laptop does not change much. Most changes are because the hardware is different.

    -
    -

    21.1.1. System Level

    -
    +
    +

    22.1.1. System Level

    +

    Anything specific for the laptop.

    @@ -4073,9 +3891,9 @@ Anything specific for the laptop.
    -
    -

    21.1.2. Hardware

    -
    +
    +

    22.1.2. Hardware

    +

    This is the most different. Mostly taken from hardware-configuration.nix setup at first install.

    @@ -4124,9 +3942,9 @@ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistr
    -
    -

    21.1.3. Home

    -
    +
    +

    22.1.3. Home

    +

    This is mostly about configuring the monitor. And laptop specific utilities.

    @@ -4152,18 +3970,18 @@ This is mostly about configuring the monitor. And laptop specific utilities.
    -
    -

    22. README Utils

    -
    +
    +

    23. README Utils

    +
    -
    -

    22.0.1. Headers

    -
    +
    +

    23.0.1. Headers

    +

    This script adds a DO NOT MODIFY header to all the generated nix files.

    -
    (progn
    +
    (progn
     (defun add-tangle-headers ()
     (message "running in %s" (buffer-file-name))
     (when (string= (file-name-extension (buffer-file-name)) "nix")
    @@ -4180,7 +3998,7 @@ This script adds a DO NOT MODIFY header to all the generated nix fi
     

    Author: henrov

    -

    Created: 2026-03-01 zo 22:24

    +

    Created: 2026-03-02 ma 13:37

    Validate

    diff --git a/henrovnix_ok/configuration/apps/flatpaks.nix b/henrovnix_ok/configuration/apps/flatpaks.nix new file mode 100644 index 000000000..6cfc4efea --- /dev/null +++ b/henrovnix_ok/configuration/apps/flatpaks.nix @@ -0,0 +1,105 @@ +{ config, pkgs, lib, flakeRoot, ... }: +let + moduleName = "install-flatpaks"; + flatpakConfPath = flakeRoot.outPath + "/assets/conf/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; + extraPortals = with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + ]; + }; + + # 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 ]; + }; +} diff --git a/henrovnix_ok/configuration/apps/packages.nix b/henrovnix_ok/configuration/apps/packages.nix new file mode 100644 index 000000000..a8a29312e --- /dev/null +++ b/henrovnix_ok/configuration/apps/packages.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, flakeRoot, inputs, ... }: +let + 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; + packages = builtins.seq _guard (map resolvePkg entries); + zenBrowser = + inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default; +in +{ + environment.systemPackages = + packages + ++ [ zenBrowser ]; +} diff --git a/henrovnix_ok/configuration/core/login-lightdm.nix b/henrovnix_ok/configuration/core/login-lightdm.nix index d9b51ef15..8db32db88 100644 --- a/henrovnix_ok/configuration/core/login-lightdm.nix +++ b/henrovnix_ok/configuration/core/login-lightdm.nix @@ -2,7 +2,7 @@ let lightdmConf = builtins.readFile ../../assets/conf/core/lightdm.conf; - lockPng = ../../assets/lock.png; + lockPng = ../../assets/lockscreen.png; greeterConfPath = ../../assets/conf/core/lightdm-gtk-greeter.conf; greeterRaw = builtins.readFile greeterConfPath; @@ -26,17 +26,14 @@ let if ms == [] then null else builtins.elemAt ms 0; in if m == null then null else lib.strings.trim (builtins.elemAt m 0); - # In your greeter.conf these are *package keys*, not theme names. themePkgKey = getIniValue "theme-name"; iconPkgKey = getIniValue "icon-theme-name"; cursorPkgKey = getIniValue "cursor-theme-name"; - cursorSizeStr = getIniValue "cursor-theme-size"; cursorSize = if cursorSizeStr == null then null else lib.toInt (lib.strings.trim cursorSizeStr); - # Map package-keys (from greeter.conf) -> { package, name } # # IMPORTANT: diff --git a/henrovnix_ok/configuration/default.nix b/henrovnix_ok/configuration/default.nix index 6e92a2a24..b79c3987c 100644 --- a/henrovnix_ok/configuration/default.nix +++ b/henrovnix_ok/configuration/default.nix @@ -1,8 +1,8 @@ { pkgs, user, ... } : { imports = [ - ./apps/install_flatpaks.nix - ./apps/install_packages.nix + ./apps/flatpaks.nix + ./apps/packages.nix ./core/files.nix ./core/locale.nix ./core/networking.nix diff --git a/henrovnix_ok/flake.nix b/henrovnix_ok/flake.nix index 00ecd5548..12a03abaf 100644 --- a/henrovnix_ok/flake.nix +++ b/henrovnix_ok/flake.nix @@ -86,7 +86,6 @@ in }; }; - # Copying ./assets/config/.config to ~/.config # Ensure the script is executable and available environment.systemPackages = [ pkgs.bash ]; diff --git a/henrovnix_ok/home/apps/ollama.nix b/henrovnix_ok/home/apps/ollama.nix index 77146f262..faed6c616 100644 --- a/henrovnix_ok/home/apps/ollama.nix +++ b/henrovnix_ok/home/apps/ollama.nix @@ -1,12 +1,7 @@ { config, lib, pkgs, flakeRoot, ... }: -let - ollamaConfPath = flakeRoot.outPath + "/assets/conf/apps/ai/ollama/ollama.conf"; - envVars = builtins.fromJSON (builtins.readFile ollamaConfPath); -in { services.ollama = { enable = true; package = pkgs.ollama; - environmentVariables = envVars; }; } diff --git a/henrovnix_ok/home/default.nix b/henrovnix_ok/home/default.nix index b4c97fc7a..ca279f6af 100644 --- a/henrovnix_ok/home/default.nix +++ b/henrovnix_ok/home/default.nix @@ -9,7 +9,6 @@ ./desktop/hyprlock.nix ./desktop/hyprscrolling.nix ./desktop/hyprshell.nix - ./desktop/powermenu.nix #./desktop/animated_wallpaper.nix ./desktop/rotating_wallpaper.nix ./desktop/waybar.nix diff --git a/henrovnix_ok/home/desktop/animated_wallpaper.nix b/henrovnix_ok/home/desktop/animated_wallpaper.nix index 3d38b2470..0591d9722 100644 --- a/henrovnix_ok/home/desktop/animated_wallpaper.nix +++ b/henrovnix_ok/home/desktop/animated_wallpaper.nix @@ -1,20 +1,12 @@ { config, pkgs, lib, flakeRoot, ... }: let - repoWallpaperDir = flakeRoot.outPath + "/assets/conf/desktop/wallpaper"; - userRelRoot = ".config/nixos_conf/wallpaperstuff"; - userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}"; - userVideoPath = "${userAbsRoot}/videos/myWallpaper.mp4"; + userVideoPath = ".config/nixos_conf/wallpaperstuff/videos/myWallpaper.mp4"; in { home.packages = [ pkgs.mpvpaper pkgs.mpv ]; - # Sync repo wallpapers (including videos/) into ~/nixos_conf/wallpaperstuff - home.file."${userRelRoot}" = { - source = lib.mkForce repoWallpaperDir; - recursive = true; - }; systemd.user.services.mpvpaper-wallpaper = { Unit = { Description = "Video wallpaper (mpvpaper)"; diff --git a/henrovnix_ok/home/desktop/hyprexpo.nix b/henrovnix_ok/home/desktop/hyprexpo.nix index c859130ff..47681927d 100644 --- a/henrovnix_ok/home/desktop/hyprexpo.nix +++ b/henrovnix_ok/home/desktop/hyprexpo.nix @@ -19,8 +19,8 @@ gaps_in = 5 gaps_out = 20 - # Optional; comment out if you don't want it - # workspace_method = center current + # Comment out if you don't want it + workspace_method = center current } } ''; diff --git a/henrovnix_ok/home/desktop/hypridle.nix b/henrovnix_ok/home/desktop/hypridle.nix index cddc8063b..ca7a55135 100644 --- a/henrovnix_ok/home/desktop/hypridle.nix +++ b/henrovnix_ok/home/desktop/hypridle.nix @@ -1,10 +1,4 @@ { config, lib, pkgs, flakeRoot, ... }: -let - hypridleConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hypridle.conf"; -in { home.packages = [ pkgs.hypridle ]; - home.file.".config/hypr/hypridle.conf" = { - source = lib.mkForce hypridleConf; - }; } diff --git a/henrovnix_ok/home/desktop/hyprland.nix b/henrovnix_ok/home/desktop/hyprland.nix index a657b27e7..9c2d1ad6b 100644 --- a/henrovnix_ok/home/desktop/hyprland.nix +++ b/henrovnix_ok/home/desktop/hyprland.nix @@ -1,15 +1,12 @@ { config, lib, pkgs, flakeRoot, ... }: let - hyprConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprland.conf"; bindingsConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/bindings.conf"; lidLockScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/lid-lock.sh"; in { wayland.windowManager.hyprland = { enable = true; - # Load base config + bindings from repo files - extraConfig = '' - ${builtins.readFile hyprConf} + # Load bindings from repo files # --- Repo keybindings --- ${builtins.readFile bindingsConf} ''; @@ -19,11 +16,6 @@ in ]; }; }; - # Gebruik home.file voor echte bestanden (geen symlinks) - home.file.".config/hypr/scripts/lid-lock.sh" = { - source = lib.mkForce lidLockScript; - executable = true; - }; xdg.portal = { enable = true; extraPortals = with pkgs; [ diff --git a/henrovnix_ok/home/desktop/hyprlock.nix b/henrovnix_ok/home/desktop/hyprlock.nix index 84fdd44f7..536cd1d83 100644 --- a/henrovnix_ok/home/desktop/hyprlock.nix +++ b/henrovnix_ok/home/desktop/hyprlock.nix @@ -1,15 +1,4 @@ { config, lib, pkgs, flakeRoot, ... }: -let - lockPngSrc = flakeRoot.outPath + "/assets/lock.png"; - hyprlockConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprlock.conf"; -in { home.packages = [ pkgs.hyprlock ]; - # Gebruik home.file voor echte bestanden (geen symlinks) - home.file.".config/hypr/lock.png" = { - source = lib.mkForce lockPngSrc; - }; - home.file.".config/hypr/hyprlock.conf" = { - source = lib.mkForce hyprlockConf; - }; } diff --git a/henrovnix_ok/home/desktop/hyprscrolling.nix b/henrovnix_ok/home/desktop/hyprscrolling.nix index 32c378d16..e5d4cd409 100644 --- a/henrovnix_ok/home/desktop/hyprscrolling.nix +++ b/henrovnix_ok/home/desktop/hyprscrolling.nix @@ -1,41 +1,13 @@ { config, lib, pkgs, flakeRoot, ... }: -let - # Hyprscrolling drop-in config (repo -> ~/.config) - repoConf = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprscrolling.conf"; - targetRel = "hypr/conf.d/90-hyprscrolling.conf"; - # Overflow indicator script - repoOverflowScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh"; - targetOverflowRel = "hypr/scripts/hyprscroll-overflow.sh"; - # Adapt columnsize to monitor - repoPerMonitorScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/hyprscrolling-per-monitor.sh"; - targetPerMonitor = "hypr/scripts/hyprscrolling-per-monitor.sh"; - # Switch between scrolling/dwindle - repoSwitchScript = flakeRoot.outPath + "/assets/conf/desktop/hypr/scripts/toggle-layout-scrolling-dwindle.sh"; - targetSwitchScript = "hypr/scripts/toggle-layout-scrolling-dwindle.sh"; -in { home.packages = with pkgs; [ jq ]; wayland.windowManager.hyprland = { enable = true; - plugins = [ pkgs.hyprlandPlugins.hyprscrolling ]; - extraConfig = '' - source = ${config.xdg.configHome}/${targetRel} - ''; - }; - # Copy repo configs/scripts into ~/.config (als echte bestanden) - home.file."${targetRel}" = { - source = lib.mkForce repoConf; - }; - home.file."${targetOverflowRel}" = { - source = lib.mkForce repoOverflowScript; - executable = true; - }; - home.file."${targetPerMonitor}" = { - source = lib.mkForce repoPerMonitorScript; - executable = true; - }; - home.file."${targetSwitchScript}" = { - source = lib.mkForce repoSwitchScript; - executable = true; + plugins = [ pkgs.hyprlandPlugins.hyprscrolling + pkgs.hyprlandPlugins.hyprspace + pkgs.hyprlandPlugins.hyprsunset + pkgs.hyprlandPlugins.HyprEasymotion + + ]; }; } diff --git a/henrovnix_ok/home/desktop/hyprshell.nix b/henrovnix_ok/home/desktop/hyprshell.nix index 72fcd1a9d..44cd07aa2 100644 --- a/henrovnix_ok/home/desktop/hyprshell.nix +++ b/henrovnix_ok/home/desktop/hyprshell.nix @@ -1,19 +1,8 @@ # home/desktop/hyprshell.nix (Home-Manager module) { config, pkgs, lib, flakeRoot, ... }: -let - repoDir = flakeRoot.outPath + "/assets/conf/desktop/hypr/hyprshell"; - cfgRon = repoDir + "/config.ron"; - cssFile = repoDir + "/styles.css"; -in { xdg.enable = true; home.packages = [ pkgs.hyprshell ]; - # Gebruik home.file voor echte bestanden (geen symlinks) - home.file.".config/hyprshell/config.ron" = { - source = lib.mkForce cfgRon; - }; - home.file.".config/hyprshell/styles.css" = { - source = lib.mkForce cssFile; }; # Autostart (systemd user service) systemd.user.services.hyprshell = { diff --git a/henrovnix_ok/home/desktop/rotating_wallpaper.nix b/henrovnix_ok/home/desktop/rotating_wallpaper.nix index ba1c3e5c3..77c8bb3c2 100644 --- a/henrovnix_ok/home/desktop/rotating_wallpaper.nix +++ b/henrovnix_ok/home/desktop/rotating_wallpaper.nix @@ -1,30 +1,9 @@ -#+begin_src nix :tangle home/desktop/wallpaper.nix :noweb tangle :mkdirp yes { config, pkgs, lib, flakeRoot, ... }: let - repoWallpaperDir = flakeRoot.outPath + "/assets/conf/desktop/wallpaper"; - repoWallpaperConf = flakeRoot.outPath + "/assets/conf/desktop/wallpaper/wallpaper.conf"; - userRelRoot = "nixos_conf/wallpaperstuff"; - userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}"; - userConfPath = "${userAbsRoot}/wallpaper.conf"; - # Exclude wallpaper.conf so HM does NOT manage it (avoids backup collisions) - repoWallpapersOnly = lib.cleanSourceWith { - src = repoWallpaperDir; - filter = path: type: (builtins.baseNameOf path) != "wallpaper.conf"; - }; + userConfPath = "${config.home.homeDirectory}/nixos_conf/wallpaperstuff/wallpaper.conf"; in { home.packages = [ pkgs.wpaperd ]; - # Sync everything *except* wallpaper.conf into ~/nixos_conf/wallpaperstuff - home.file."${userRelRoot}" = { - source = lib.mkForce repoWallpapersOnly; - recursive = true; - }; - # Now safely overwrite the config every activation (no HM collision) - home.activation.wallpaperConfForce = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - set -euo pipefail - mkdir -p "${userAbsRoot}" - install -m 0644 "${repoWallpaperConf}" "${userConfPath}" - ''; systemd.user.services.wpaperd = { Unit = { Description = "wpaperd wallpaper daemon"; diff --git a/henrovnix_ok/home/desktop/walker.nix b/henrovnix_ok/home/desktop/walker.nix index 6d96227e8..ea1bc943f 100644 --- a/henrovnix_ok/home/desktop/walker.nix +++ b/henrovnix_ok/home/desktop/walker.nix @@ -8,17 +8,11 @@ let if inputs != null && inputs ? elephant then inputs.elephant.packages.${pkgs.system}.default else pkgs.elephant; - sessionTarget = "graphical-session.target"; - # All theme files now live here - repoThemesDir = flakeRoot.outPath + "/assets/conf/desktop/walker"; + sessionTarget = "graphical-session.target";; in { xdg.enable = true; home.packages = [ walkerPkg elephantPkg ]; - # ~/.config/walker/themes/* - xdg.configFile."walker/themes/frosted/default.css".source = lib.mkForce (repoThemesDir + "/themes/frosted/default.css"); - xdg.configFile."walker/themes/frosted/style.css".source = lib.mkForce (repoThemesDir + "/themes/frosted/style.css"); - xdg.configFile."walker/config.toml".source = lib.mkForce (repoThemesDir + "/config.toml"); # xdg.configFile."walker/themes/default.html".source = lib.mkForce repoThemesDir + "/default.html"; # (services unchanged) systemd.user.services.elephant = { /* ... your existing service ... */ }; diff --git a/henrovnix_ok/home/desktop/waybar.nix b/henrovnix_ok/home/desktop/waybar.nix index c37a8f297..774241702 100644 --- a/henrovnix_ok/home/desktop/waybar.nix +++ b/henrovnix_ok/home/desktop/waybar.nix @@ -1,17 +1,4 @@ { config, lib, pkgs, flakeRoot, ... }: -let - repoWaybarDir = flakeRoot.outPath + "/assets/conf/desktop/waybar"; -in { programs.waybar.enable = true; - programs.waybar.style = lib.mkForce ""; # Schakel standaardstijl uit - home.file.".config/waybar/config" = { - source = lib.mkForce "${repoWaybarDir}/config.jsonc"; - }; - # Overschrijf style.css handmatig na alle andere stappen - home.activation.waybarStyle = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - mkdir -p "${config.xdg.configHome}/waybar" - cp "${repoWaybarDir}/style.css" "${config.xdg.configHome}/waybar/style.css" - chmod 644 "${config.xdg.configHome}/waybar/style.css" - ''; } diff --git a/henrovnix_ok/home/dev/alacritty.nix b/henrovnix_ok/home/dev/alacritty.nix index b0baabe8d..4ee7d1b91 100644 --- a/henrovnix_ok/home/dev/alacritty.nix +++ b/henrovnix_ok/home/dev/alacritty.nix @@ -1,12 +1,6 @@ { config, pkgs, lib, flakeRoot, ... }: -let - repoAlacrittyConf = flakeRoot.outPath + "/assets/conf/dev/alacritty.toml"; -in { xdg.enable = true; programs.alacritty.enable = true; - # Override the config generated by programs.alacritty - xdg.configFile."alacritty/alacritty.toml".source = lib.mkForce repoAlacrittyConf; - catppuccin.alacritty.enable = true; catppuccin.alacritty.flavor = "mocha"; } diff --git a/henrovnix_ok/home/dev/kitty.nix b/henrovnix_ok/home/dev/kitty.nix index 43be955af..476efca5c 100644 --- a/henrovnix_ok/home/dev/kitty.nix +++ b/henrovnix_ok/home/dev/kitty.nix @@ -1,27 +1,12 @@ { config, pkgs, lib, flakeRoot, ... }: -let - catppuccinMochaConf = - builtins.readFile (flakeRoot.outPath + "/assets/conf/dev/terminal/Catppuccin-Mocha.conf"); - # Your own keymaps / other settings (but we will NOT rely on it for opacity) - repoKittyConfText = - builtins.readFile (flakeRoot.outPath + "/assets/conf/dev/terminal/kitty.conf"); -in { xdg.enable = true; - # Stable theme file so kitty.conf can include it without /nix/store paths - xdg.configFile."kitty/themes/Catppuccin-Mocha.conf".text = lib.mkForce catppuccinMochaConf; programs.kitty = { enable = true; - # Home Manager generates ~/.config/kitty/kitty.conf; we append in-order: - # 1) include theme - # 2) your repo config (keymaps etc.) - # 3) force opacity LAST so it always wins extraConfig = '' # 1) Theme first (stable path) include themes/Catppuccin-Mocha.conf - # 2) Your repo config (may also include theme; harmless if duplicated) - ${repoKittyConfText} - # 3) Force transparency last (wins) + # 2) Force transparency last (wins) #background_opacity 0.60 #dynamic_background_opacity yes ''; diff --git a/henrovnix_ok/home/dev/shells.nix b/henrovnix_ok/home/dev/shells.nix index 3b82f7b5f..a08c4c458 100644 --- a/henrovnix_ok/home/dev/shells.nix +++ b/henrovnix_ok/home/dev/shells.nix @@ -21,7 +21,7 @@ let trim = lib.strings.trim; # ---------- minimal INI-ish parser (sections + raw lines) ---------- readMaybe = p: if builtins.pathExists p then builtins.readFile p else ""; - normalizeLine = l: trim (lib.replaceStrings [ "\r" ] [ "" ] l); + normalizeLine = l: trim (l`ib.replaceStrings [ "\r" ] [ "" ] l); parseSections = text: let lines = map normalizeLine (lib.splitString "\n" text); diff --git a/henrovnix_ok/home/dev/starship.nix b/henrovnix_ok/home/dev/starship.nix index 530ee87ec..fd379d41d 100644 --- a/henrovnix_ok/home/dev/starship.nix +++ b/henrovnix_ok/home/dev/starship.nix @@ -1,9 +1,4 @@ { config, pkgs, lib, flakeRoot, ... }: -let - repoStarshipToml = flakeRoot.outPath + "/assets/conf/dev/terminal/starship.toml"; - # The exact key that appears in the error: - targetKey = "${config.home.homeDirectory}/.config/starship.toml"; -in { xdg.enable = true; programs.starship = { @@ -12,6 +7,4 @@ in enableBashIntegration = true; enableFishIntegration = true; }; - # Force the *actual conflicting option* (home.file."".source) - home.file."${targetKey}".source = lib.mkForce repoStarshipToml; }