From 976b6b670daa7bd994df627f204b7a9b29a6b09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 7 Jul 2019 11:45:08 +0100 Subject: [PATCH] refactor home manager settings --- nixos/home.nix | 121 ++--------------------------------- nixos/programs/alacritty.nix | 64 ++++++++++++++++++ nixos/programs/zsh.nix | 56 ++++++++++++++++ 3 files changed, 125 insertions(+), 116 deletions(-) create mode 100644 nixos/programs/alacritty.nix create mode 100644 nixos/programs/zsh.nix diff --git a/nixos/home.nix b/nixos/home.nix index d612e8d7..4f8456f5 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -26,63 +26,14 @@ in yubico-piv-tool yubikey-personalization yubikey-personalization-gui yubikey-manager-qt mono calcurse calibre fbreader file python37Packages.binwalk-full ]; + imports = [ + ./programs/zsh.nix + ./programs/alacritty.nix + ]; + programs = { home-manager.enable = true; - zsh = { - enable = true; - history = { - size = 102400; - save = 102400; - ignoreDups = true; - expireDuplicatesFirst = true; - share = true; - }; - enableAutosuggestions = true; - enableCompletion = true; - oh-my-zsh = { - enable = true; - plugins = [ "vi-mode" "git" "python" "syntax-highlighting" "history-substring-search" "spectrum" "sshi" "prompt" "gpg" "autosuggestions" "tmux" ]; - }; - plugins = [ - { - name = "spaceship"; - file = "spaceship.zsh"; - src = pkgs.fetchgit { - url = "https://github.com/denysdovhan/spaceship-prompt"; - rev = "v3.11.1"; - sha256 = "0habry3r6wfbd9xbhw10qfdar3h5chjffr5pib4bx7j4iqcl8lw8"; - }; - }]; - initExtra = '' - SPACESHIP_TIME_SHOW=true - SPACESHIP_EXIT_CODE_SHOW=true - SPACESHIP_VI_MODE_SHOW=false - SPACESHIP_BATTERY_THRESHOLD=30 - setopt HIST_IGNORE_ALL_DUPS - ''; - profileExtra = '' - export PATH="$HOME/programs:$PATH"; - export PATH="$HOME/tools:$PATH"; - export PATH="$HOME/bin:$PATH"; - export PATH="$HOME/.local/bin:$PATH"; - export PATH="$GOPATH/bin:$PATH"; - export PATH="$HOME/.rvm/bin:$PATH"; - export PATH="$HOME/.cargo/bin:$PATH"; - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"; - ''; - sessionVariables = { - TERM="xterm-256color"; - EDITOR="vim"; - VISUAL="vim"; - PAGER="less"; - ZSH_TMUX_AUTOSTART=true; - GOPATH="$HOME/go"; - }; - shellAliases = { tmate = "tmux detach-client -E 'tmate;tmux'"; cat = "bat"; }; - }; - - vim = { enable = true; extraConfig = builtins.readFile ~/dev/dotfiles/.vimrc.nixos; @@ -114,68 +65,6 @@ in ]; }; - alacritty = { - enable = true; - settings = { - window.decorations = "none"; - window.startup_mode = "Fullscreen"; - - scrolling = { - history = 32000; - multiplier = 3; - faux_multiplier = 3; - auto_scroll = false; - }; - - tabspaces = 4; - - font = { - family = "DejaVu Sans Mono for Powerline"; - size = 12.0; - }; - - draw_bold_text_with_bright_colors = true; - - colors = { - primary = { - background= "0x002b36"; - foreground= "0x839496"; - - }; - - normal = { - black= "0x073642"; - red= "0xdc322f"; - green= "0x859900"; - yellow= "0xb58900"; - blue= "0x268bd2"; - magenta= "0xd33682"; - cyan= "0x2aa198"; - white= "0xeee8d5"; - }; - - bright = { - black= "0x002b36"; - red= "0xcb4b16"; - green= "0x586e75"; - yellow= "0x657b83"; - blue= "0x839496"; - magenta= "0x6c71c4"; - cyan= "0x93a1a1"; - white= "0xfdf6e3"; - }; - - background_opacity= 1.0; - dynamic_title= true; - }; - cursor= { - style = "Block"; - unfocused_hollow= true; - }; - live_config_reload= true; - }; - }; - fzf.enable = true; tmux = { enable = true; diff --git a/nixos/programs/alacritty.nix b/nixos/programs/alacritty.nix new file mode 100644 index 00000000..6db9b103 --- /dev/null +++ b/nixos/programs/alacritty.nix @@ -0,0 +1,64 @@ +{ config, pkgs, ... }: +{ + programs.alacritty = { + enable = true; + settings = { + window.decorations = "none"; + window.startup_mode = "Fullscreen"; + + scrolling = { + history = 32000; + multiplier = 3; + faux_multiplier = 3; + auto_scroll = false; + }; + + tabspaces = 4; + + font = { + family = "DejaVu Sans Mono for Powerline"; + size = 12.0; + }; + + draw_bold_text_with_bright_colors = true; + + colors = { + primary = { + background= "0x002b36"; + foreground= "0x839496"; + + }; + + normal = { + black= "0x073642"; + red= "0xdc322f"; + green= "0x859900"; + yellow= "0xb58900"; + blue= "0x268bd2"; + magenta= "0xd33682"; + cyan= "0x2aa198"; + white= "0xeee8d5"; + }; + + bright = { + black= "0x002b36"; + red= "0xcb4b16"; + green= "0x586e75"; + yellow= "0x657b83"; + blue= "0x839496"; + magenta= "0x6c71c4"; + cyan= "0x93a1a1"; + white= "0xfdf6e3"; + }; + + background_opacity= 1.0; + dynamic_title= true; + }; + cursor= { + style = "Block"; + unfocused_hollow= true; + }; + live_config_reload= true; + }; + }; + } diff --git a/nixos/programs/zsh.nix b/nixos/programs/zsh.nix new file mode 100644 index 00000000..c7dcdeec --- /dev/null +++ b/nixos/programs/zsh.nix @@ -0,0 +1,56 @@ +{ config, pkgs, ... }: + +{ + programs.zsh = { + enable = true; + history = { + size = 102400; + save = 102400; + ignoreDups = true; + expireDuplicatesFirst = true; + share = true; + }; + enableAutosuggestions = true; + enableCompletion = true; + oh-my-zsh = { + enable = true; + plugins = [ "vi-mode" "git" "python" "syntax-highlighting" "history-substring-search" "spectrum" "sshi" "prompt" "gpg" "autosuggestions" "tmux" ]; + }; + plugins = [ + { + name = "spaceship"; + file = "spaceship.zsh"; + src = pkgs.fetchgit { + url = "https://github.com/denysdovhan/spaceship-prompt"; + rev = "v3.11.1"; + sha256 = "0habry3r6wfbd9xbhw10qfdar3h5chjffr5pib4bx7j4iqcl8lw8"; + }; + }]; + initExtra = '' + SPACESHIP_TIME_SHOW=true + SPACESHIP_EXIT_CODE_SHOW=true + SPACESHIP_VI_MODE_SHOW=false + SPACESHIP_BATTERY_THRESHOLD=30 + setopt HIST_IGNORE_ALL_DUPS + ''; + profileExtra = '' + export PATH="$HOME/programs:$PATH"; + export PATH="$HOME/tools:$PATH"; + export PATH="$HOME/bin:$PATH"; + export PATH="$HOME/.local/bin:$PATH"; + export PATH="$GOPATH/bin:$PATH"; + export PATH="$HOME/.rvm/bin:$PATH"; + export PATH="$HOME/.cargo/bin:$PATH"; + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"; + ''; + sessionVariables = { + TERM="xterm-256color"; + EDITOR="vim"; + VISUAL="vim"; + PAGER="less"; + ZSH_TMUX_AUTOSTART=true; + GOPATH="$HOME/go"; + }; + shellAliases = { tmate = "tmux detach-client -E 'tmate;tmux'"; cat = "bat"; }; + }; + }