2024-02-19 06:42:58 +01:00
|
|
|
{ config, pkgs, unstablePkgs, ... }:
|
2023-12-12 00:48:10 +01:00
|
|
|
|
|
|
|
let
|
2024-02-18 23:33:39 +01:00
|
|
|
rangerGit = pkgs.ranger.overrideAttrs (old: {
|
|
|
|
version = "git";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "ranger";
|
|
|
|
repo = "ranger";
|
|
|
|
rev = "c7777d558d5b69843b21f986e9af1af311c83887";
|
|
|
|
hash = "sha256-DTVoEfc4dAaBTDLFujvWIYj5KHL89YknUiinIs9Rkeg=";
|
|
|
|
};
|
|
|
|
propagatedBuildInputs = with pkgs.python3Packages; [
|
|
|
|
# required for test suite, it's being ran during package build for some reason
|
|
|
|
flake8
|
|
|
|
pylint
|
|
|
|
pytest
|
|
|
|
setuptools
|
|
|
|
] ++ old.propagatedBuildInputs;
|
|
|
|
});
|
2024-03-21 22:48:14 +01:00
|
|
|
aliasDrag = pkgs.writeScriptBin "drag" ''
|
|
|
|
${unstablePkgs.ripdrag}/bin/ripdrag -Axd $@
|
|
|
|
'';
|
2023-12-12 00:48:10 +01:00
|
|
|
in
|
|
|
|
{
|
2024-02-19 06:42:58 +01:00
|
|
|
imports = [
|
|
|
|
./unstable-packages.nix
|
|
|
|
];
|
2023-12-12 00:48:10 +01:00
|
|
|
environment.systemPackages = with pkgs; [
|
2024-03-21 22:48:14 +01:00
|
|
|
aliasDrag
|
2024-02-18 23:33:39 +01:00
|
|
|
rangerGit
|
2023-12-12 00:48:10 +01:00
|
|
|
kitty
|
2024-02-17 07:15:11 +01:00
|
|
|
zoxide
|
2023-12-12 00:48:10 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.bash.interactiveShellInit = ''
|
|
|
|
if test -n "$KITTY_INSTALLATION_DIR"; then
|
|
|
|
export KITTY_SHELL_INTEGRATION="enabled,no-sudo"
|
|
|
|
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
|
|
|
|
fi
|
2024-02-17 07:15:11 +01:00
|
|
|
eval "''$(zoxide init bash)"
|
2024-03-06 04:28:21 +01:00
|
|
|
alias bye=exit
|
2023-12-12 00:48:10 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
environment.etc."xdg/kitty/kitty.conf".text = ''
|
|
|
|
font_size 10.0
|
|
|
|
scrollback_lines 10000
|
|
|
|
window_border_width 0.5
|
|
|
|
window_padding_width 3
|
2024-03-08 08:52:18 +01:00
|
|
|
${if config.services.xserver.desktopManager.gnome.enable then "hide_window_decorations yes" else ""}
|
2023-12-12 00:48:10 +01:00
|
|
|
background_opacity 0.8
|
|
|
|
dynamic_background_opacity yes
|
|
|
|
'';
|
|
|
|
|
|
|
|
environment.etc."ranger/rc.conf".text = ''
|
|
|
|
eval import os; fm.set_option_from_string("preview_images", "true") if "KITTY_INSTALLATION_DIR" in os.environ else None;
|
|
|
|
eval import os; fm.set_option_from_string("preview_images_method", "kitty") if "KITTY_INSTALLATION_DIR" in os.environ else None;
|
|
|
|
set vcs_aware true
|
|
|
|
set show_hidden true
|
|
|
|
|
2024-02-19 06:42:58 +01:00
|
|
|
alias drag shell ${unstablePkgs.ripdrag}/bin/ripdrag -Axd %p &
|
2023-12-12 00:48:10 +01:00
|
|
|
map <C-d> drag
|
|
|
|
'';
|
|
|
|
|
2024-02-18 23:33:39 +01:00
|
|
|
environment.etc."ranger/plugins/zoxide.py".source = pkgs.fetchFromGitHub {
|
|
|
|
owner = "jchook";
|
|
|
|
repo = "ranger-zoxide";
|
|
|
|
rev = "281828de060299f73fe0b02fcabf4f2f2bd78ab3";
|
|
|
|
hash = "sha256-JEuyYSVa1NS3aftezEJx/k19lwwzf7XhqBCL0jH6VT4=";
|
|
|
|
} + /__init__.py;
|
|
|
|
|
2023-12-12 00:48:10 +01:00
|
|
|
programs.direnv.enable = true;
|
|
|
|
|
|
|
|
programs.starship = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
format = "$all$line_break\${custom.ranger}$jobs$battery$time$status$os$container$shell$character";
|
|
|
|
directory = {
|
|
|
|
truncation_length = 5;
|
|
|
|
truncation_symbol = "…/";
|
|
|
|
};
|
|
|
|
username = {
|
|
|
|
show_always = true;
|
|
|
|
};
|
|
|
|
status.disabled = false;
|
|
|
|
custom.ranger = {
|
|
|
|
when = "test $RANGER_LEVEL";
|
|
|
|
command = "echo \"✦\"";
|
|
|
|
style = "bold 208";
|
|
|
|
};
|
|
|
|
# custom.PS1 = {
|
|
|
|
# when = true;
|
|
|
|
# command = "echo -e \"\\x1b\\x5d133;A\\x1b\\x5c\"";
|
|
|
|
# format = "$output";
|
|
|
|
# use_stdin = false;
|
|
|
|
# };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|