remove powerline options

This commit is contained in:
Sean Buckley 2023-06-05 14:42:32 -04:00
parent 9899935183
commit 1b8574600c
2 changed files with 19 additions and 37 deletions

View file

@ -5,8 +5,6 @@
./powerline.nix ./powerline.nix
]; ];
sconfig.powerline.enable = lib.mkDefault true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
dnsutils dnsutils
du-dust du-dust

View file

@ -1,8 +1,6 @@
{ config, pkgs, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sconfig.powerline;
theme = pkgs.writeText "powerline.json" (builtins.toJSON theme = pkgs.writeText "powerline.json" (builtins.toJSON
{ {
BoldForeground = true; BoldForeground = true;
@ -12,39 +10,25 @@ let
SeparatorFg = 16; 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 in
{ {
options.sconfig.powerline = environment.systemPackages = [ pkgs.powerline-go ];
{
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)"
];
};
};
config = lib.mkIf cfg.enable { programs.bash.interactiveShellInit = ''
function _update_ps1() {
environment.systemPackages = [ pkgs.powerline-go ]; local remote=y
[ "$XDG_SESSION_TYPE" = "x11" ] && unset remote
programs.bash.interactiveShellInit = '' [ "$XDG_SESSION_TYPE" = "wayland" ] && unset remote
function _update_ps1() { PS1="$(powerline-go ${toString args})"
local remote=y }
[ "$XDG_SESSION_TYPE" = "x11" ] && unset remote [ "$TERM" = "linux" ] || PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
[ "$XDG_SESSION_TYPE" = "wayland" ] && unset remote '';
PS1="$(powerline-go ${toString cfg.args})"
}
[ "$TERM" = "linux" ] || PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
'';
};
} }