bits-and-bytes/flake.nix

52 lines
1.4 KiB
Nix

{
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
install --mode 555 src/flutter/build.sh $out/bin/flutter-build
'';
};
flutter-build-raw = pkgs.callPackage flutterBuildRaw {};
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
'';
};
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 \
$@
'';
# A script for checking if a PR is okay
checkPr = pkgs.callPackage checkPr {};
};
});
}