Working on reshuffling

This commit is contained in:
2026-03-19 06:43:26 +00:00
parent 37d2d75bb1
commit 85b7209c08
33 changed files with 1371 additions and 0 deletions
@@ -0,0 +1,28 @@
{ config, pkgs, ... }:
{
# Enable Bluetooth hardware and daemon
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
packages = with pkgs; [ bluez ];
};
# Enable Bluetooth audio support in PipeWire
services.pipewire = {
config.pulse = {
bluez5.enable = true;
};
};
# Optional: Additional Bluetooth settings
hardware.bluetooth.extraConfig = ''
AutoEnable=true
DiscoverableTimeout=0
PairableTimeout=0
'';
# Install a graphical Bluetooth manager (optional)
environment.systemPackages = with pkgs; [
blueman
];
}
@@ -0,0 +1,28 @@
# ./generated/hosts/traveldroid/traveldroid.nix
{ config, pkgs, lib, ... }:
let
coreEnabled = config.mySystem.system.core.enable or false;
in lib.mkIf coreEnabled {
boot = {
initrd = {
verbose = false;
kernelModules = [ ];
};
extraModulePackages = [ ];
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [ "silent" ];
consoleLogLevel = 0;
plymouth.enable = true;
supportedFilesystems = [ "ntfs" ];
loader = {
systemd-boot.enable = true;
systemd-boot.configurationLimit = 10;
efi.canTouchEfiVariables = true;
timeout = 5;
};
};
}
@@ -0,0 +1,25 @@
{ lib, config, ... }:
let
cfg = config.mySystem.system.core;
in
{
options.mySystem.system.core.enable =
lib.mkEnableOption "Core System Settings";
imports = [
./locale.nix
./networking.nix
./services.nix
./users/user.nix
./homebase.nix
./nix.nix
./boot.nix
];
config = lib.mkIf cfg.enable {
# alleen echt "core-specifieke" dingen hier
nixpkgs.config.allowUnfree = true;
};
}
@@ -0,0 +1,13 @@
{ config, pkgs, lib, ... }:
{
services.dbus = lib.mkForce {
enable = true; # Force this to be true
};
# Configure dbus-broker via its configuration file
environment.etc."dbus-broker/launch.conf".text = ''
[General]
LogLevel=warning
MaxConnectionsPerUser=2048
'';
}
@@ -0,0 +1,30 @@
{ pkgs, user, ... }:
{
environment.systemPackages = with pkgs; [
gtk3 # GTK target
gtk4 # GTK target
];
# Stylix GTK target
stylix.targets.gtk.enable = true;
home-manager.users.${user.username} = {
gtk = {
enable = true;
theme = {
name = "Catppuccin-Mocha-Standard-Blue-Dark";
package = pkgs.magnetic-catppuccin-gtk;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
};
}
@@ -0,0 +1,47 @@
{
hostname,
pkgs,
lib,
modulesPath,
user,
config,
...
}:
{
imports = [
# (modulesPath + "/installer/scan/not-detected.nix")
#../../hardware/hardware.nix
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
"rtsx_usb_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/69433a14-fbaf-401b-af85-cd1bbf02b4e2";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/811D-0676";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/b6c557c2-7682-460b-a5e7-8f6f2f429a3a"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
@@ -0,0 +1,28 @@
{ lib, config, ... }:
let
coreEnabled = config.mySystem.system.core.enable or false;
in
{
options.mySystem.system.locale.enable =
lib.mkEnableOption "Home-Manager settings";
config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) {
# --- Home Manager Base ---
home-manager = {
backupFileExtension = "backup";
users.henrov = {
home.sessionVariables = {
TERMINAL = "kitty";
EDITOR = "emacs";
BROWSER = "zen";
};
home.stateVersion = "25.11";
};
};
};
}
@@ -0,0 +1,26 @@
{ lib, config, ... }:
let
coreEnabled = config.mySystem.system.core.enable or false;
in
{
options.mySystem.system.locale.enable =
lib.mkEnableOption "Locale settings";
config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) {
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "nl_NL.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "nl_NL.UTF-8";
LC_IDENTIFICATION = "nl_NL.UTF-8";
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_MONETARY = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
LC_NUMERIC = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "nl_NL.UTF-8";
};
};
}
@@ -0,0 +1,14 @@
{ pkgs, user, ... } :
{
environment.systemPackages = with pkgs; [
tuigreet
];
services.greetd = {
enable = true;
settings = {
default_session = {
command = pkgs.lib.mkForce "${pkgs.tuigreet}/bin/tuigreet --remember --time --time-format '%I:%M %p | %a %h | %F'";
};
};
};
}
@@ -0,0 +1,41 @@
{ lib, config, pkgs,... }:
let
coreEnabled = config.mySystem.system.core.enable or false;
in
{
options.mySystem.system.locale.enable =
lib.mkEnableOption "Network settings";
config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) {
networking = {
useDHCP = lib.mkDefault true;
networkmanager.enable = true;
networkmanager.wifi.backend = "iwd";
wireless.iwd.enable = true;
wireless.userControlled.enable = true;
firewall = {
enable = true;
# KDE Connect: discovery + encrypted connections
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
}
];
};
};
# Install NetworkManager
environment.systemPackages = with pkgs; [
networkmanager
];
};
}
@@ -0,0 +1,20 @@
{ lib, config, ... }:
let
coreEnabled = config.mySystem.system.core.enable or false;
in
{
options.mySystem.system.locale.enable =
lib.mkEnableOption "Flake & Nix settings";
config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) {
# --- Flakes & Nix Settings ---
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
download-buffer-size = 536870912; # 512 MB
cores = 2;
max-jobs = 1;
};
};
}
@@ -0,0 +1,23 @@
{ lib, config, ... }:
let
coreEnabled = config.mySystem.system.core.enable or false;
in
{
options.mySystem.system.locale.enable =
lib.mkEnableOption "Services settings (printing / audio)";
config = lib.mkIf (coreEnabled || config.mySystem.system.locale.enable) {
# --- Services (Printing & Audio) ---
services.printing.enable = true;
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
}
@@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
# (NVF = Neovim/terminal flavor)
stylix.targets.nvf.enable = true;
# feh wallpaper integration
stylix.targets.feh.enable = true;
}
@@ -0,0 +1,60 @@
{ inputs, config, ... }:
{
flake.nixosConfigurations."traveldroid" = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules =
[
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
] ++
(builtins.attrValues config.flake.nixosModules) ++
[
./hardware-configuration.nix
({ ... }: {
networking.hostName = "traveldroid";
system.stateVersion = "25.11";
boot = {
loader = {
grub = {
enable = true;
efiSupport = true;
device = "nodev";
useOSProber = true;
};
efi.canTouchEfiVariables = true;
};
# initrd.systemd.tpm2.enable = false;
kernelParams = [
"systemd.mask=dev-tpm0.device"
"systemd.mask=dev-tpmrm0.device"
];
};
# systemd.tpm2.enable = false;
# Enable various user-defined modules
mySystem = {
# Turn on the core system
system.core.enable = true;
# Hardware-specific modules
hardware.nvidia.enable = false;
# Define Environment
desktop = {
hyprland.enable = true;
noctalia.enable = true;
stylix.enable = true;
};
};
})
];
};
}
@@ -0,0 +1,7 @@
{
username = "henrov";
hashedPassword = "$6$ISAmsPLyFi7idYXr$VmZsq.zMsyh1irSkyDNqtorNXG0oEHbbMVqTii1t8bymvrQ5ZQmbdi4OiBNeNYe/huHGrojXM.3TST2fTLz0T.";
homeDirectory = "/home/henrov";
stateVersion = "25.11";
locale = "nl_NL.UTF-8";
}
@@ -0,0 +1,23 @@
{
config,
pkgs,
lib,
inputs,
...
}:
let
user = import ./henrov.nix;
in
{
home-manager.users.${user.username} = {
home.stateVersion = "25.11";
home.username = user.username;
home.homeDirectory = user.homeDirectory;
};
# Ensure the user is in the necessary groups
users.users.${config.users.users.${user.username}.username} = {
extraGroups = [ "wheel" "networkmanager" ];
};
}
@@ -0,0 +1,7 @@
{ config, pkgs, ... }:
{
xdg.portal = {
enable = true;
config.system.default = [ "hyprland" "gtk" ];
};
}
@@ -0,0 +1,400 @@
;;; package --- Summary - My minimal Emacs init file -*- lexical-binding: t -*-
;;; Commentary:
;;; Simple Emacs setup I carry everywhere
;;; Code:
(setq custom-file (locate-user-emacs-file "custom.el"))
(load custom-file 'noerror) ;; no error on missing custom file
(require 'package)
(package-initialize)
(defun reset-custom-vars ()
"Resets the custom variables that were set to crazy numbers"
(setopt gc-cons-threshold (* 1024 1024 100))
(setopt garbage-collection-messages t))
(use-package emacs
:custom
(native-comp-async-query-on-exit t)
(read-answer-short t)
(use-short-answers t)
(enable-recursive-minibuffers t)
(which-func-update-delay 1.0)
(visible-bell nil)
(custom-buffer-done-kill t)
(whitespace-line-column nil)
(x-underline-at-descent-line t)
(imenu-auto-rescan t)
(uniquify-buffer-name-style 'forward)
(confirm-nonexistent-file-or-buffer nil)
(create-lockfiles nil)
(make-backup-files nil)
(kill-do-not-save-duplicates t)
(sentence-end-double-space nil)
(treesit-enabled-modes t)
:init
;; base visual
(menu-bar-mode -1) ;; no menu bar
(toggle-scroll-bar -1) ;; no scroll bar
(tool-bar-mode -1) ;; no tool bar either
(blink-cursor-mode -1) ;; stop blinking
;; font of the century
(set-frame-font "Aporetic Sans Mono 12" nil t)
:bind
(("C-<wheel-up>" . pixel-scroll-precision) ; dont zoom in please, just scroll
("C-<wheel-down>" . pixel-scroll-precision) ; dont zoom in either, just scroll
("C-x k" . kill-current-buffer)) ; kill the buffer, dont ask
:hook
(text-mode . delete-trailing-whitespace-mode)
(prog-mode . delete-trailing-whitespace-mode)
(after-init . global-display-line-numbers-mode) ;; always show line numbers
(after-init . column-number-mode) ;; column number in the mode line
(after-init . size-indication-mode) ;; file size in the mode line
(after-init . pixel-scroll-precision-mode) ;; smooth mouse scroll
(after-init . electric-pair-mode) ;; i mean ... parens should auto create
(after-init . reset-custom-vars)
)
(use-package autorevert
:ensure nil
:custom
(auto-revert-interval 3)
(auto-revert-remote-files nil)
(auto-revert-use-notify t)
(auto-revert-avoid-polling nil)
(auto-revert-verbose t)
:hook
(after-init . global-auto-revert-mode))
(use-package recentf
:ensure nil
:commands (recentf-mode recentf-cleanup)
:hook
(after-init . recentf-mode)
:custom
(recentf-auto-cleanup 'never)
(recentf-exclude
(list "\\.tar$" "\\.tbz2$" "\\.tbz$" "\\.tgz$" "\\.bz2$"
"\\.bz$" "\\.gz$" "\\.gzip$" "\\.xz$" "\\.zip$"
"\\.7z$" "\\.rar$"
"COMMIT_EDITMSG\\'"
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
"-autoloads\\.el$" "autoload\\.el$"))
:config
;; A cleanup depth of -90 ensures that `recentf-cleanup' runs before
;; `recentf-save-list', allowing stale entries to be removed before the list
;; is saved by `recentf-save-list', which is automatically added to
;; `kill-emacs-hook' by `recentf-mode'.
(add-hook 'kill-emacs-hook #'recentf-cleanup -90))
(use-package savehist
:ensure nil
:commands (savehist-mode savehist-save)
:hook
(after-init . savehist-mode)
:custom
(savehist-autosave-interval 600)
(savehist-additional-variables
'(kill-ring ; clipboard
register-alist ; macros
mark-ring global-mark-ring ; marks
search-ring regexp-search-ring)))
(use-package hl-line
:ensure nil
:custom
(hl-line-sticky-flag nil)
(global-hl-line-sticky-flag nil)
:hook
(after-init . global-hl-line-mode))
(use-package saveplace
:ensure nil
:commands (save-place-mode save-place-local-mode)
:hook
(after-init . save-place-mode)
:custom
(save-place-limit 400))
(use-package nerd-icons
:custom
;; disable bright icon colors
(nerd-icons-color-icons nil))hells.nix
(use-package doom-modeline
:custom
(inhibit-compacting-font-caches t) ;; speed
(doom-modeline-buffer-file-name-style 'relative-from-project)
(doom-modeline-major-mode-icon nil) ;; distracting icons, no thank you
(doom-modeline-buffer-encoding nil) ;; everything is utf-8 anyway
(doom-modeline-buffer-state-icon nil) ;; the filename already shows me
(doom-modeline-lsp nil) ;; lsp state is too distracting, too often
:hook (after-init . doom-modeline-mode))
(load-theme 'catppuccin :no-confirm)
(use-package diminish :demand t) ;; declutter the modeline
(use-package eldoc
:diminish eldoc-mode
:custom
(eldoc-echo-area-use-multiline-p nil)) ;; docs for everything
(use-package eldoc-box
:defer t
:config
(set-face-background 'eldoc-box-border (catppuccin-color 'green))
(set-face-background 'eldoc-box-body (catppuccin-color 'base))
:bind
(("M-h" . eldoc-box-help-at-point)))
(use-package pulsar
:commands pulsar-global-mode pulsar-recenter-top pulsar-reveal-entry
:init
(defface pulsar-catppuccin
`((default :extend t)
(((class color) (min-colors 88) (background light))
:background ,(catppuccin-color 'sapphire))
(((class color) (min-colors 88) (background dark))
:background ,(catppuccin-color 'sapphire))
(t :inverse-video t))
"Alternative nord face for `pulsar-face'."
:group 'pulsar-faces)
:custom
(pulsar-face 'pulsar-catppuccin)
:hook
(after-init . pulsar-global-mode))
(use-package which-key
:commands which-key-mode
:diminish which-key-mode
:hook
(after-init . which-key-mode))
(use-package expreg
:bind ("M-m" . expreg-expand))
(use-package vundo) ;; undo tree
;; better structured editing
(use-package puni
:commands puni-global-mode
:hook
(after-init . puni-global-mode))
(use-package avy
:bind
("M-i" . avy-goto-char-2)
:custom
(avy-background t))
(use-package consult
:bind
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
("M-y" . consult-yank-pop) ;; orig. yank-pop
("M-g M-g" . consult-goto-line) ;; orig. goto-line
("M-g i" . consult-imenu) ;; consult version is interactive
("M-g r" . consult-ripgrep) ;; find in project also works
:custom
(consult-narrow-key "<"))
(use-package vertico
:commands vertico-mode
:custom
(read-file-name-completion-ignore-case t)
(read-buffer-completion-ignore-case t)
(completion-ignore-case t)
(enable-recursive-minibuffers t)
(minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))
:init
(vertico-mode)
:hook
(minibuffer-setup-hook . cursor-intangible-mode))
(use-package marginalia
:commands marginalia-mode
:hook (after-init . marginalia-mode))
(use-package crux
:bind
("C-c M-e" . crux-find-user-init-file)
("C-c C-w" . crux-transpose-windows)
("C-c M-d" . crux-find-current-directory-dir-locals-file)
("C-a" . crux-move-beginning-of-line))
(use-package magit
:bind (("C-M-g" . magit-status)))
(use-package nerd-icons-corfu
:commands nerd-icons-corfu-formatter
:defines corfu-margin-formatters)
(use-package corfu
:commands global-corfu-mode
:custom
(corfu-cycle t)
(corfu-auto t)
(corfu-auto-delay 1)
(corfu-auto-prefix 3)
(corfu-separator ?_)
:hook
(after-init . global-corfu-mode)
:config
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(use-package cape)
(use-package orderless
:custom
(completion-styles '(orderless partial-completion basic))
(completion-category-defaults nil)
(completion-category-overrides nil))
(use-package yasnippet
:commands yas-global-mode
:diminish yas-minor-mode
:hook
(after-init . yas-global-mode))
(use-package yasnippet-snippets :after yasnippet)
(use-package exec-path-from-shell
:commands exec-path-from-shell-initialize
:custom
(exec-path-from-shell-arguments nil)
:hook
(after-init . exec-path-from-shell-initialize))
(use-package nixpkgs-fmt
:custom
(nixpkgs-fmt-command "nixfmt"))
(use-package eat
:bind
(("C-c e p" . eat-project)
("C-c e t" . eat)))
(use-package f :demand t)
(use-package envrc
:commands envrc-global-mode
:hook
(after-init . envrc-global-mode))
(use-package gptel
:commands gptel-make-anthropic f-read-text
:config
(gptel-make-anthropic "Claude"
:stream t :key (f-read-text "/run/secrets/claude_key")))
(use-package sideline-flymake)
(use-package sideline-eglot)
(use-package sideline
:custom
(sideline-backends-right '(sideline-flymake sideline-eglot))
:hook
(eglot-managed-mode . sideline-mode)
(flymake-mode . sideline-mode))
(use-package eglot
:custom
(eglot-extend-to-xref t)
(eglot-ignored-server-capabilities '(:inlayHintProvider))
(jsonrpc-event-hook nil)
:hook
(eglot-managed-mode . eldoc-box-hover-mode)
(before-save . eldoc-format-buffer)
:bind
(:map eglot-mode-map
("C-c l a" . eglot-code-actions)
("C-c l r" . eglot-rename)
("C-c l h" . eldoc)
("C-c l g" . xref-find-references)
("C-c l w" . eglot-reconnect)))
(use-package proced
:custom
(proced-auto-update-flag t)
(proced-auto-update-interval 3)
(proced-enable-color-flag t)
(proced-show-remote-processes t))
(use-package org
:ensure t
:defer t
:commands (org-mode org-capture org-agenda)
:init
(defvar org-journal-file "~/nextcloud/org/journal.org")
(defvar org-archive-file "~/nextcloud/org/archive.org")
(defvar org-notes-file "~/nextcloud/org/notes.org")
(defvar org-inbox-file "~/nextcloud/org/inbox.org")
(defvar org-work-file "~/nextcloud/org/work.org")
(defun my/org-capture-project-target-heading ()
"Determine Org target headings from the current file's project path.
This function assumes a directory structure like '~/projects/COMPANY/PROJECT/'.
It extracts 'COMPANY' and 'PROJECT' to use as nested headlines
for an Org capture template.
If the current buffer is not visi
ting a file within such a
project structure, it returns nil, causing capture to default to
the top of the file."
(when-let* ((path (buffer-file-name))) ; Ensure we are in a file-visiting buffer
(let ((path-parts (split-string path "/" t " ")))
(when-let* ((projects-pos (cl-position "projects" path-parts :test #'string=))
(company (nth (+ 1 projects-pos) path-parts))
(project (nth (+ 2 projects-pos) path-parts)))
;; Return a list of headlines for Org to find or create.
(list company project)))))
:bind
(("C-c c" . org-capture)
("C-c i" . org-store-link)
("C-c a" . org-agenda)
:map org-mode-map
("C-c t" . org-toggle-inline-images)
("C-c l" . org-toggle-link-display))
:custom
(org-agenda-files (list org-inbox-file org-journal-file))
(org-directory "~/nextcloud/org")
(org-default-notes-file org-inbox-file)
(org-archive-location (concat org-archive-file "::* From %s"))
(org-log-done 'time)
(org-log-into-drawer t)
(org-hide-emphasis-markers t)
(org-src-fontify-natively t)
(org-src-tab-acts-natively t)
(org-capture-templates '(("t" "Todo" entry (file org-inbox-file)
"* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%a\n\n)")
("j" "Journal" entry (file+olp+datetree org-journal-file)
"* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%a\n\n")
("n" "Note" entry (file org-notes-file)
"* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%a\n\n")
("p" "Project Task" item
(file+function org-work-file my/org-capture-project-target-heading)
"* TODO %? \n CLOCK: %U"
))
)
:config
;; Enable syntax highlighting in code blocks
(add-hook 'org-mode-hook 'turn-on-font-lock)
(add-hook 'org-mode-hook 'org-indent-mode))
;; extras
(use-package comp-run
:ensure nil
:config
(push "tramp-loaddefs.el.gz" native-comp-jit-compilation-deny-list)
(push "cl-loaddefs.el.gz" native-comp-jit-compilation-deny-list))
(use-package rustic
:custom
(rustic-lsp-client 'eglot))
(provide 'init)
;;; init.el ends here
@@ -0,0 +1,112 @@
{ lib, ... }:
let
moduleName = "install-flatpaks";
# --- Relatief pad binnen deze module (geen flakeRoot) ---
flatpakConfPath = ./assets/system/apps/flatpaks.conf;
# --- Lees en split het bestand ---
raw = builtins.readFile flatpakConfPath;
rawLines = lib.splitString "\n" raw;
# --- Guard: check dat we niet per karakter hebben gesplit ---
_guard =
assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw);
true;
# --- Cleanup per regel ---
cleanLine = line:
let
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
noInlineComment = lib.head (lib.splitString "#" noCR);
in
lib.strings.trim noInlineComment;
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
# --- Validatie: min 2 dots (reverse-DNS stijl) ---
dotCount = s: builtins.length (lib.splitString "." s) - 1;
isValidId = s: (dotCount s) >= 2;
_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 or comment them out with '#'.
''
) entries
);
flatpakApps = builtins.seq _validate entries;
in
{
# --- Export as NixOS module via flake.nixosModules ---
flake.nixosModules.flatpaks = { config, pkgs, lib, ... }:
let
syncFlatpaks = pkgs.writeShellScript "sync-flatpaks" ''
set -euo pipefail
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 " " (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
{
options.mySystem.system.flatpaks.enable = lib.mkEnableOption "Enable automatic Flatpak installation";
config = lib.mkIf (config.mySystem.system.flatpaks.enable or false) {
services.flatpak.enable = true;
xdg.portal.enable = true;
# Deploy de conf voor runtime/debug
environment.etc."flatpak/flatpaks.conf".source = lib.mkForce flatpakConfPath;
# Systemd service voor automatische installatie
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,53 @@
{ lib, ... }:
let
# --- Path naar je packages.conf, relatief aan dit bestand ---
packagesConfPath = ./assets/system/apps/packages.conf;
# --- Lees en split ---
raw = builtins.readFile packagesConfPath;
rawLines = lib.splitString "\n" raw;
_guard = assert !(builtins.stringLength raw > 1 &&
builtins.length rawLines == builtins.stringLength raw); true;
cleanLine = line:
let
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
noComment = lib.head (lib.splitString "#" noCR);
in
lib.strings.trim noComment;
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
in
{
# --- Flake NixOS module export ---
flake.nixosModules.packages = { config, pkgs, lib, ... }:
let
# Resolve packages via pkgs
resolvePkg = name:
let
parts = lib.splitString "." name;
found = lib.attrByPath parts null pkgs;
in
if found == null then
throw ''
packages.nix: package not found in pkgs
Token : ${builtins.toJSON name}
packages.conf : ${toString packagesConfPath}
''
else
found;
packages = builtins.seq _guard (map resolvePkg entries);
in
{
options.mySystem.system.packages.enable = lib.mkEnableOption "Enable packages from packages.conf";
config = lib.mkIf (config.mySystem.system.packages.enable or false) {
environment.systemPackages = packages;
};
};
}
@@ -0,0 +1,33 @@
{
config,
pkgs,
lib,
...
}:
let
username = "henrov"; # vervang door je echte gebruikersnaam
in
{
home-manager.users.${username} = {
# Thunar and plugins
home.packages = with pkgs; [
thunar
thunar-volman
thunar-archive-plugin
thunar-media-tags-plugin
tumbler
ffmpegthumbnailer
gvfs
xdg-utils
];
# Default file manager
xdg.mimeApps = {
defaultApplications = {
"inode/directory" = "Thunar.desktop";
};
};
};
}
+19
View File
@@ -0,0 +1,19 @@
{ lib, config, flakeRoot, ... }:
let
wofiAssets = "${flakeRoot}/assets/system/conf/wofi";
wofiFiles = builtins.readDir wofiAssets;
wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: {
src = "${wofiAssets}/${name}";
});
in
{
mySystem = {
apps.wofi = {
enable = true;
# symbolic references to files
configFile = wofiConfs."wofi.conf".src;
styleFile = wofiConfs."theming.css".src;
};
};
}
@@ -0,0 +1,12 @@
# ./modules/apps/zen-browser.nix
{ lib, config, ... }:
{
mySystem = {
apps.zenBrowser = {
enable = true;
# just store symbolic info, no direct pkgs reference
packageRef = "zen-browser";
};
};
}
@@ -0,0 +1,35 @@
{ lib, config, pkgs, flakeRoot, user, ... }:
let
ewwConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/eww";
# Dynamically read all files in assets/system/conf/eww/
ewwConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/system/conf/eww")) (name: {
text = builtins.readFile "${flakeRoot}/assets/system/conf/eww/${name}";
});
in
{
mySystem = {
apps.wallpaper = {
enable = true;
packages = [ "eww" ]; # just symbolic names
};
};
home-manager.users.${user.username} = {
home.file = {
"${ewwConfigDir}" = {
source = "${flakeRoot}/assets/system/conf/eww";
recursive = true;
};
};
home.sessionVariables = {
EWW_BIN = "${pkgs.eww}/bin/eww";
};
# Start eww with Hyprland/MangoWC
wayland.windowManager.hyprland.settings = lib.mkForce {
exec-once = [ "eww daemon" ];
exec = [ "eww open-many ${ewwConfigDir}/widgets" ]; # Adjust as needed
};
};
}
@@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
fonts.packages = with pkgs; [
pkgs.nerd-fonts.iosevka
];
}
@@ -0,0 +1,43 @@
{
config,
pkgs,
lib,
user,
flakeRoot,
...
}:
let
hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr");
# Filter out hyprland.conf from the list of files to symlink
otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles;
# Generate xdg.configFile entries for all files except hyprland.conf
otherConfigs = lib.genAttrs otherHyprlandFiles (name: {
target = "hypr/${name}";
source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
});
in
{
programs.hyprland = {
enable = true;
};
home-manager.users.${user.username} = {
home.stateVersion = "25.11";
home.username = user.username;
home.homeDirectory =
config.home-manager.users.${user.username}.homeDirectory or "/home/${user.username}";
wayland.windowManager.hyprland = {
enable = true;
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
xdg.configFile = otherConfigs // {
"hypr/hyprland.conf".text = ''
${builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/hyprland.conf"}
'';
"hypr/.keep".text = "";
};
};
}
@@ -0,0 +1,25 @@
{ config, pkgs, lib, flakeRoot, ... }:
let
# Pad naar de wallpaper config in de flake
wallpaperConf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.toml";
in
{
# Installeer wpaperd voor de gebruiker
home.packages = [ pkgs.wpaperd ];
# Plaats wallpaper.toml automatisch in $HOME/.config/wpaperd
home.file.".config/wpaperd/wallpaper.toml".source = wallpaperConf;
# Systemd user service
systemd.user.services.wpaperd = {
description = "wpaperd wallpaper daemon";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.wpaperd}/bin/wpaperd --config ${config.home.homeDirectory}/.config/wpaperd/wallpaper.toml";
Restart = "on-failure";
RestartSec = 1;
};
};
}
@@ -0,0 +1,59 @@
{ flakeRoot, config, lib, pkgs, ... }:
let
cfg = config.mySystem.desktop.stylix;
in {
options.mySystem.desktop.stylix.enable =
lib.mkEnableOption "Stylix System Theming";
config = lib.mkIf cfg.enable {
mySystem = {
apps.wallpaper = {
enable = true;
packages = [ "feh" "st" ]; # just symbolic names
};
};
stylix = {
enable = true;
base16Scheme = "${flakeRoot}/assets/system/theming/stylix/catppuccin-mocha.yaml";
image = "${flakeRoot}/assets/hyprland/wallpaperstuff/pictures/wall1.jpg";
polarity = "dark";
cursor = {
package = pkgs.phinger-cursors;
name = "phinger-cursors-light";
size = 24;
};
fonts = {
monospace = {
package = pkgs.nerd-fonts.fira-code;
name = "Fira Code Nerd Font";
};
sansSerif = {
package = pkgs.lato;
name = "Lato";
};
};
icons = {
enable = true;
package = pkgs.papirus-icon-theme;
dark = "Papirus-Dark";
light = "Papirus-Light";
};
};
home-manager.users.henrov.home.sessionVariables = {
XCURSOR_THEME = config.stylix.cursor.name;
XCURSOR_SIZE = toString config.stylix.cursor.size;
HYPRCURSOR_THEME = config.stylix.cursor.name;
HYPRCURSOR_SIZE = toString config.stylix.cursor.size;
};
};
}
@@ -0,0 +1,33 @@
{ lib, pkgs, config, flakeRoot, ... }:
let
username = "henrov";
waybar-config = pkgs.writeText "waybar-config" (builtins.readFile (flakeRoot + "/assets/system/conf/waybar/config"));
waybar-style = pkgs.writeText "waybar-style" (builtins.readFile (flakeRoot + "/assets/system/conf/waybar/style.css"));
in
{
programs.waybar = {
enable = true;
package = pkgs.waybar;
};
systemd.user.services.waybar = {
description = "Waybar (status bar for Wayland)";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${config.programs.waybar.package}/bin/waybar -c ${waybar-config} -s ${waybar-style}";
Restart = "on-failure";
RestartSec = "5s";
};
};
# Create symlinks for config and style
system.activationScripts.waybarSetup = lib.mkAfter ''
mkdir -p /home/${username}/.config/waybar
ln -sf ${waybar-config} /home/${username}/.config/waybar/config
ln -sf ${waybar-style} /home/${username}/.config/waybar/style.css
chown -R ${username}:users /home/${username}/.config/waybar
'';
}
@@ -0,0 +1,16 @@
{ config, pkgs, lib, user, ... }:
{
home-manager.users.${user.username} = {
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ];
config.hyprland = {
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
};
};
home.packages = with pkgs; [
uwsm
];
};
}
@@ -0,0 +1,12 @@
{ config, pkgs, lib, user, flakeRoot, ... }:
let
kittyConf = "${flakeRoot}/assets/system/conf/kitty/kitty.conf";
kittyTheme = "${flakeRoot}/assets/system/conf/kitty/Catppuccin-Mocha.conf";
in
{
home-manager.users.${user.username} = {
programs.kitty.enable = true;
xdg.configFile."kitty/kitty.conf".source = kittyConf;
xdg.configFile."kitty/Catppuccin-Mocha.conf".source = kittyTheme;
};
}
@@ -0,0 +1,16 @@
{
lib,
config,
pkgs,
flakeRoot,
...
}:
let
starshipConfig = lib.importTOML (flakeRoot + "/assets/system/conf/starship.toml");
in
{
programs.starship = {
enable = true;
settings = starshipConfig;
};
}
@@ -0,0 +1,69 @@
{ lib, config, ... }:
{
# Dendritic flake configuration for Zsh
mySystem = {
terminals.zsh = {
enable = true;
enableCompletion = true;
# Oh-My-Zsh configuration
ohMyZsh = {
enable = true;
plugins = [
"git"
"docker"
"direnv"
"zsh-autosuggestions"
"zsh-syntax-highlighting"
"zsh-completions"
"zsh-history-substring-search"
];
theme = "catppuccin-mocha"; # fallback / reference
};
# Optional initContent for advanced theming / plugin sourcing
initContent = ''
# Example prompt colors for Catppuccin Mocha
local mocha_base="#1E1E2E"
local mocha_surface0="#313244"
local mocha_text="#CDD6F4"
local mocha_lavender="#B4BEFE"
local mocha_blue="#89B4FA"
local mocha_sapphire="#74C7EC"
local mocha_teal="#94E2D5"
local mocha_green="#A6E3A1"
local mocha_yellow="#F9E2AF"
local mocha_peach="#FAB387"
local mocha_maroon="#EBA0AC"
local mocha_red="#F38BA8"
local mocha_mauve="#CBA6F7"
local mocha_pink="#F5C2E7"
local mocha_flamingo="#F2CDCD"
local mocha_rosewater="#F5E0DC"
# Prompt
PROMPT='%{$fg[$mocha_blue]%}%n%{$reset_color%}@%{$fg[$mocha_peach]%}%m%{$reset_color%} %{$fg[$mocha_lavender]%}%~%{$reset_color%} %{$fg[$mocha_red]%}$%{$reset_color%} '
RPROMPT='%{$fg[$mocha_green]%}%T%{$reset_color%}'
# Git prompt
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[$mocha_yellow]%}(%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[$mocha_yellow]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[$mocha_red]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[$mocha_green]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[$mocha_blue]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[$mocha_blue]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[$mocha_pink]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[$mocha_sapphire]%}+%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg[$mocha_red]%}!%{$reset_color%}"
# Virtualenv/pyenv
ZSH_THEME_VIRTUAL_ENV_PREFIX="(%{$fg[$mocha_teal]%}"
ZSH_THEME_VIRTUAL_ENV_SUFFIX="%{$reset_color%})"
# Set custom theme
ZSH_THEME="catppuccin-mocha"
'';
};
};
}