rebuilding minimised nix files

This commit is contained in:
2026-03-02 13:37:55 +01:00
parent dc732a98c1
commit ff31d38f5a
22 changed files with 546 additions and 730 deletions
+381 -563
View File
File diff suppressed because it is too large Load Diff
@@ -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 ];
};
}
@@ -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 ];
}
@@ -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:
+2 -2
View File
@@ -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
-1
View File
@@ -86,7 +86,6 @@ in
};
};
# Copying ./assets/config/.config to ~/.config
# Ensure the script is executable and available
environment.systemPackages = [ pkgs.bash ];
-5
View File
@@ -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;
};
}
-1
View File
@@ -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
@@ -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)";
+2 -2
View File
@@ -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
}
}
'';
-6
View File
@@ -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;
};
}
+1 -9
View File
@@ -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; [
-11
View File
@@ -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;
};
}
+6 -34
View File
@@ -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
];
};
}
-11
View File
@@ -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 = {
@@ -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";
+1 -7
View File
@@ -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 ... */ };
-13
View File
@@ -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"
'';
}
-6
View File
@@ -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";
}
+1 -16
View File
@@ -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
'';
+1 -1
View File
@@ -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);
-7
View File
@@ -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."<abs path>".source)
home.file."${targetKey}".source = lib.mkForce repoStarshipToml;
}