2023-07-21 22:25:37 +00:00
|
|
|
{
|
|
|
|
description = "A collection of reusable scripts for various use-cases";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
|
|
|
flutterBuildRaw = {stdenv}: stdenv.mkDerivation {
|
|
|
|
pname = "flutter-build";
|
|
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
2023-07-24 16:37:43 +00:00
|
|
|
install --mode 555 src/flutter/build.sh $out/bin/flutter-build
|
2023-07-21 22:25:37 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
flutter-build-raw = pkgs.callPackage flutterBuildRaw {};
|
2023-07-24 16:37:03 +00:00
|
|
|
|
|
|
|
checkPr = {stdenv}: stdenv.mkDerivation {
|
|
|
|
pname = "check-pr";
|
|
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
install --mode 555 src/flutter/check-pr.sh $out/bin/check-pr
|
|
|
|
'';
|
|
|
|
};
|
2023-07-21 22:25:37 +00:00
|
|
|
in {
|
|
|
|
packages = {
|
|
|
|
# The raw flutter-build script
|
|
|
|
inherit flutter-build-raw;
|
|
|
|
|
|
|
|
# A wrapper around the script that already provides the notify-send option
|
|
|
|
flutter-build = pkgs.writeScriptBin "flutter-build" ''
|
|
|
|
${flutter-build-raw}/bin/flutter-build \
|
|
|
|
--notify-send ${pkgs.libnotify}/bin/notify-send \
|
|
|
|
$@
|
|
|
|
'';
|
2023-07-24 16:37:03 +00:00
|
|
|
|
|
|
|
# A script for checking if a PR is okay
|
|
|
|
checkPr = pkgs.callPackage checkPr {};
|
2023-07-21 22:25:37 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|