
Except: - Instances in documentation, because people in older versions can't switch to nixfmt yet due to it having pointed to nixfmt-classic before - In code that runs based on a CI Nixpkgs version, which is also a bit older still - In update script shebangs, because many of them don't pin Nixpkgs, and run with whatever is in NIX_PATH (and it's not easy to fix this, see https://github.com/NixOS/nixpkgs/issues/425551)
47 lines
727 B
Nix
47 lines
727 B
Nix
let
|
|
pkgs = import ../../../.. {
|
|
config = { };
|
|
overlays = [ ];
|
|
};
|
|
|
|
inherit (pkgs)
|
|
lib
|
|
stdenvNoCC
|
|
gitMinimal
|
|
treefmt
|
|
nixfmt
|
|
;
|
|
in
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
name = "test";
|
|
src = lib.fileset.toSource {
|
|
root = ./..;
|
|
fileset = lib.fileset.unions [
|
|
../run.sh
|
|
./run.sh
|
|
./first.diff
|
|
./second.diff
|
|
];
|
|
};
|
|
nativeBuildInputs = [
|
|
gitMinimal
|
|
treefmt
|
|
nixfmt
|
|
];
|
|
patchPhase = ''
|
|
patchShebangs .
|
|
'';
|
|
|
|
buildPhase = ''
|
|
export HOME=$(mktemp -d)
|
|
export PAGER=true
|
|
git config --global user.email "Your Name"
|
|
git config --global user.name "your.name@example.com"
|
|
./test/run.sh
|
|
'';
|
|
installPhase = ''
|
|
touch $out
|
|
'';
|
|
}
|