Skip to content

Commit

Permalink
fix(tests): channel patching
Browse files Browse the repository at this point in the history
  • Loading branch information
gytis-ivaskevicius committed Feb 3, 2025
1 parent 6b10f51 commit afcb15b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions devShell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ devshell.mkShell {
command = "nix build ${rootDir}/examples/darwin#darwinConfigurations.Hostname1.system --no-write-lock-file --dry-run";
}

#(test "channel-patching")
(test "channel-patching")
(test "derivation-outputs")
(test "hosts-config")
(test "overlays-flow")
(test "all" // { command = "check-derivation-outputs && check-hosts-config && check-overlays-flow"; })

(dry-nixos-build "minimal-multichannel" "Hostname1")
(dry-nixos-build "minimal-multichannel" "Hostname2")
#(dry-nixos-build "home-manager+nur+neovim" "Rick")
(dry-nixos-build "home-manager+nur+neovim" "Rick")
(dry-nixos-build "exporters" "Morty")
(withCategory "dry-build" { name = "build-all"; command = "build-exporters-Morty && build-minimal-multichannel-Hostname1 && build-minimal-multichannel-Hostname2"; })

Expand Down
33 changes: 15 additions & 18 deletions tests/channel-patching/myNixpkgsPatch.patch
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
diff --git a/lib/default.nix b/lib/default.nix
index 169f013191b8..05e91f1cd27b 100644
index f931524002f2..5299719bfd92 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -10,6 +10,7 @@ let
@@ -10,6 +10,8 @@ let
lib = makeExtensible (self: let
callLibs = file: import file { lib = self; };
in {
+ patchedFunction = x: x;
+

# often used, or depending on very little
trivial = callLibs ./trivial.nix;
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index ec6f410a48f6..3c6669988d2f 100644
index bd3b27c00b55..3cfde568a714 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -1505,4 +1505,10 @@
./virtualisation/xe-guest-utilities.nix
./virtualisation/xen-dom0.nix
{ documentation.nixos.extraModules = [ ./virtualisation/qemu-vm.nix ]; }
@@ -1818,4 +1818,10 @@
./image/repart.nix
];
}
+ ({ lib, config, ... }: {
+ options.patchedModule.test = lib.mkOption {
+ default = null;
+ example = "test";
+ };
+ })
]
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0c2a44d531df..299ff71619b6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -42286,4 +42286,6 @@ with pkgs;
ssl-proxy = callPackage ../tools/networking/ssl-proxy { };

code-maat = callPackage ../development/tools/code-maat {};
+
+ flake-utils-plus-test = callPackage ../tools/misc/coreutils { };
}
diff --git a/pkgs/by-name/fl/flake-utils-plus-test/package.nix b/pkgs/by-name/fl/flake-utils-plus-test/package.nix
new file mode 100644
index 000000000000..ad5323375baf
--- /dev/null
+++ b/pkgs/by-name/fl/flake-utils-plus-test/package.nix
@@ -0,0 +1 @@
+{ coreutils }: coreutils

0 comments on commit afcb15b

Please sign in to comment.