improve ranger tooling

This commit is contained in:
Grimmauld 2024-05-31 17:33:40 +02:00
parent e64967fa76
commit 995c410cd7
Signed by: Grimmauld
GPG Key ID: C2946668769F91FB
10 changed files with 69 additions and 10 deletions

View File

@ -25,6 +25,7 @@ in
./git.nix ./git.nix
./c.nix ./c.nix
./java.nix ./java.nix
./ranger.nix
]; ];
config = mkIf (enable && tooling.enable) { config = mkIf (enable && tooling.enable) {
@ -51,7 +52,6 @@ in
fbcat fbcat
gomuks gomuks
ranger
imagemagick imagemagick
nmap nmap
@ -70,6 +70,8 @@ in
":q" = "exit"; ":q" = "exit";
"ls" = "eza"; "ls" = "eza";
"lix" = "nix"; "lix" = "nix";
"l" = "eza -hla";
"vi" = "hx";
"bat" = "bat --theme=Dracula"; "bat" = "bat --theme=Dracula";
}; };
@ -108,6 +110,7 @@ in
command = "basename $SHELL"; command = "basename $SHELL";
when = "test -v SHELL"; when = "test -v SHELL";
format = " in [$output]($style)"; format = " in [$output]($style)";
# ignore_timeout = true;
}; };
# env_var.SHELL = {variable = "SHELL"; default = ""; }; # env_var.SHELL = {variable = "SHELL"; default = ""; };
}; };

View File

@ -56,10 +56,13 @@ in
{ {
config = mkIf (enable && tooling.enable) { config = mkIf (enable && tooling.enable) {
environment.systemPackages = [ helix-wrapped ]; environment.systemPackages = [ helix-wrapped ];
environment.sessionVariables.EDITOR = getExe helix; environment.sessionVariables.EDITOR = getExe helix-wrapped;
programs.helix.config = { programs.helix.config = {
theme = "catppuccin_mocha"; editor.cursor-shape.insert = "bar";
theme = "base16_transparent";
# editor.commands.git = ":sh git";
# keys.normal.Delete = "delete_selection";
}; };
}; };

View File

@ -41,5 +41,5 @@
}; };
# nix.package = pkgs.nixVersions.latest; # nix.package = pkgs.nixVersions.latest;
nix.optimise.automatic = true; # nix.optimise.automatic = true;
} }

30
common/tooling/ranger.nix Normal file
View File

@ -0,0 +1,30 @@
{
pkgs,
config,
inputs,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling;
inherit (lib) mkIf mapAttrs' concatLines attrNames;
plugins = {
ranger_udisk_menu = inputs.ranger_udisk_menu;
};
in
{
config = mkIf (enable && tooling.enable) {
services.gvfs = {
enable = true;
package = pkgs.gvfs;
};
environment.systemPackages = [ pkgs.ranger ];
environment.etc = (mapAttrs' (n: v: {
name = "ranger/plugins/${n}";
value.source = v;
}) plugins) // {
"ranger/commands.py".text = concatLines (map (n: "from plugins.${n} import *") (attrNames plugins));
};
};
}

View File

@ -132,6 +132,7 @@ in
_module.args = { _module.args = {
system = "x86_64-linux"; system = "x86_64-linux";
inputs = nivSources;
}; };
nix.settings.extra-substituters = [ nix.settings.extra-substituters = [

View File

@ -88,5 +88,11 @@
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/bfb7a882678e518398ce9a31a881538679f6f092.tar.gz", "url": "https://github.com/NixOS/nixpkgs/archive/bfb7a882678e518398ce9a31a881538679f6f092.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"ranger_udisk_menu": {
"branch": "master",
"repo": "https://git.grimmauld.de/Grimmauld/ranger_udisk_menu.git",
"rev": "981756147834bb485ebcfa0e41ad60d05ccc4351",
"type": "git"
} }
} }

View File

@ -1,4 +1,9 @@
{ config, lib, ... }: {
config,
lib,
inputs,
...
}:
{ {
programs.ccache.packageNames = [ programs.ccache.packageNames = [
"agenix" "agenix"
@ -17,6 +22,7 @@
prev prev
lib lib
config config
inputs
; ;
}) })
) )
@ -32,5 +38,6 @@
./rfindup.nix ./rfindup.nix
./glibc-eac.nix ./glibc-eac.nix
./factorio.nix ./factorio.nix
./ranger.nix
]; ];
} }

View File

@ -1,6 +1,5 @@
{ prev, ... }: { prev, inputs, ... }:
let let
nivSources = import ../nix/sources.nix;
glibc_patches = [ "rogue_company_reverts.patch" ]; glibc_patches = [ "rogue_company_reverts.patch" ];
in in
{ {
@ -12,7 +11,7 @@ in
in in
if oldPatches == null then [ ] else oldPatches if oldPatches == null then [ ] else oldPatches
) )
++ (map (p: "${nivSources.glibc-eac}/${p}") glibc_patches); ++ (map (p: "${inputs.glibc-eac}/${p}") glibc_patches);
doCheck = false; doCheck = false;
}); });
} }

11
overlays/ranger.nix Normal file
View File

@ -0,0 +1,11 @@
{ prev, ... }:
{
ranger = prev.ranger.overrideAttrs (oldAttrs: {
propagatedBuildInputs =
(oldAttrs.propagatedBuildInputs or [ ])
++ (with prev; [
udisks
util-linux
]);
});
}

View File

@ -38,8 +38,7 @@
packages = lib.optionals config.grimmShared.graphical ( packages = lib.optionals config.grimmShared.graphical (
with pkgs; with pkgs;
[ [
webcord vesktop
discord
obs-studio obs-studio
element-desktop element-desktop
ghidra ghidra