My NixOS config Part 3: Flake-Parts Crusaders nix.ladas552.me
hjem nix nixos impermanence flake-parts nvfetcher niri noctalia

import-tree for recursivelyImport

Ladas552 ca47c5b0 da52cb20

+38 -17
+4 -4
_sources/generated.json
··· 181 181 }, 182 182 "noctalia-dev": { 183 183 "cargoLock": null, 184 - "date": "2026-02-18", 184 + "date": "2026-02-19", 185 185 "extract": null, 186 186 "name": "noctalia-dev", 187 187 "passthru": null, ··· 191 191 "fetchSubmodules": false, 192 192 "leaveDotGit": false, 193 193 "name": null, 194 - "rev": "abfcbd3a547e2115c81364938335ff739c641e0e", 195 - "sha256": "sha256-uQ0iPqH8sLBZIeRsvri91E7mTsuYjS4ct6/jU0TPXOA=", 194 + "rev": "3c3a8a2823496d42730095970c9ebccdde2899da", 195 + "sha256": "sha256-DB6CCfGg+UAro5tZEP/VMgWL5ZdBCUfPOBf3Ox0Vu24=", 196 196 "sparseCheckout": [], 197 197 "type": "git", 198 198 "url": "https://github.com/noctalia-dev/noctalia-shell" 199 199 }, 200 - "version": "abfcbd3a547e2115c81364938335ff739c641e0e" 200 + "version": "3c3a8a2823496d42730095970c9ebccdde2899da" 201 201 }, 202 202 "sops-nix": { 203 203 "cargoLock": null,
+4 -4
_sources/generated.nix
··· 118 118 }; 119 119 noctalia-dev = { 120 120 pname = "noctalia-dev"; 121 - version = "abfcbd3a547e2115c81364938335ff739c641e0e"; 121 + version = "3c3a8a2823496d42730095970c9ebccdde2899da"; 122 122 src = fetchgit { 123 123 url = "https://github.com/noctalia-dev/noctalia-shell"; 124 - rev = "abfcbd3a547e2115c81364938335ff739c641e0e"; 124 + rev = "3c3a8a2823496d42730095970c9ebccdde2899da"; 125 125 fetchSubmodules = false; 126 126 deepClone = false; 127 127 leaveDotGit = false; 128 128 sparseCheckout = [ ]; 129 - sha256 = "sha256-uQ0iPqH8sLBZIeRsvri91E7mTsuYjS4ct6/jU0TPXOA="; 129 + sha256 = "sha256-DB6CCfGg+UAro5tZEP/VMgWL5ZdBCUfPOBf3Ox0Vu24="; 130 130 }; 131 - date = "2026-02-18"; 131 + date = "2026-02-19"; 132 132 }; 133 133 sops-nix = { 134 134 pname = "sops-nix";
+3 -9
flake.nix
··· 142 142 inputs: 143 143 let 144 144 # Function to stop using `import-tree` by Vic. 145 - # Just to lighten the config a bit, written by https://codeberg.org/BANanaD3V 146 - # Adaptation stolen from @iynai 147 - inherit (inputs.nixpkgs.lib.fileset) toList fileFilter; 148 - import-tree = 149 - paths: 150 - toList ( 151 - fileFilter (file: file.hasExt "nix" && !(inputs.nixpkgs.lib.hasPrefix "_" file.name)) paths 152 - ); 145 + # Just to lighten the config a bit, written by @llakala https://github.com/llakala/synaptic-standard/blob/main/demo/recursivelyImport.nix 146 + import-tree = import ./stuff/recursivelyImport.nix { lib = inputs.nixpkgs.lib; }; 153 147 154 148 # a way to fetch nix files via nvfetcher and import them in the config 155 149 # basically parse the json crated by nvfetcher, and use fetchTarball ··· 174 168 specialArgs = { inherit modules; }; 175 169 } 176 170 { 177 - imports = import-tree ./modules; 171 + imports = import-tree [ ./modules ]; 178 172 flake.templates = import ./templates; 179 173 }; 180 174 }
install/impermanence.norg stuff/impermanence.norg
install/zfs.norg stuff/zfs.norg
+27
stuff/recursivelyImport.nix
··· 1 + { lib }: 2 + let 3 + inherit (lib) hasSuffix hasPrefix; 4 + inherit (builtins) 5 + concatMap 6 + isPath 7 + filter 8 + readFileType 9 + ; 10 + 11 + expandIfFolder = 12 + elem: 13 + if !isPath elem || readFileType elem != "directory" then 14 + [ elem ] 15 + else 16 + lib.filesystem.listFilesRecursive elem; 17 + in 18 + list: 19 + filter 20 + # Filter out any path that doesn't look like `*.nix`. Don't forget to use 21 + # toString to prevent copying paths to the store unnecessarily 22 + ( 23 + elem: 24 + !isPath elem || (hasSuffix ".nix" (toString elem) && !hasPrefix "_" (baseNameOf (toString elem))) 25 + ) 26 + # Expand any folder to all the files within it. 27 + (concatMap expandIfFolder list)