Compare commits
2 commits
c621860314
...
0c995da8af
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0c995da8af |
||
![]() |
967218a48e |
4 changed files with 43 additions and 50 deletions
|
@ -75,7 +75,6 @@
|
||||||
};
|
};
|
||||||
programs = {
|
programs = {
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
btop.enable = true;
|
|
||||||
nh.enable = true;
|
nh.enable = true;
|
||||||
thunar.enable = true;
|
thunar.enable = true;
|
||||||
};
|
};
|
||||||
|
|
40
modules/home/programs/btop.hjem.nix
Normal file
40
modules/home/programs/btop.hjem.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
|
}
|
|
@ -1,49 +0,0 @@
|
||||||
{
|
|
||||||
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,6 +127,9 @@ binds {
|
||||||
Mod+Return {
|
Mod+Return {
|
||||||
spawn "ghostty"
|
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 {
|
Mod+B {
|
||||||
spawn "brave"
|
spawn "brave"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue