summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--host/initramfs/default.nix6
-rw-r--r--host/rootfs/default.nix5
-rw-r--r--host/start-vm/default.nix7
-rw-r--r--img/live/default.nix6
-rw-r--r--scripts/default.nix9
-rw-r--r--vm/app/catgirl/default.nix6
-rw-r--r--vm/app/lynx/default.nix6
-rw-r--r--vm/sys/net/default.nix6
8 files changed, 36 insertions, 15 deletions
diff --git a/host/initramfs/default.nix b/host/initramfs/default.nix
index 1ed54fd..439b0e6 100644
--- a/host/initramfs/default.nix
+++ b/host/initramfs/default.nix
@@ -12,7 +12,7 @@ pkgs.callPackage (
 }:
 
 let
-  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
+  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep hasSuffix;
 
   linux = rootfs.kernel;
 
@@ -88,7 +88,9 @@ stdenv.mkDerivation {
   name = "initramfs";
 
   src = cleanSourceWith {
-    filter = name: _type: name != "${toString ./.}/build";
+    filter = name: _type:
+      name != "${toString ./.}/build" &&
+      !(hasSuffix ".nix" name);
     src = cleanSource ./.;
   };
 
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index 7ac3d3a..d4c96d9 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -9,7 +9,7 @@
 }:
 
 let
-  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
+  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep hasSuffix;
 
   start-vm = import ../start-vm { pkgs = pkgs.pkgsStatic; };
 
@@ -83,7 +83,8 @@ stdenv.mkDerivation {
   name = "spectrum-rootfs";
 
   src = cleanSourceWith {
-    filter = name: _type: name != "${toString ./.}/build";
+    filter = name: _type:
+      name != "${toString ./.}/build" && !(hasSuffix ".nix" name);
     src = cleanSource ./.;
   };
 
diff --git a/host/start-vm/default.nix b/host/start-vm/default.nix
index ac31022..56be882 100644
--- a/host/start-vm/default.nix
+++ b/host/start-vm/default.nix
@@ -5,13 +5,16 @@
 { lib, stdenv, fetchpatch, meson, ninja, rustc }:
 
 let
-  inherit (lib) cleanSource;
+  inherit (lib) cleanSource cleanSourceWith hasSuffix;
 in
 
 stdenv.mkDerivation {
   name = "start-vm";
 
-  src = cleanSource ./.;
+  src = cleanSourceWith {
+    filter = name: _type: !(hasSuffix ".nix" name);
+    src = cleanSource ./.;
+  };
 
   nativeBuildInputs = [ meson ninja rustc ];
 
diff --git a/img/live/default.nix b/img/live/default.nix
index bebc1c1..770b03b 100644
--- a/img/live/default.nix
+++ b/img/live/default.nix
@@ -4,7 +4,7 @@
 { pkgs ? import <nixpkgs> {} }:
 
 let
-  inherit (pkgs.lib) cleanSource cleanSourceWith;
+  inherit (pkgs.lib) cleanSource cleanSourceWith hasSuffix;
 
   extfs = pkgs.pkgsStatic.callPackage ../../host/initramfs/extfs.nix {
     inherit pkgs;
@@ -20,7 +20,9 @@ stdenv.mkDerivation {
   name = "spectrum-live.img";
 
   src = cleanSourceWith {
-    filter = name: _type: name != "${toString ./.}/build";
+    filter = name: _type:
+      name != "${toString ./.}/build" &&
+      !(hasSuffix ".nix" name);
     src = cleanSource ./.;
   };
 
diff --git a/scripts/default.nix b/scripts/default.nix
index 4b9c31b..7995723 100644
--- a/scripts/default.nix
+++ b/scripts/default.nix
@@ -3,4 +3,11 @@
 
 { pkgs ? import <nixpkgs> {} }:
 
-pkgs.lib.cleanSource ./.
+let
+  inherit (pkgs.lib) cleanSource cleanSourceWith hasSuffix;
+in
+
+cleanSourceWith {
+  src = cleanSource ./.;
+  filter = name: _type: !(hasSuffix ".nix" name);
+}
diff --git a/vm/app/catgirl/default.nix b/vm/app/catgirl/default.nix
index 4e700f8..2b27710 100644
--- a/vm/app/catgirl/default.nix
+++ b/vm/app/catgirl/default.nix
@@ -13,7 +13,7 @@ pkgs.pkgsStatic.callPackage (
 }:
 
 let
-  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
+  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep hasSuffix;
 
   packages = [
     catgirl execline kmod mdevd s6 s6-linux-init s6-rc
@@ -65,7 +65,9 @@ stdenv.mkDerivation {
   name = "spectrum-appvm-catgirl";
 
   src = cleanSourceWith {
-    filter = name: _type: name != "${toString ./.}/build";
+    filter = name: _type:
+      name != "${toString ./.}/build" &&
+      !(hasSuffix ".nix" name);
     src = cleanSource ./.;
   };
 
diff --git a/vm/app/lynx/default.nix b/vm/app/lynx/default.nix
index 0d8a629..098146b 100644
--- a/vm/app/lynx/default.nix
+++ b/vm/app/lynx/default.nix
@@ -13,7 +13,7 @@ pkgs.pkgsStatic.callPackage (
 }:
 
 let
-  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
+  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep hasSuffix;
 
   packages = [
     execline kmod lynx mdevd s6 s6-linux-init s6-rc
@@ -65,7 +65,9 @@ stdenv.mkDerivation {
   name = "spectrum-appvm-lynx";
 
   src = cleanSourceWith {
-    filter = name: _type: name != "${toString ./.}/build";
+    filter = name: _type:
+      name != "${toString ./.}/build" &&
+      !(hasSuffix ".nix" name);
     src = cleanSource ./.;
   };
 
diff --git a/vm/sys/net/default.nix b/vm/sys/net/default.nix
index f145a2c..6f4e24d 100644
--- a/vm/sys/net/default.nix
+++ b/vm/sys/net/default.nix
@@ -14,7 +14,7 @@ pkgs.pkgsStatic.callPackage (
 }:
 
 let
-  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
+  inherit (lib) cleanSource cleanSourceWith concatMapStringsSep hasSuffix;
 
   connman = connmanMinimal;
 
@@ -74,7 +74,9 @@ stdenv.mkDerivation {
   name = "spectrum-netvm";
 
   src = cleanSourceWith {
-    filter = name: _type: name != "${toString ./.}/build";
+    filter = name: _type:
+      name != "${toString ./.}/build" &&
+      !(hasSuffix ".nix" name);
     src = cleanSource ./.;
   };