From 6fa90af645c11925b0b9ef5425100b9c05bf651a Mon Sep 17 00:00:00 2001 From: caandt Date: Thu, 31 Oct 2024 15:15:52 -0500 Subject: [PATCH] add battery tmux plugin to yuzu --- hosts/yuzu/users/ahnwuoa/default.nix | 15 ++++++++++++++- user/config/default.nix | 19 +++++++++++-------- user/default.nix | 1 + user/options.nix | 15 +++++++++++++++ 4 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 user/options.nix diff --git a/hosts/yuzu/users/ahnwuoa/default.nix b/hosts/yuzu/users/ahnwuoa/default.nix index b461b1b..cb54d73 100644 --- a/hosts/yuzu/users/ahnwuoa/default.nix +++ b/hosts/yuzu/users/ahnwuoa/default.nix @@ -1,7 +1,20 @@ -{config, ...}: { +{ + config, + pkgs, + ... +}: { imports = [ ../../../../user ]; home.username = "ahnwuoa"; + home.packages = [pkgs.acpi]; + u.tmux = { + plugins = [pkgs.tmuxPlugins.battery]; + extraConfig = '' + set -g status-right "#{client_user}@#H | #{battery_percentage} #{battery_remain} | %a %b %d, %H:%M" + set -g status-right-length 60 + set -g status-interval 15 + ''; + }; } diff --git a/user/config/default.nix b/user/config/default.nix index 74e70d6..1b37da0 100644 --- a/user/config/default.nix +++ b/user/config/default.nix @@ -1,11 +1,21 @@ { config, pkgs, + lib, ... }: let mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/config/${x}"; + tmuxConfig = config.u.tmux.extraConfig + lib.strings.concatMapStrings (x: "\nrun ${x.rtp}") config.u.tmux.plugins; in { imports = [./kde]; + + u.tmux.plugins = with pkgs.tmuxPlugins; [ + vim-tmux-navigator + sessionist + ]; + fonts.fontconfig.enable = false; + gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + xdg.configFile.alacritty.source = mkln "alacritty"; xdg.configFile.awesome.source = mkln "awesome"; xdg.configFile.bash.source = mkln "bash"; @@ -25,12 +35,5 @@ in { xdg.configFile.readline.source = ./readline; xdg.configFile."starship.toml".source = ./starship.toml; xdg.configFile.sx.source = mkln "sx"; - xdg.configFile."tmux/tmux.conf".text = - (builtins.readFile tmux/tmux.conf) - + '' - run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp} - run ${pkgs.tmuxPlugins.sessionist.rtp} - ''; - fonts.fontconfig.enable = false; - gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + xdg.configFile."tmux/tmux.conf".text = (builtins.readFile tmux/tmux.conf) + tmuxConfig; } diff --git a/user/default.nix b/user/default.nix index 7f7cea7..3d37cae 100644 --- a/user/default.nix +++ b/user/default.nix @@ -3,6 +3,7 @@ ./bin ./config ./home.nix + ./options.nix ./share ./theme.nix ./xdg.nix diff --git a/user/options.nix b/user/options.nix new file mode 100644 index 0000000..e32ea9d --- /dev/null +++ b/user/options.nix @@ -0,0 +1,15 @@ +{lib, ...}: { + options.u = { + tmux = { + plugins = lib.mkOption { + type = lib.types.listOf lib.types.package; + description = "tmux plugins to source in config"; + }; + extraConfig = lib.mkOption { + type = lib.types.lines; + description = "extra config to append to bottom of config"; + default = ""; + }; + }; + }; +}