use callPackage for merge-after-ci, nix-unit & tea-create-pr
All checks were successful
build / test (push) Successful in 9s

This commit is contained in:
lassulus 2023-08-03 18:04:03 +02:00
parent 6042d6eef5
commit d947c32a9b
5 changed files with 53 additions and 59 deletions

View File

@ -25,10 +25,8 @@
./templates/flake-module.nix
./templates/python-project/flake-module.nix
./pkgs/clan-cli/flake-module.nix
./pkgs/nix-unit/flake-module.nix
./pkgs/installer/flake-module.nix
./pkgs/tea-create-pr
./pkgs/merge-after-ci
./pkgs/flake-module.nix
./lib/flake-module.nix
({ self, lib, ... }: {
flake.nixosModules = lib.mapAttrs (_: nix: { imports = [ nix ]; }) (self.lib.findNixFiles ./nixosModules);

11
pkgs/flake-module.nix Normal file
View File

@ -0,0 +1,11 @@
{ ... }: {
perSystem = { pkgs, config, ... }: {
packages = {
tea-create-pr = pkgs.callPackage ./tea-create-pr { };
merge-after-ci = pkgs.callPackage ./merge-after-ci {
inherit (config.packages) tea-create-pr;
};
nix-unit = pkgs.callPackage ./nix-unit { };
};
};
}

View File

@ -1,27 +1,23 @@
{
perSystem =
{ pkgs
, self'
, ...
}:
let
name = builtins.baseNameOf ./.;
script = pkgs.writeShellApplication {
inherit name;
runtimeInputs = [
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.tea
pkgs.openssh
self'.packages.tea-create-pr
];
text = ''
bash ${./script.sh} "$@"
'';
};
in
{
packages.${name} = script;
};
{ writeShellApplication
, coreutils
, bash
, git
, tea
, openssh
, tea-create-pr
, ...
}:
writeShellApplication {
name = "merge-after-ci";
runtimeInputs = [
bash
coreutils
git
tea
openssh
tea-create-pr
];
text = ''
bash ${./script.sh} "$@"
'';
}

View File

@ -1,5 +0,0 @@
{
perSystem = { pkgs, ... }: {
packages.nix-unit = pkgs.callPackage ./default.nix { };
};
}

View File

@ -1,26 +1,20 @@
{
perSystem =
{ pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = pkgs.writeShellApplication {
inherit name;
runtimeInputs = [
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.tea
pkgs.openssh
];
text = ''
export EDITOR=${pkgs.vim}/bin/vim
bash ${./script.sh} "$@"
'';
};
in
{
packages.${name} = script;
};
{ writeShellApplication
, bash
, coreutils
, git
, tea
, openssh
}:
writeShellApplication {
name = "tea-create-pr";
runtimeInputs = [
bash
coreutils
git
tea
openssh
];
text = ''
bash ${./script.sh} "$@"
'';
}