From 1b8574600c4554e08a9322bdfd0bc7786f0bd636 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Mon, 5 Jun 2023 14:42:32 -0400 Subject: [PATCH] remove powerline options --- modules/cli/default.nix | 2 -- modules/cli/powerline.nix | 54 ++++++++++++++------------------------- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/modules/cli/default.nix b/modules/cli/default.nix index 36fd22d..f4a3788 100644 --- a/modules/cli/default.nix +++ b/modules/cli/default.nix @@ -5,8 +5,6 @@ ./powerline.nix ]; - sconfig.powerline.enable = lib.mkDefault true; - environment.systemPackages = with pkgs; [ dnsutils du-dust diff --git a/modules/cli/powerline.nix b/modules/cli/powerline.nix index 02efa71..6687161 100644 --- a/modules/cli/powerline.nix +++ b/modules/cli/powerline.nix @@ -1,8 +1,6 @@ -{ config, pkgs, lib, ... }: +{ config, lib, pkgs, ... }: let - cfg = config.sconfig.powerline; - theme = pkgs.writeText "powerline.json" (builtins.toJSON { BoldForeground = true; @@ -12,39 +10,25 @@ let SeparatorFg = 16; }); + args = [ + "-modules=\${remote:+'user,host,'}nix-shell,git,jobs,cwd" + "-git-assume-unchanged-size 0" + "-theme ${theme}" + "-path-aliases '~/git=~/git'" + "-jobs $(jobs -p | wc -l)" + ]; + in { - options.sconfig.powerline = - { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - }; - args = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ - "-modules=\${remote:+'user,host,'}nix-shell,git,jobs,cwd" - "-git-assume-unchanged-size 0" - "-theme ${theme}" - "-path-aliases '~/git=~/git'" - "-jobs $(jobs -p | wc -l)" - ]; - }; - }; + environment.systemPackages = [ pkgs.powerline-go ]; - config = lib.mkIf cfg.enable { - - environment.systemPackages = [ pkgs.powerline-go ]; - - programs.bash.interactiveShellInit = '' - function _update_ps1() { - local remote=y - [ "$XDG_SESSION_TYPE" = "x11" ] && unset remote - [ "$XDG_SESSION_TYPE" = "wayland" ] && unset remote - PS1="$(powerline-go ${toString cfg.args})" - } - [ "$TERM" = "linux" ] || PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" - ''; - - }; + programs.bash.interactiveShellInit = '' + function _update_ps1() { + local remote=y + [ "$XDG_SESSION_TYPE" = "x11" ] && unset remote + [ "$XDG_SESSION_TYPE" = "wayland" ] && unset remote + PS1="$(powerline-go ${toString args})" + } + [ "$TERM" = "linux" ] || PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" + ''; }