Add btop theming

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-27 14:21:16 +03:00
parent cc2fb93a4a
commit e89758467a
9 changed files with 134 additions and 44 deletions

24
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719236180, "lastModified": 1719401812,
"narHash": "sha256-VZAfBk2Lo8hQy/NQ4XVSpTICT0ownXBUi1QvGfdlxaM=", "narHash": "sha256-QONBQ/arBsKZNJuSd3sMIkSYFlBoRJpvf1jGlMfcOuI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "dd4d1663ccf7fbdb32361b9afe9e71206584cd4c", "rev": "b6a1262796b2990ec3cc60bb2ec23583f35b2f43",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719180626, "lastModified": 1719418488,
"narHash": "sha256-vZAzm5KQpR6RGple1dzmSJw5kPivES2heCFM+ZWkt0I=", "narHash": "sha256-Hu75KIbGLJA8qe42rO5WkRQ+E+BuzjS42bNEZcy9zT8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "6b1f90a8ff92e81638ae6eb48cd62349c3e387bb", "rev": "607f969f5dca2dc100cbc53e24ab49ac24ef8987",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -58,11 +58,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1719075281, "lastModified": 1719254875,
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -105,11 +105,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1719111739, "lastModified": 1719268571,
"narHash": "sha256-kr2QzRrplzlCP87ddayCZQS+dhGW98kw2zy7+jUXtF4=", "narHash": "sha256-pcUk2Fg5vPXLUEnFI97qaB8hto/IToRfqskFqsjvjb8=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "5e2e9421e9ed2b918be0a441c4535cfa45e04811", "rev": "c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -38,6 +38,7 @@
supportedFilesystems = [ "btrfs" "ntfs" ]; supportedFilesystems = [ "btrfs" "ntfs" ];
}; };
hardware.graphics.enable32Bit = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";

View File

@@ -29,15 +29,12 @@
}; };
}; };
graphics = { graphics.extraPackages = with pkgs; [
enable32Bit = true; amdvlk
extraPackages = with pkgs; [ driversi686Linux.amdvlk
amdvlk rocmPackages.clr
driversi686Linux.amdvlk rocmPackages.clr.icd
rocmPackages.clr ];
rocmPackages.clr.icd
];
};
}; };
services = { services = {
@@ -55,13 +52,10 @@
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
monitor = "eDP-1, 2560x1600@165, 0x0, 1.25"; monitor = "eDP-1, 2560x1600@165, 0x0, 1.25";
env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ]; env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ];
device = [ device = [{
{ name = "syna2ba6:00-06cb:ce44-touchpad";
name = "syna2ba6:00-06cb:ce44-touchpad"; sensitivity = 0.5;
natural_scroll = "true"; }];
sensitivity = 0.5;
}
];
}; };
theme = { theme = {
@@ -81,4 +75,9 @@
ln -sf $CARD $HOME/.config/hypr/card ln -sf $CARD $HOME/.config/hypr/card
''; '';
}]; }];
nixpkgs.config = {
cudaSupport = true;
rocmSupport = true;
};
} }

View File

@@ -24,6 +24,7 @@
home.stateVersion = "24.05"; home.stateVersion = "24.05";
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
nix.settings = config.nix.settings; nix.settings = config.nix.settings;
nixpkgs.config = config.nixpkgs.config;
}]; }];
}; };

View File

@@ -0,0 +1,38 @@
{ user ? throw "user argument is required", gpu ? false }: { config, lib, pkgs, ... }:
let
hmConfig = config.home-manager.users."${user.name}";
in
{
home-manager.users."${user.name}" = {
programs = {
btop = {
enable = true;
settings = {
color_theme = "matugen";
theme_background = false;
presets = "";
vim_keys = true;
shown_boxes = "cpu mem net proc gpu0 gpu1";
update_ms = 1000;
proc_tree = true;
cpu_single_graph = true;
disks_filter = "/ /nix /persist /cache";
};
};
matugen.settings.templates.btop = {
input_path = ./theme.theme;
output_path = "${hmConfig.xdg.configHome}/btop/themes/matugen.theme";
};
};
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
name = "reload-btop";
runtimeInputs = with pkgs; [ procps ];
text = ''
pkill btop -SIGUSR2
'';
})} &";
};
}

