Skip to content

Instantly share code, notes, and snippets.

@fufexan
Created February 25, 2021 15:31
Show Gist options
  • Save fufexan/e70e70d130ad4882102da392110fc175 to your computer and use it in GitHub Desktop.
Save fufexan/e70e70d130ad4882102da392110fc175 to your computer and use it in GitHub Desktop.
Home Manager configuration
{ config, pkgs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.username = "mihai";
home.homeDirectory = "/home/mihai";
home.stateVersion = "20.09";
# add locations to $PATH
home.sessionPath = [ "~/.local/bin" ];
# add environment variables
home.sessionVariables = {
EDITOR = "vim";
};
# install user packages
home.packages = with pkgs; [
# games
lutris
# messaging
tdesktop discord zoom-us element-desktop
# torrents
transmission-remote-gtk
];
home.extraOutputsToInstall = [ "doc" "info" "devdoc" ];
nixpkgs.overlays = [ (self: super: {
picom = super.picom.overrideAttrs (old: {
src = super.fetchFromGitHub {
owner = "tryone144";
repo = "compton";
rev = "c67d7d7b2c36f29846c6693a2f39a2e191a2fcc4";
sha256 = "1y1821islx0cg61z9kshs4mkvcp45bpkmzbll5zpzq84ycnqji2y";
};
});
orchis = super.callPackage ./overlays/packages/orchis { };
} ) ];
# accounts
#accounts.email = {
# accounts.fufexan = {
# address = "[email protected]";
# aliases = [ "[email protected]" ];
# name = "mihai";
# neomutt.enable = true;
# notmuch.enable = true;
# offlineimap.enable = true;
# };
#};
gtk = {
enable = true;
iconTheme.name = "Papirus-Dark";
iconTheme.package = pkgs.papirus-icon-theme;
theme.name = "Orchis-dark-compact";
theme.package = pkgs.orchis;
};
# programs
programs.alacritty = {
enable = true;
settings = {
window.dynamic_padding = false;
window.padding = {
x = 0;
y = 0;
};
scrolling.history = 10000;
font = {
normal.family = "FiraCode Nerd Font";
bold.family = "FiraCode Nerd Font";
italic.family = "FiraCode Nerd Font";
size = 11.0;
};
draw_bold_text_with_bright_colors = true;
colors = {
primary = {
background = "0x16161c";
foreground = "0xfdf0ed";
};
normal = {
black = "0x232530";
red = "0xe95678";
green = "0x29d398";
yellow = "0xfab795";
blue = "0x26bbd9";
magenta = "0xee64ae";
cyan = "0x59e3e3";
white = "0xfadad1";
};
bright = {
black = "0x2e303e";
red = "0xec6a88";
green = "0x3fdaa4";
yellow = "0xfbc3a7";
blue = "0x3fc6de";
magenta = "0xf075b7";
cyan = "0x6be6e6";
white = "0xfdf0ed";
};
};
background_opacity = 0.7;
live_config_reload = true;
};
};
programs.direnv = {
enable = true;
enableNixDirenvIntegration = true;
enableZshIntegration = true;
};
programs.emacs = {
enable = true;
package = pkgs.emacs27;
};
programs.firefox = {
enable = true;
profiles.mihai.name = "mihai";
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultCommand = "rg --files --hidden";
changeDirWidgetOptions = [
"--preview 'tree -C -L 3 -a {} | head -200'"
"--exact"
];
};
programs.gh = {
enable = true;
gitProtocol = "ssh";
};
programs.git = {
enable = true;
ignores = [ "*~" "*.swp" ];
signing = {
key = "3AC82B48170331D3";
signByDefault = true;
};
userEmail = "[email protected]";
userName = "Mihai Fufezan";
};
programs.mpv = {
enable = true;
defaultProfiles = [ "gpu-hq" ];
scripts = [ pkgs.mpvScripts.mpris ];
};
programs.ncmpcpp = {
enable = true;
package = pkgs.ncmpcpp.override { visualizerSupport = true; };
settings = {
ncmpcpp_directory = "~/.local/share/ncmpcpp";
};
};
programs.neomutt = {
enable = false;
checkStatsInterval = 60;
};
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
vim-nix coc-nvim coc-pairs coc-prettier coc-snippets coc-highlight
latex-live-preview
];
extraConfig = builtins.readFile ./programs/init.vim;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
};
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
settings = {
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
};
};
programs.rofi = {
enable = true;
package = pkgs.rofi.override { plugins = [ pkgs.rofi-emoji ]; };
pass = {
enable = true;
extraConfig = ''
URL_field='url';
USERNAME_field='user';
AUTOTYPE_field='autotype';
'';
stores = [ "$HOME/.local/share/password-store" ];
};
theme = ./programs/rofi.rasi;
};
programs.texlive = {
enable = false;
package = pkgs.texlive.combined.scheme-basic;
};
programs.zathura = {
enable = true;
options = {
recolor = true;
recolor-darkcolor = "#FDF0ED";
recolor-lightcolor = "rgba(0,0,0,0)";
default-bg = "rgba(0,0,0,0.7)";
default-fg = "#FDF0ED";
};
};
programs.zsh = {
enable = true;
enableAutosuggestions = true;
autocd = true;
dirHashes = {
dl = "$HOME/Downloads";
docs = "$HOME/Documents";
code = "$HOME/Documents/code";
};
dotDir = ".config/zsh";
history = {
expireDuplicatesFirst = true;
path = "${config.xdg.dataHome}/zsh_history";
};
shellAliases = {
grep = "grep --color";
l = "ls -lhAL";
};
};
# services
services.dunst = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
settings = {
global = {
follow = "mouse";
geometry = "350x5-4+32";
indicate_hidden = "yes";
shrink = "yes";
separator_height = 1;
padding = 8;
horizontal_padding = 8;
frame_width = 2;
icon_position = "left";
max_icon_size = 64;
font = "Noto Sans 10";
format = "<b>%s</b> | %a\n%b";
separator_color = "auto";
markup = "full";
alignment = "center";
vertical_alignment = "center";
word_wrap = "yes";
mouse_left_click = "do_action";
mouse_middle_click = "close_all";
mouse_right_click = "close_current";
show_indicators = false;
};
fullscreen_delay_everything = {
fullscreen = "delay";
};
urgency_critical = {
background = "#16161c";
foreground = "#fdf0ed";
frame_color = "#e95678";
};
urgency_low = {
background = "#16161c";
foreground = "#fdf0ed";
frame_color = "#29d398";
timeout = 15;
};
urgency_normal = {
background = "#16161c";
foreground = "#fdf0ed";
frame_color = "#fab795";
timeout = 30;
};
};
};
services.lorri.enable = true;
services.mpd = {
enable = true;
musicDirectory = "${config.home.homeDirectory}/Music";
extraConfig = ''
zeroconf_enabled "yes"
zeroconf_name "MPD @ %h"
input {
plugin "curl"
}
audio_output {
type "fifo"
name "Visualizer"
path "/tmp/mpd.fifo"
format "48000:16:2"
}
audio_output {
type "pulse"
name "PulseAudio"
}
'';
network.listenAddress = "any";
network.startWhenNeeded = true;
};
services.mpdris2.enable = true;
services.picom = {
enable = true;
blur = true;
blurExclude = [ "class_g = 'slop'" ];
experimentalBackends = true;
extraOptions = ''
# improve performance
glx-no-rebind-pixmap = true;
glx-no-stencil = true;
# fastest swap method
glx-swap-method = 1;
# dual kawase blur
blur-background-fixed = false;
blur-method = "dual_kawase";
blur-strength = 10;
use-ewmh-active-win = true;
detect-rounded-corners = true;
# stop compositing if there's a fullscreen program
unredir-if-possible = true;
# group wintypes and don't focus a menu (Telegram)
detect-transient = true;
detect-client-leader = true;
# needed for nvidia with glx backend
xrender-sync-fence = true;
'';
};
services.polybar = {
enable = true;
package = pkgs.polybar.override {
mpdSupport = true;
pulseSupport = true;
};
config = ./programs/polybar;
script = ''
polybar main &
[ $(xrandr -q | grep -w connected | grep -v primary | wc -l) -ge 1 ] && polybar external &
'';
};
services.random-background = {
enable = true;
imageDirectory = "${config.home.homeDirectory}/Pictures/wallpapers/artworks";
};
services.redshift = {
enable = true;
provider = "geoclue2";
};
services.sxhkd = {
enable = true;
keybindings = {
"super + Return" = "alacritty";
"super + @space" = "rofi -show combi";
"super + Escape" = "pkill -USR1 -x sxhkd";
# bspwm hotkeys
# quit bspwm normally
"super + alt + Escape" = "bspc quit";
# close and kill
"super + {_,shift + }q" = "bspc node -{c,k}";
# alternate between the tiled and monocle layout
"super + m" = "bspc desktop -l next";
# send the newest marked node to the newest preselected node
"super + y" = "bspc node newest.marked.local -n newest.!automatic.local";
# swap the current node and the biggest node
"super + g" = "bspc node -s biggest";
# state/flags
# set the window state
"super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}";
# set the node flags
"super + ctrl + {m,x,y,z}" = "bspc node -g {marked,locked,sticky,private}";
# focus/swap
# focus the node in the given direction
"super + {_,shift + }{h,j,k,l}" = "bspc node -{f,s} {west,south,north,east}";
# focus the next/previous node in the current desktop
"super + {_,shift + }c" = "bspc node -f {next,prev}.local";
# focus the next/previous desktop in the current monitor
"super + bracket{left,right}" = "bspc desktop -f {prev,next}.local";
# focus the last node/desktop
"super + {grave,Tab}" = "bspc {node,desktop} -f last";
# focus or send to the given desktop
"super + {_,shift + }{1-9,0}" = "bspc {desktop -f,node -d} '^{1-9,10}'";
# preselect the direction
"super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}";
# preselect the ratio
"super + ctrl + {1-9}" = "bspc node -o 0.{1-9}";
# cancel the preselection for the focused node
"super + ctrl + space" = "bspc node -p cancel";
# cancel the preselection for the focused desktop
"super + ctrl + shift + space" = "bspc query -N -d | xargs -I id -n 1 bspc
node id -p cancel";
# move/resize
# expand a window by moving one of its side outward
"super + alt + {h,j,k,l}" = "bspc node -z {left -20 0,bottom 0 20,top 0
-20,right 20 0}";
# contract a window by moving one of its side inward
"super + alt + shift + {h,j,k,l}" = "bspc node -z {right -20 0,top 0
20,bottom 0 -20,left 20 0}";
# move a floating window
"super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}";
# rotate window layout clockwise 90 degrees
"super + r" = "bspc node @parent -R 90";
# increase/decrease borders/gaps
#"super + shift + {b,g} + {Up,Down}" = "/.config/sxhkd/bspwm_rice.sh {b,g} {+,-}";
# programs
# screenshot curren monitor
"super + Print" = "~/.local/bin/maim_monitor.sh";
# screenshot menu
"Print" = "~/.config/rofi/scripts/screenshot.sh";
# backlight menu
"super + b" = "~/.config/rofi/scripts/backlight.sh";
# powermenu
"super + p" = "~/.config/rofi/scripts/powermenu.sh";
# volume menu
"super + v" = "~/.config/rofi/scripts/volume.sh";
# emoji launcher
"super + e" = "rofi -show emoji";
# rofi pass
"super + i" = "rofi-pass";
# music controls (mpris)
# mpd menu
"super + shift + m" = "~/.config/rofi/scripts/mpd.sh";
# play / pause
"Pause" = "playerctl play-pause";
# next/prev song
"super + shift + {Right,Left}" = "layerctl {next,previous}";
# toggle shuffle
"super + alt + z" = "playerctl shuffle";
# toggle repeat
"super + alt + r" = "playerctl loop";
};
};
services.syncthing.enable = true;
services.udiskie.enable = true;
#services.xcape = {
# enable = true;
# mapExpression = { Caps_Lock = "Escape"; };
# timeout = 100;
#};
xdg.enable = true;
xsession = {
enable = true;
pointerCursor = {
package = pkgs.capitaine-cursors;
name = "Capitaine Cursors";
size = 16;
};
preferStatusNotifierItems = true;
windowManager.bspwm = {
enable = true;
monitors = {
HDMI-0 = [ "一" "二" "三" "四" "五" ];
DVI-D-0 = [ "六" "七" "八" "九" "十" ];
};
rules = {
"osu!.exe" = {
desktop = "^3";
state = "fullscreen";
};
};
settings = {
border_width = 2;
window_gap = 8;
active_border_color = "#e95678";
focused_border_color = "#16161c";
normal_border_color = "#fab795";
presel_feedback_color = "#29d398";
split_ratio = 0.5;
borderless_monocle = true;
gapless_monocle = true;
single_monocle = true;
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment