summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-05-16 14:42:10 +0000
committerAlyssa Ross <hi@alyssa.is>2022-05-16 16:13:10 +0000
commit541bdd67bf406e9d54e36401fb85b08f8c6abba9 (patch)
tree728ec2a0a8869d3babac75f6028f962aa7e9d09a
parenta9c192e00d17548f75e18465baf359813bc05e72 (diff)
downloadspectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.tar
spectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.tar.gz
spectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.tar.bz2
spectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.tar.lz
spectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.tar.xz
spectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.tar.zst
spectrum-541bdd67bf406e9d54e36401fb85b08f8c6abba9.zip
Remove Nix files in copyPathToStore
Nix files shouldn't be considered part of the sources, and so they
should be filtered out.  This way, changes to them (that don't change
their meaning) won't force rebuilds.
-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 ./.;
   };