2023-06-18 06:31:47 +00:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
cell,
|
2023-07-01 00:56:33 +00:00
|
|
|
}: let
|
|
|
|
pkgs = inputs.nixpkgs;
|
|
|
|
in {
|
2023-06-18 06:31:47 +00:00
|
|
|
inherit (inputs.cells.dotfiles.packages) kpcli-py;
|
2023-07-01 00:56:33 +00:00
|
|
|
kpxc = let
|
|
|
|
inherit (pkgs) keepassxc;
|
|
|
|
in
|
2023-10-01 04:03:22 +00:00
|
|
|
if pkgs.stdenv.isDarwin
|
|
|
|
then
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
pname = "keepassxc-darwin";
|
|
|
|
version = keepassxc.version;
|
2023-07-01 00:56:33 +00:00
|
|
|
|
2023-10-01 04:03:22 +00:00
|
|
|
phases = ["installPhase"];
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -r ${keepassxc}/* $out/
|
2023-07-01 00:56:33 +00:00
|
|
|
|
2023-10-01 04:03:22 +00:00
|
|
|
${
|
|
|
|
if pkgs.stdenv.hostPlatform.isDarwin
|
|
|
|
then ''
|
|
|
|
for exe in $(find $out/Applications/KeePassXC.app/Contents/MacOS/ -type f -executable); do
|
|
|
|
exe_name=$(basename $exe)
|
|
|
|
ln -s $exe $out/bin/$exe_name
|
|
|
|
done
|
|
|
|
''
|
|
|
|
else ""
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
meta =
|
|
|
|
keepassxc.meta
|
|
|
|
// {
|
|
|
|
description = "Wrapper for keepassxc and keepassxc-cli with additional Darwin-specific fixes";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
else keepassxc;
|
2023-07-31 08:27:47 +00:00
|
|
|
|
|
|
|
pixi-edit = inputs.cells.dev.packages.pixi-edit;
|
2023-09-01 19:20:38 +00:00
|
|
|
|
|
|
|
nil = inputs.nixpkgs.nil;
|
2023-10-01 04:49:13 +00:00
|
|
|
|
2023-10-21 21:13:19 +00:00
|
|
|
# These should probably go to dotfiles {{{
|
2023-10-01 04:49:13 +00:00
|
|
|
git-plus = pkgs.symlinkJoin {
|
|
|
|
name = "pegasust-git-plus";
|
|
|
|
paths = [
|
|
|
|
(pkgs.writeShellScriptBin "git-lola" ''
|
|
|
|
git log --graph --decorate --color=always --abbrev-commit --all\
|
|
|
|
--pretty=format:'%C(auto)%h %d %C(cyan)%s %C(green)(%cr)%C(reset)' |
|
|
|
|
while IFS= read -r line; do
|
|
|
|
# Format the relative time
|
|
|
|
line=$(echo "$line" | sed -e 's/ minute/ min/' \
|
|
|
|
-e 's/ week/ wk/' \
|
|
|
|
-e 's/ hour/ hr/' \
|
|
|
|
-e 's/ month/ mo/' \
|
|
|
|
-e 's/ year/ yr/' \
|
|
|
|
-e 's/ ago//')
|
|
|
|
|
|
|
|
# Print the formatted line
|
|
|
|
echo "$line"
|
|
|
|
done | less -R
|
|
|
|
'')
|
|
|
|
(pkgs.writeShellScriptBin "git-lol" ''
|
|
|
|
git log --graph --decorate --color=always --abbrev-commit \
|
|
|
|
--pretty=format:'%C(auto)%h %d %C(cyan)%s %C(green)(%cr)%C(reset)' |
|
|
|
|
while IFS= read -r line; do
|
|
|
|
# Format the relative time
|
|
|
|
line=$(echo "$line" | sed -e 's/ minute/ min/' \
|
|
|
|
-e 's/ week/ wk/' \
|
|
|
|
-e 's/ hour/ hr/' \
|
|
|
|
-e 's/ month/ mo/' \
|
|
|
|
-e 's/ year/ yr/' \
|
|
|
|
-e 's/ ago//')
|
|
|
|
|
|
|
|
# Print the formatted line
|
|
|
|
echo "$line"
|
|
|
|
done | less -R
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
};
|
2023-10-21 21:13:19 +00:00
|
|
|
|
|
|
|
nixr = pkgs.writeShellScriptBin "nixr" ''
|
|
|
|
rc_path=""
|
|
|
|
|
|
|
|
p0="$(pwd)/.repl.nix"
|
|
|
|
p1=~/.config/.repl.nix
|
|
|
|
if [ -f $p0 ]; then
|
|
|
|
echo "[nixr]: trying $p0"
|
|
|
|
rc_path="$p0"
|
|
|
|
elif [ -f $p1 ]; then
|
|
|
|
echo "[nixr]: trying $p1"
|
|
|
|
rc_path="$p1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$rc_path" ]; then
|
|
|
|
echo "nix-repl: sourcing from $rc_path; content:"
|
|
|
|
echo '```'
|
|
|
|
cat $rc_path
|
|
|
|
echo '```'
|
|
|
|
nix repl --file "$rc_path"
|
|
|
|
else
|
|
|
|
nix repl
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
# }}}
|
2023-06-18 06:31:47 +00:00
|
|
|
}
|