Compare commits
No commits in common. "0c995da8afb6dbb13dacc6ab5effaabb2cbd12e0" and "c621860314327a947a3de38f0730c9ae31807e3b" have entirely different histories.
0c995da8af
...
c621860314
4 changed files with 50 additions and 43 deletions
|
@ -75,6 +75,7 @@
|
|||
};
|
||||
programs = {
|
||||
ssh.enable = true;
|
||||
btop.enable = true;
|
||||
nh.enable = true;
|
||||
thunar.enable = true;
|
||||
};
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (builtins) attrValues;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
|
||||
btop-settings = {
|
||||
truecolor = "True";
|
||||
vim_keys = "True";
|
||||
rounded_corners = "True";
|
||||
update_ms = "100";
|
||||
graph_symbol = "braille";
|
||||
cpu_single_graph = "True";
|
||||
clock_format = "%X";
|
||||
use_fstab = "True";
|
||||
io_mode = "True";
|
||||
net_sync = "True";
|
||||
net_iface = "enp4s0";
|
||||
log_level = "ERROR";
|
||||
color_theme = "gruvbox_dark";
|
||||
};
|
||||
|
||||
btop-no-desktop-entry = pkgs.btop.overrideAttrs (prev: {
|
||||
postInstall = ''
|
||||
${prev.postInstall or ""}
|
||||
rm -rf $out/share/applications/*.desktop
|
||||
'';
|
||||
});
|
||||
|
||||
in
|
||||
{
|
||||
packages = attrValues { inherit btop-no-desktop-entry; };
|
||||
files.".config/btop/btop.conf".text =
|
||||
concatStringsSep "\n" <| mapAttrsToList (name: value: "${name} = ${toString value}") btop-settings;
|
||||
|
||||
}
|
49
modules/programs/tui/btop.mod.nix
Normal file
49
modules/programs/tui/btop.mod.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.modules.programs.btop;
|
||||
|
||||
btop-settings = pkgs.writeTextDir "btop/btop.conf" ''
|
||||
truecolor = True
|
||||
vim_keys = True
|
||||
rounded_corners = True
|
||||
update_ms = 100
|
||||
graph_symbol = "braille"
|
||||
cpu_single_graph = True
|
||||
clock_format = "%X"
|
||||
use_fstab = True
|
||||
io_mode = True
|
||||
net_sync = True
|
||||
net_iface = "enp4s0"
|
||||
log_level = "ERROR"
|
||||
'';
|
||||
|
||||
btop-no-desktop-entry = pkgs.btop.overrideAttrs (prev: {
|
||||
postInstall = ''
|
||||
${prev.postInstall or ""}
|
||||
rm -rf $out/share/applications/*.desktop
|
||||
'';
|
||||
});
|
||||
|
||||
btop-wrapped = pkgs.symlinkJoin {
|
||||
name = "btop-wrapped";
|
||||
paths = [ btop-no-desktop-entry ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/btop --set XDG_CONFIG_HOME "${btop-settings}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
options.modules.programs.btop.enable = mkEnableOption "btop";
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ btop-wrapped ];
|
||||
};
|
||||
}
|
|
@ -127,9 +127,6 @@ binds {
|
|||
Mod+Return {
|
||||
spawn "ghostty"
|
||||
}
|
||||
Mod+Shift+Return {
|
||||
spawn "sh" "-c" "niri msg action spawn -- ghostty; sleep 0.3; niri msg action consume-or-expel-window-left"
|
||||
}
|
||||
Mod+B {
|
||||
spawn "brave"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue