]> Git — Sourcephile - julm/julm-nix.git/commitdiff
nix: cleaner fileset main
authorJulien Moutinho <julm+julm-nix@sourcephile.fr>
Fri, 26 Apr 2024 22:44:46 +0000 (00:44 +0200)
committerJulien Moutinho <julm+julm-nix@sourcephile.fr>
Fri, 26 Apr 2024 22:45:04 +0000 (00:45 +0200)
flake.nix

index 015fe129a42d11b3759387afc51a6b1e0dceceb4..48e4a422a5c8f38330f219f53d09e967029c7dbd 100644 (file)
--- a/flake.nix
+++ b/flake.nix
       self = with lib.fileset; toSource {
         root = ./.;
         fileset =
-          intersection
-            (unions [
-              ./home-manager
-              ./homes
-              ./hosts
-              ./nixos
-              ./nixpkgs
-              ./share
-              ./users
-              ./shell.nix
-            ])
-            (fileFilter
-              (file: lib.any file.hasExt [
-                "clear"
-                "conf"
-                "cred"
-                "crt"
-                "css"
-                "el"
-                "hs"
-                "json"
-                "nix"
-                "patch"
-                "pem"
-                "pub"
-                "sh"
-                "theme"
-                "vim"
-              ]) ./.);
+          let exts = [ "clear" "conf" "cred" "crt" "css" "el" "hs" "json" "nix" "patch" "pem" "pub" "sh" "theme" "vim" ]; in
+          unions [
+            (fileFilter (file: lib.any file.hasExt exts) ./home-manager)
+            (fileFilter (file: lib.any file.hasExt exts) ./homes)
+            (fileFilter (file: lib.any file.hasExt exts) ./hosts)
+            (fileFilter (file: lib.any file.hasExt exts) ./nixos)
+            (fileFilter (file: lib.any file.hasExt exts) ./nixpkgs)
+            (fileFilter (file: lib.any file.hasExt exts) ./share)
+            (fileFilter (file: lib.any file.hasExt exts) ./users)
+            ./shell.nix
+          ];
       };
     in
     rec {