mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
move powerline to module
This commit is contained in:
parent
716a154c79
commit
976e2c2f6c
2 changed files with 40 additions and 12 deletions
|
@ -1,17 +1,14 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
powerlineOpts = [
|
||||
"-colorize-hostname"
|
||||
"-cwd-mode=plain"
|
||||
"-modules=user,host,cwd,nix-shell,git,jobs"
|
||||
"-git-assume-unchanged-size 0"
|
||||
"-jobs $(jobs -p | wc -l)"
|
||||
];
|
||||
|
||||
system-rev = toString config.system.nixos.revision;
|
||||
|
||||
in
|
||||
{
|
||||
imports = [ ./powerline.nix ];
|
||||
|
||||
sconfig.powerline.enable = lib.mkDefault true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
darkhttpd
|
||||
dnsutils
|
||||
|
@ -102,11 +99,6 @@ in
|
|||
alias p=python3
|
||||
alias catc='${pkgs.vimpager-latest}/bin/vimpager --force-passthrough'
|
||||
alias nix-env="echo nix-env is disabled #"
|
||||
|
||||
function _update_ps1() {
|
||||
PS1="\n$(${pkgs.powerline-go}/bin/powerline-go ${lib.concatStringsSep " " powerlineOpts})$ "
|
||||
}
|
||||
[ "$TERM" = "linux" ] || PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
|
||||
'';
|
||||
|
||||
programs.neovim = {
|
||||
|
|
36
modules/cli/powerline.nix
Normal file
36
modules/cli/powerline.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.sconfig.powerline;
|
||||
in
|
||||
{
|
||||
options.sconfig.powerline =
|
||||
{
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
args = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [
|
||||
"-colorize-hostname"
|
||||
"-cwd-mode=plain"
|
||||
"-modules=user,host,cwd,nix-shell,git,jobs"
|
||||
"-git-assume-unchanged-size 0"
|
||||
"-jobs $(jobs -p | wc -l)"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.powerline-go ];
|
||||
|
||||
programs.bash.interactiveShellInit = ''
|
||||
function _update_ps1() {
|
||||
PS1="\n$(powerline-go ${lib.concatStringsSep " " cfg.args})$ "
|
||||
}
|
||||
[ "$TERM" = "linux" ] || PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue