Skip to content

Commit

Permalink
nix.checks.perl-switches: use fileset source and mkDerivation
Browse files Browse the repository at this point in the history
Rework perl-switches test to use `switchConfigurationSrc` so it does not
rebuild every time anything changes in the repository. Cannot use this
with runCommand because it does not set the correct permissions for
source files and directories.
  • Loading branch information
djacu committed Nov 29, 2024
1 parent 2613d72 commit 829f75d
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions nix/checks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,27 @@ genAttrs
''
);

perl-switches = (
pkgs.runCommand "perl-switches"
{
buildInputs = [
pkgs.gnumake
pkgs.perl
];
}
''
cp -r --no-preserve=mode ${cleanSource inputs.self}/* .
cd switch-configuration
make .lint
make .build-switch-configs
touch $out
''
);
perl-switches = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "perl-switches";
version = "0.1.0";

src = switchConfigurationSrc;

nativeBuildInputs = with pkgs; [
gnumake
perl
];

buildPhase = ''
cd switch-configuration
make .lint
make .build-switch-configs
'';

installPhase = ''
touch $out
'';
});

openwrt-golden =
pkgs.runCommand "openwrt-golden"
Expand Down

0 comments on commit 829f75d

Please sign in to comment.