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

View File

@ -56,10 +56,13 @@ in
{
config = mkIf (enable && tooling.enable) {
environment.systemPackages = [ helix-wrapped ];
environment.sessionVariables.EDITOR = getExe helix;
environment.sessionVariables.EDITOR = getExe helix-wrapped;
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.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 = {
system = "x86_64-linux";
inputs = nivSources;
};
nix.settings.extra-substituters = [

View File

@ -88,5 +88,11 @@
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/bfb7a882678e518398ce9a31a881538679f6f092.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 = [
"agenix"
@ -17,6 +22,7 @@
prev
lib
config
inputs
;
})
)
@ -32,5 +38,6 @@
./rfindup.nix
./glibc-eac.nix
./factorio.nix
./ranger.nix
];
}

View File

@ -1,6 +1,5 @@
{ prev, ... }:
{ prev, inputs, ... }:
let
nivSources = import ../nix/sources.nix;
glibc_patches = [ "rogue_company_reverts.patch" ];
in
{
@ -12,7 +11,7 @@ in
in
if oldPatches == null then [ ] else oldPatches
)
++ (map (p: "${nivSources.glibc-eac}/${p}") glibc_patches);
++ (map (p: "${inputs.glibc-eac}/${p}") glibc_patches);
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 (
with pkgs;
[
webcord
discord
vesktop
obs-studio
element-desktop
ghidra