Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ nix profile install github:hooreique/fall

## Home Manager flake example

The `overlays.default` overlay provides `pkgs.fall`, using dependencies from
the package set it is applied to.

Add `fall` to your flake:

```nix
Expand All @@ -49,7 +52,7 @@ Add `fall` to your flake:
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(final: prev: { fall = inputs.fall.packages.${system}.default; })
inputs.fall.overlays.default
];
};
in {
Expand Down
49 changes: 9 additions & 40 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
);
in
{
overlays.default = final: prev: {
fall = final.callPackage ./package.nix { };
};

packages = forAllSys (pkgs: {
fall = pkgs.callPackage ./package.nix { };
default = pkgs.callPackage ./package.nix { };
});

devShells = forAllSys (pkgs: {
default = pkgs.mkShell {
packages = [
Expand All @@ -22,45 +31,5 @@
];
};
});

packages = forAllSys (pkgs: {
default = pkgs.stdenvNoCC.mkDerivation {
pname = "fall";
version = "1.0.0";
src = ./.;

dontUnpack = true;
nativeBuildInputs = [ pkgs.makeWrapper ];

installPhase = ''
runHook preInstall

mkdir -p "$out/bin" "$out/share/fall"
cp "$src/fall.nu" "$src/codec.nu" "$out/share/fall/"

makeWrapper "${pkgs.nushell}/bin/nu" "$out/bin/fall" \
--prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.gitMinimal ]}" \
--set FALL_GIT_SSH_COMMAND "${pkgs.openssh}/bin/ssh" \
--add-flags "$out/share/fall/fall.nu"

runHook postInstall
'';

meta = {
mainProgram = "fall";
description = "Shell helper to fetch and show status of many Git repositories";
longDescription = ''
**fall — Fetch ALL**

*fall* runs `git fetch` and `git status` over every repository path
listed in `~/.config/fall/repos.conf`, using parallel jobs for speed.
With `fall .`, it can instead work from a project-local `.repos.conf`
discovered by walking up the directory tree.
'';
homepage = "https://github.com/hooreique/fall";
license = pkgs.lib.licenses.mit;
};
};
});
};
}
46 changes: 46 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
lib,
stdenvNoCC,
makeWrapper,
nushell,
gitMinimal,
openssh,
}:

stdenvNoCC.mkDerivation {
pname = "fall";
version = "1.0.0";
src = ./.;

dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];

installPhase = ''
runHook preInstall

mkdir -p "$out/bin" "$out/share/fall"
cp "$src/fall.nu" "$src/codec.nu" "$out/share/fall/"

makeWrapper "${nushell}/bin/nu" "$out/bin/fall" \
--prefix PATH : "${lib.makeBinPath [ gitMinimal ]}" \
--set FALL_GIT_SSH_COMMAND "${openssh}/bin/ssh" \
--add-flags "$out/share/fall/fall.nu"

runHook postInstall
'';

meta = {
mainProgram = "fall";
description = "Shell helper to fetch and show status of many Git repositories";
longDescription = ''
**fall — Fetch ALL**

*fall* runs `git fetch` and `git status` over every repository path
listed in `~/.config/fall/repos.conf`, using parallel jobs for speed.
With `fall .`, it can instead work from a project-local `.repos.conf`
discovered by walking up the directory tree.
'';
homepage = "https://github.com/hooreique/fall";
license = lib.licenses.mit;
};
}