tests.importCargoLock: fix self-inclusive src listings in .nix files

Replace `src = ./.` instances with more explicit source listings.
Otherwise, derivations will be rebuilt on any change to the files
defining them (e.g. formatting via nixfmt-rfc-style).

+95 -23
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/basic-dynamic/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "basic-dynamic"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock.lockFileContents = builtins.readFile ./Cargo.lock; 10 19
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/basic/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "basic"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock = { 10 19 lockFile = ./Cargo.lock;
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "git-dependency-branch"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock = { 10 19 lockFile = ./Cargo.lock;
+11 -2
pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev-non-workspace-nested-crate/default.nix
··· 1 1 { rustPlatform, pkg-config, openssl, lib, darwin, stdenv }: 2 - 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "git-dependency-rev-non-workspace-nested-crate"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 nativeBuildInputs = [ 10 19 pkg-config
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "git-dependency-rev"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock = { 10 19 lockFile = ./Cargo.lock;
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "git-dependency-tag"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock = { 10 19 lockFile = ./Cargo.lock;
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/git-dependency/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "git-dependency"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock = { 10 19 lockFile = ./Cargo.lock;
+12 -3
pkgs/build-support/rust/test/import-cargo-lock/v1/default.nix
··· 1 - { rustPlatform }: 2 - 1 + { lib, rustPlatform }: 2 + let 3 + fs = lib.fileset; 4 + in 3 5 rustPlatform.buildRustPackage { 4 6 pname = "v1"; 5 7 version = "0.1.0"; 6 8 7 - src = ./.; 9 + src = fs.toSource { 10 + root = ./.; 11 + fileset = fs.unions [ 12 + ./Cargo.toml 13 + ./Cargo.lock 14 + ./src 15 + ]; 16 + }; 8 17 9 18 cargoLock = { 10 19 lockFile = ./Cargo.lock;