From e1fcd15e71fccf951e81fa16ddd83efb34bc5605 Mon Sep 17 00:00:00 2001 From: sid Date: Sun, 26 Apr 2026 12:26:54 +0200 Subject: [PATCH 1/5] rebuild: add nom and dix. disable dirty git tree warning --- apps/rebuild/default.nix | 4 ++++ apps/rebuild/rebuild.sh | 40 ++++++++++++++++++++++++----------- modules/shared/common/nix.nix | 2 ++ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/apps/rebuild/default.nix b/apps/rebuild/default.nix index 21242c7..72503a3 100644 --- a/apps/rebuild/default.nix +++ b/apps/rebuild/default.nix @@ -7,6 +7,8 @@ hostname, nix, nixos-rebuild-ng, + nix-output-monitor, + dix, ... }: @@ -26,5 +28,7 @@ writeShellApplication { hostname nix nixos-rebuild-ng + nix-output-monitor + dix ]; } diff --git a/apps/rebuild/rebuild.sh b/apps/rebuild/rebuild.sh index 752b9b7..ffe4a36 100755 --- a/apps/rebuild/rebuild.sh +++ b/apps/rebuild/rebuild.sh @@ -60,15 +60,24 @@ Rebuild_nixos() { fi [ -n "$TARGET_HOST" ] && CMD+=("--target-host" "$TARGET_HOST") - # Rebuild NixOS configuration - if [ "$ROLLBACK" = 0 ]; then - echo "Rebuilding NixOS configuration '$FLAKE'..." + # Build config first so we can diff it + local BUILD_CMD=("nixos-rebuild" "build" "--flake" "$FLAKE") + [ "$SHOW_TRACE" = 1 ] && BUILD_CMD+=("--show-trace") + [ -n "$BUILD_HOST" ] && BUILD_CMD+=("--build-host" "$BUILD_HOST") + if [ "$ROLLBACK" = 0 ]; then + echo "Building NixOS configuration '$FLAKE'..." + echo "Executing command: ${BUILD_CMD[*]}" + "${BUILD_CMD[@]}" |&nom || error "NixOS build failed" + echo "Package diff:" + dix /run/current-system result + rm result else echo "Rolling back to last NixOS generation..." fi - + echo "Switching to new NixOS configuration" + sudo -v echo "Executing command: ${CMD[*]}" - "${CMD[@]}" || error "NixOS rebuild failed" + "${CMD[@]}" |& nom || error "NixOS rebuild failed" echo "NixOS rebuild completed successfully." } @@ -91,15 +100,22 @@ Rebuild_home() { [ "$SHOW_TRACE" = 1 ] && CMD+=("--show-trace") fi - # Rebuild Home Manager configuration - if [ "$ROLLBACK" = 0 ]; then - echo "Rebuilding Home Manager configuration '$FLAKE'..." + # Build config first so we can diff it + if [ "$ROLLBACK" = 0 ]; then + local BUILD_CMD=("home-manager" "build" "--flake" "$FLAKE") + [ "$SHOW_TRACE" = 1 ] && BUILD_CMD+=("--show-trace") + echo "Building Home Manager configuration '$FLAKE'..." + echo "Executing command: ${BUILD_CMD[*]}" + "${BUILD_CMD[@]}" |& nom || error "Home Manager build failed" + echo "Package diff:" + dix /run/current-system result + rm result else echo "Rolling back to last Home Manager generation..." fi - + echo "Switching to new Home Manager configuration" echo "Executing command: ${CMD[*]}" - "${CMD[@]}" || error "Home Manager rebuild failed" + "${CMD[@]}" |& nom || error "Home Manager rebuild failed" echo "Home Manager rebuild completed successfully." } @@ -227,10 +243,10 @@ fi [ "$UPDATE" = 1 ] && Update case "$COMMAND" in - nixos) + nixos|os) Rebuild_nixos ;; - home) + home|hm) Rebuild_home ;; all) diff --git a/modules/shared/common/nix.nix b/modules/shared/common/nix.nix index 2d0daa3..4d8e217 100644 --- a/modules/shared/common/nix.nix +++ b/modules/shared/common/nix.nix @@ -32,6 +32,8 @@ in }; }; + nix.settings.warn-dirty = mkDefault false; + # fallback quickly if substituters are not available. nix.settings.connect-timeout = mkDefault 5; nix.settings.fallback = true; -- 2.51.2 From 60ddff80fc4c07e3ead1bc6d622d25f2463b36b3 Mon Sep 17 00:00:00 2001 From: sid Date: Sun, 26 Apr 2026 12:29:55 +0200 Subject: [PATCH 2/5] rebuild: add colored output --- apps/rebuild/rebuild.sh | 64 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/apps/rebuild/rebuild.sh b/apps/rebuild/rebuild.sh index ffe4a36..cb78314 100755 --- a/apps/rebuild/rebuild.sh +++ b/apps/rebuild/rebuild.sh @@ -11,6 +11,11 @@ UPDATE_INPUTS="" # Default list of inputs to update. Empty means ROLLBACK=0 # Default to not rollback SHOW_TRACE=0 # Default to not show detailed error messages +# Output functions +_status() { echo -e "\033[0;34m> $1\033[0m"; } +success() { echo -e "\033[0;32m$1\033[0m"; } +error() { echo -e "\033[0;31mError: $1\033[0m" >&2; exit 1; } + # Function to display the help message Help() { echo "Wrapper script for 'nixos-rebuild switch' and 'home-manager switch' commands." @@ -37,12 +42,6 @@ Help() { echo " -u, --user Specify the username (as in 'homeConfigurations.@'). Default: $HOME_USER" } -# Function to handle errors -error() { - echo "Error: $1" - exit 1 -} - # Function to rebuild NixOS configuration Rebuild_nixos() { local FLAKE="$FLAKE_PATH#$NIXOS_HOST" @@ -56,7 +55,7 @@ Rebuild_nixos() { [ -n "$BUILD_HOST" ] && CMD+=("--build-host" "$BUILD_HOST") if [ "$NIXOS_HOST" != "$(hostname)" ] && [ -z "$TARGET_HOST" ]; then TARGET_HOST="$NIXOS_HOST" - echo "Using '$TARGET_HOST' as target host." + _status "Using '$TARGET_HOST' as target host." fi [ -n "$TARGET_HOST" ] && CMD+=("--target-host" "$TARGET_HOST") @@ -64,21 +63,23 @@ Rebuild_nixos() { local BUILD_CMD=("nixos-rebuild" "build" "--flake" "$FLAKE") [ "$SHOW_TRACE" = 1 ] && BUILD_CMD+=("--show-trace") [ -n "$BUILD_HOST" ] && BUILD_CMD+=("--build-host" "$BUILD_HOST") + if [ "$ROLLBACK" = 0 ]; then - echo "Building NixOS configuration '$FLAKE'..." - echo "Executing command: ${BUILD_CMD[*]}" + _status "Building NixOS configuration '$FLAKE'..." + _status "Executing command: ${BUILD_CMD[*]}" "${BUILD_CMD[@]}" |&nom || error "NixOS build failed" - echo "Package diff:" + _status "Package diff:" dix /run/current-system result rm result else - echo "Rolling back to last NixOS generation..." + _status "Rolling back to last NixOS generation..." fi - echo "Switching to new NixOS configuration" + + _status "Switching to new NixOS configuration" sudo -v - echo "Executing command: ${CMD[*]}" + _status "Executing command: ${CMD[*]}" "${CMD[@]}" |& nom || error "NixOS rebuild failed" - echo "NixOS rebuild completed successfully." + success "NixOS rebuild completed successfully." } # Function to rebuild Home Manager configuration @@ -104,24 +105,25 @@ Rebuild_home() { if [ "$ROLLBACK" = 0 ]; then local BUILD_CMD=("home-manager" "build" "--flake" "$FLAKE") [ "$SHOW_TRACE" = 1 ] && BUILD_CMD+=("--show-trace") - echo "Building Home Manager configuration '$FLAKE'..." - echo "Executing command: ${BUILD_CMD[*]}" + _status "Building Home Manager configuration '$FLAKE'..." + _status "Executing command: ${BUILD_CMD[*]}" "${BUILD_CMD[@]}" |& nom || error "Home Manager build failed" - echo "Package diff:" + _status "Package diff:" dix /run/current-system result rm result else - echo "Rolling back to last Home Manager generation..." + _status "Rolling back to last Home Manager generation..." fi - echo "Switching to new Home Manager configuration" - echo "Executing command: ${CMD[*]}" + + _status "Switching to new Home Manager configuration" + _status "Executing command: ${CMD[*]}" "${CMD[@]}" |& nom || error "Home Manager rebuild failed" - echo "Home Manager rebuild completed successfully." + success "Home Manager rebuild completed successfully." } -# Function to Update flake repositories +# Function to update flake repositories Update() { - echo "Updating flake inputs..." + _status "Updating flake inputs..." # Construct update command as an array local CMD=("nix" "flake" "update" "--flake" "$FLAKE_PATH") @@ -133,17 +135,18 @@ Update() { done fi - echo "Executing command: ${CMD[*]}" + _status "Executing command: ${CMD[*]}" "${CMD[@]}" || error "Failed to update flake repositories" - echo "Flake repositories updated successfully." + success "Flake repositories updated successfully." } # Parse command-line options if [[ -z "${1:-}" ]]; then - echo "Error: No command specified. Printing help page." + echo -e "\033[0;31mError: No command specified. Printing help page.\033[0m" >&2 Help exit 1 fi + COMMAND=$1 shift @@ -214,9 +217,7 @@ while [ $# -gt 0 ]; do fi ;; *) - echo "Error: Unknown option '$1'" - Help - exit 1 + error "Unknown option '$1'" ;; esac done @@ -254,9 +255,6 @@ case "$COMMAND" in Rebuild_home ;; *) - echo "Error: Unknown command '$COMMAND'" - echo "Printing help page:" - Help - exit 1 + error "Unknown command '$COMMAND'" ;; esac -- 2.51.2 From 91459095f0a593c4988ce36418acc1cfdc9eff63 Mon Sep 17 00:00:00 2001 From: sid Date: Sat, 2 May 2026 20:23:18 +0200 Subject: [PATCH 3/5] nixvim telescope: also search hidden files --- modules/home/nixvim/plugins/telescope.nix | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/home/nixvim/plugins/telescope.nix b/modules/home/nixvim/plugins/telescope.nix index 6e1dabc..e1ba4b6 100644 --- a/modules/home/nixvim/plugins/telescope.nix +++ b/modules/home/nixvim/plugins/telescope.nix @@ -16,6 +16,31 @@ in programs.nixvim = { plugins.telescope = { enable = mkDefault true; + settings = { + defaults = { + vimgrep_arguments = [ + "rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + "--hidden" + ]; + file_ignore_patterns = [ + "^.git/" + "^.direnv/" + "^.cache/" + "^node_modules/" + ]; + }; + pickers = { + find_files = { + hidden = true; + }; + }; + }; extensions = { file-browser.enable = mkDefault true; fzf-native.enable = mkDefault true; -- 2.51.2 From d74ed03e233274458ac14ad0bc6555831b6cd2d4 Mon Sep 17 00:00:00 2001 From: sid Date: Sat, 2 May 2026 20:33:13 +0200 Subject: [PATCH 4/5] nixvim: fix spellfiles --- modules/home/nixvim/spellfiles.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/home/nixvim/spellfiles.nix b/modules/home/nixvim/spellfiles.nix index 35b4a6e..c6e82ef 100644 --- a/modules/home/nixvim/spellfiles.nix +++ b/modules/home/nixvim/spellfiles.nix @@ -2,7 +2,7 @@ let spellDir = config.xdg.dataHome + "/nvim/site/spell"; - baseUrl = "http://ftp.de.vim.org/runtime/spell"; + baseUrl = "https://vim.ftp.fu-berlin.de/runtime/spell/"; in { home.file = { @@ -12,7 +12,7 @@ in url = baseUrl + "/de.utf-8.spl"; sha256 = "sha256-c8cQfqM5hWzb6SHeuSpFk5xN5uucByYdobndGfaDo9E="; }; - target = spellDir + "/de.utf8.spl"; + target = spellDir + "/de.utf-8.spl"; }; de-sug = { enable = true; @@ -20,7 +20,7 @@ in url = baseUrl + "/de.utf-8.sug"; sha256 = "sha256-E9Ds+Shj2J72DNSopesqWhOg6Pm6jRxqvkerqFcUqUg="; }; - target = spellDir + "/de.utf8.sug"; + target = spellDir + "/de.utf-8.sug"; }; }; } -- 2.51.2 From 6be5dddb09cedd09b7ed1ec1875aa8bd9ada084a Mon Sep 17 00:00:00 2001 From: sid Date: Sat, 2 May 2026 20:42:00 +0200 Subject: [PATCH 5/5] add package for jirafeau --- pkgs/default.nix | 1 + pkgs/jirafeau/default.nix | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/jirafeau/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 2d87a7a..7c2b2e2 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -11,6 +11,7 @@ cppman = pkgs.callPackage ./cppman { }; fetcher-mcp = pkgs.callPackage ./fetcher-mcp { }; freecad-mcp = pkgs.callPackage ./freecad-mcp { }; + jirafeau = pkgs.callPackage ./jirafeau { }; kicad-mcp = pkgs.callPackage ./kicad-mcp { }; mcpo = pkgs.callPackage ./mcpo { }; pass2bw = pkgs.callPackage ./pass2bw { }; diff --git a/pkgs/jirafeau/default.nix b/pkgs/jirafeau/default.nix new file mode 100644 index 0000000..2826db7 --- /dev/null +++ b/pkgs/jirafeau/default.nix @@ -0,0 +1,43 @@ +{ + lib, + stdenv, + fetchFromGitLab, + writeText, + nixosTests, +}: + +let + localConfig = writeText "config.local.php" '' + + ''; +in +stdenv.mkDerivation rec { + pname = "jirafeau"; + version = "4.7.1"; + + src = fetchFromGitLab { + owner = "jirafeau"; + repo = "Jirafeau"; + rev = version; + hash = "sha256-jXUO+tj6VFNjJkT0vkCCtG7yNWf3QeCx7izZPekAng8="; + }; + + installPhase = '' + mkdir $out + cp -r * $out/ + cp ${localConfig} $out/lib/config.local.php + ''; + + passthru.tests = { inherit (nixosTests) jirafeau; }; + + meta = { + description = "Jirafeau: a simple way to upload a file"; + homepage = "https://gitlab.com/jirafeau/Jirafeau"; + changelog = "https://gitlab.com/jirafeau/Jirafeau/-/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.agpl3Plus; + mainProgram = "jirafeau"; + platforms = lib.platforms.all; + }; +} -- 2.51.2