Merge pull request #244487 from srid/nixci

nixci: init at 0.1.3
This commit is contained in:
Pol Dellaiera 2023-07-27 14:38:18 +02:00 committed by GitHub
commit 478c0fd0a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 78 additions and 0 deletions

View File

@ -15727,6 +15727,13 @@
githubId = 219362; githubId = 219362;
name = "Sarah Brofeldt"; name = "Sarah Brofeldt";
}; };
srid = {
email = "srid@srid.ca";
matrix = "@srid:matrix.org";
github = "srid";
githubId = 3998;
name = "Sridhar Ratnakumar";
};
srounce = { srounce = {
name = "Samuel Rounce"; name = "Samuel Rounce";
email = "me@samuelrounce.co.uk"; email = "me@samuelrounce.co.uk";

View File

@ -0,0 +1,27 @@
{ writeShellApplication
, fetchFromGitHub
, nix
}:
let
devour-flake = fetchFromGitHub {
owner = "srid";
repo = "devour-flake";
rev = "v2";
hash = "sha256-CZedJtbZlWAbv/b/aYgOEFd9vcTBn/oJNI3p29UitLk=";
};
in
writeShellApplication {
name = "devour-flake";
runtimeInputs = [ nix ];
text = ''
FLAKE="$1"
shift 1 || true
nix build ${devour-flake}#default \
"$@" \
-L --no-link --print-out-paths \
--override-input flake "$FLAKE" \
| xargs cat
'';
}

View File

@ -0,0 +1,38 @@
{ lib, stdenv
, rustPlatform
, fetchCrate
, libiconv
, openssl
, pkg-config
, Security
, devour-flake
}:
rustPlatform.buildRustPackage rec {
pname = "nixci";
version = "0.1.3";
src = fetchCrate {
inherit version;
pname = "nixci";
hash = "sha256-sM/1G1mf+msWbG4CX/pZNt4FmSKR2hWXdcq5h7W1AM0=";
};
cargoHash = "sha256-PKBNQKuWV4PE7iSKr+LugayroFjDBT4/vyyjJiw/E+I=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libiconv openssl ]
++ lib.optionals stdenv.isDarwin [ Security ];
# The rust program expects an environment (at build time) that points to the
# devour-flake executable.
DEVOUR_FLAKE = lib.getExe devour-flake;
meta = with lib; {
description = "Define and build CI for Nix projects anywhere";
homepage = "https://github.com/srid/nixci";
license = licenses.agpl3Only;
maintainers = with maintainers; [ srid ];
mainProgram = "nixci";
};
}

View File

@ -577,6 +577,8 @@ with pkgs;
dec-decode = callPackage ../development/tools/dec-decode { }; dec-decode = callPackage ../development/tools/dec-decode { };
devour-flake = callPackage ../tools/nix/devour-flake { };
dnf5 = callPackage ../tools/package-management/dnf5 { }; dnf5 = callPackage ../tools/package-management/dnf5 { };
dsq = callPackage ../tools/misc/dsq { }; dsq = callPackage ../tools/misc/dsq { };
@ -40316,6 +40318,10 @@ with pkgs;
alejandra = callPackage ../tools/nix/alejandra { }; alejandra = callPackage ../tools/nix/alejandra { };
nixci = callPackage ../tools/nix/nixci {
inherit (darwin.apple_sdk.frameworks) Security;
};
nixfmt = haskellPackages.nixfmt.bin; nixfmt = haskellPackages.nixfmt.bin;
nixpkgs-fmt = callPackage ../tools/nix/nixpkgs-fmt { }; nixpkgs-fmt = callPackage ../tools/nix/nixpkgs-fmt { };