feat: alias rm with trash-d
This commit is contained in:
parent
b0e5eebafc
commit
b0710205e6
3 changed files with 44 additions and 0 deletions
|
@ -67,6 +67,7 @@
|
||||||
nur.hmModules.nur
|
nur.hmModules.nur
|
||||||
|
|
||||||
./home
|
./home
|
||||||
|
./home/trash-d
|
||||||
./pkgs
|
./pkgs
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
7
common/home/trash-d/default.nix
Normal file
7
common/home/trash-d/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{pkgs, ...}: let
|
||||||
|
trash = pkgs.callPackage ./trash-d.nix pkgs;
|
||||||
|
in {
|
||||||
|
home.packages = [trash];
|
||||||
|
|
||||||
|
programs.bash.shellAliases.rm = "trash";
|
||||||
|
}
|
36
common/home/trash-d/trash-d.nix
Normal file
36
common/home/trash-d/trash-d.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
fetchFromGitHub,
|
||||||
|
dmd,
|
||||||
|
dub,
|
||||||
|
ronn,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "trash";
|
||||||
|
version = "unstable";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "rushsteve1";
|
||||||
|
repo = "trash-d";
|
||||||
|
rev = "d88bb672612761c8e299e717857bf9c85a903e99";
|
||||||
|
hash = "sha256-oPxeoEqOYf6DCg5rJxINqAIlMbxqzAJcZDUY/EzADzY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [dub dmd ronn];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
# https://github.com/svanderburg/node2nix/issues/217#issuecomment-751311272
|
||||||
|
export HOME=$(mktemp -d)
|
||||||
|
|
||||||
|
dub build
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin $out/man/man1
|
||||||
|
|
||||||
|
cp -a ./build/trash $out/bin/
|
||||||
|
|
||||||
|
ronn --roff --pipe MANUAL.md > $out/man/man1/trash.1
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue