diff --git a/flake.nix b/flake.nix
index 7c28b262c..a98c367d5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,7 +8,7 @@
       pkgs = import nixpkgs { system = "x86_64-linux"; };
     in rec {
       packages.x86_64-linux = rec {
-        llvm-nac3 = pkgs.callPackage "${self}/llvm" {};
+        llvm-nac3 = pkgs.callPackage ./nix/llvm {};
         nac3artiq = pkgs.python3Packages.toPythonModule (
           pkgs.rustPlatform.buildRustPackage {
             name = "nac3artiq";
@@ -48,7 +48,7 @@
         };
 
         # LLVM PGO support
-        llvm-nac3-instrumented = pkgs.callPackage "${self}/llvm" {
+        llvm-nac3-instrumented = pkgs.callPackage ./nix/llvm {
           stdenv = pkgs.llvmPackages_13.stdenv;
           extraCmakeFlags = [ "-DLLVM_BUILD_INSTRUMENTED=IR" ];
         };
@@ -86,7 +86,7 @@
             llvm-profdata merge -o $out/llvm.profdata /build/llvm/build/profiles/*
             '';
         };
-        llvm-nac3-pgo = pkgs.callPackage "${self}/llvm" {
+        llvm-nac3-pgo = pkgs.callPackage ./nix/llvm {
           stdenv = pkgs.llvmPackages_13.stdenv;
           extraCmakeFlags = [ "-DLLVM_PROFDATA_FILE=${nac3artiq-profile}/llvm.profdata" ];
         };
@@ -109,7 +109,7 @@
         );
       };
 
-      packages.x86_64-w64-mingw32 = import ./windows { inherit pkgs; };
+      packages.x86_64-w64-mingw32 = import ./nix/windows { inherit pkgs; };
 
       devShell.x86_64-linux = pkgs.mkShell {
         name = "nac3-dev-shell";
diff --git a/llvm/TLI-musl.patch b/nix/llvm/TLI-musl.patch
similarity index 100%
rename from llvm/TLI-musl.patch
rename to nix/llvm/TLI-musl.patch
diff --git a/llvm/default.nix b/nix/llvm/default.nix
similarity index 100%
rename from llvm/default.nix
rename to nix/llvm/default.nix
diff --git a/llvm/gnu-install-dirs.patch b/nix/llvm/gnu-install-dirs.patch
similarity index 100%
rename from llvm/gnu-install-dirs.patch
rename to nix/llvm/gnu-install-dirs.patch
diff --git a/llvm/llvm-future-riscv-abi.diff b/nix/llvm/llvm-future-riscv-abi.diff
similarity index 100%
rename from llvm/llvm-future-riscv-abi.diff
rename to nix/llvm/llvm-future-riscv-abi.diff
diff --git a/llvm/outputs.patch b/nix/llvm/outputs.patch
similarity index 100%
rename from llvm/outputs.patch
rename to nix/llvm/outputs.patch
diff --git a/windows/default.nix b/nix/windows/default.nix
similarity index 100%
rename from windows/default.nix
rename to nix/windows/default.nix
diff --git a/windows/make_msys2_packages.sh b/nix/windows/make_msys2_packages.sh
similarity index 100%
rename from windows/make_msys2_packages.sh
rename to nix/windows/make_msys2_packages.sh
diff --git a/windows/msys2_packages.nix b/nix/windows/msys2_packages.nix
similarity index 100%
rename from windows/msys2_packages.nix
rename to nix/windows/msys2_packages.nix