View File

@@ -0,0 +1,50 @@
theme[main_bg]="{{colors.surface.default.hex}}"
theme[main_fg]="{{colors.on_surface.default.hex}}"
theme[title]="{{colors.on_surface.default.hex}}"
theme[hi_fg]="{{colors.primary.default.hex}}"
theme[selected_bg]="{{colors.primary_container.default.hex}}"
theme[selected_fg]="{{colors.on_primary_container.default.hex}}"
theme[inactive_fg]="{{colors.surface_variant.default.hex}}"
theme[graph_text]="{{colors.on_surface_variant.default.hex}}"
theme[proc_misc]="{{colors.primary.default.hex}}"
theme[cpu_box]="{{colors.outline.default.hex}}"
theme[mem_box]="{{colors.outline.default.hex}}"
theme[net_box]="{{colors.outline.default.hex}}"
theme[proc_box]="{{colors.outline.default.hex}}"
theme[div_line]="{{colors.outline_variant.default.hex}}"
theme[temp_start]="{{colors.primary.default.hex}}"
theme[temp_mid]=""
theme[temp_end]="{{colors.error.default.hex}}"
theme[cpu_start]="{{colors.primary.default.hex}}"
theme[cpu_mid]=""
theme[cpu_end]="{{colors.error.default.hex}}"
theme[used_start]="{{colors.primary.default.hex}}"
theme[used_mid]=""
theme[used_end]="{{colors.secondary.default.hex}}"
theme[available_start]="{{colors.tertiary.default.hex}}"
theme[available_mid]=""
theme[available_end]="{{colors.secondary.default.hex}}"
theme[cached_start]="{{colors.primary.default.hex}}"
theme[cached_mid]=""
theme[cached_end]="{{colors.secondary.default.hex}}"
theme[free_start]="{{colors.tertiary.default.hex}}"
theme[free_mid]=""
theme[free_end]="{{colors.secondary.default.hex}}"
theme[download_start]="{{colors.primary.default.hex}}"
theme[download_mid]=""
theme[download_end]="{{colors.secondary.default.hex}}"
theme[upload_start]="{{colors.primary.default.hex}}"
theme[upload_mid]=""
theme[upload_end]="{{colors.tertiary.default.hex}}"

View File

@@ -113,14 +113,14 @@ in
''; '';
}; };
programs.zsh.loginExtra = lib.mkAfter '' programs = {
if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then zsh.loginExtra = lib.mkAfter ''
hyprland &> /tmp/hyprland.log if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
fi hyprland &> /tmp/hyprland.log
''; fi
'';
programs.matugen.settings.templates = { matugen.settings.templates.hyprland = {
hyprland = {
input_path = ./theme.conf; input_path = ./theme.conf;
output_path = "${hmConfig.xdg.configHome}/hypr/theme.conf"; output_path = "${hmConfig.xdg.configHome}/hypr/theme.conf";
}; };

View File

@@ -5,16 +5,16 @@ let
in in
{ {
home-manager.users."${user.name}" = { home-manager.users."${user.name}" = {
programs.kitty = { programs = {
enable = true;
extraConfig = ''
confirm_os_window_close 0
include theme.conf
'';
};
programs.matugen.settings.templates = {
kitty = { kitty = {
enable = true;
extraConfig = ''
confirm_os_window_close 0
include theme.conf
'';
};
matugen.settings.templates.kitty = {
input_path = ./theme.conf; input_path = ./theme.conf;
output_path = "${hmConfig.xdg.configHome}/kitty/theme.conf"; output_path = "${hmConfig.xdg.configHome}/kitty/theme.conf";
}; };

View File

@@ -10,6 +10,7 @@ in
(import ../configs/git { inherit user; }) (import ../configs/git { inherit user; })
(import ../configs/neovim { inherit user; }) (import ../configs/neovim { inherit user; })
(import ../configs/gpg-agent { inherit user; }) (import ../configs/gpg-agent { inherit user; })
(import ../configs/btop { inherit user; })
]; ];
sops.secrets.nick-password = { sops.secrets.nick-password = {