nix/system/global/home.nix
2023-04-18 08:58:53 +01:00

368 lines
9.1 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, user, name, ... }:
# https://nix-community.github.io/home-manager/options.html
{
programs.home-manager.enable = true;
home.username = "tristan";
home.homeDirectory = "/home/tristan";
xdg.userDirs.enable = true;
xdg.mimeApps = {
enable = true;
associations.added = {
"inode/directory" = "lf.desktop;vscodium.desktop;pcmanfm.desktop";
};
defaultApplications = {
"inode/directory" = "lf.desktop";
"text/html" = "brave-browser.desktop";
"x-scheme-handler/http" = "brave-browser.desktop";
"x-scheme-handler/https" = "brave-browser.desktop";
};
};
home.packages = with pkgs; [
# script requirements
libnotify
playerctl
grim
wl-clipboard
slurp
chafa
wofi
exa
du-dust
htop
imv
libsixel
swaybg
imagemagick
brave
logseq
quickemu
bitwarden
];
programs.fish = {
enable = true;
};
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
clock = true;
screenshots = true;
effect-scale = 0.5;
effect-blur = "10x10";
};
};
services.swayidle.enable = true;
services.swayidle.events = [
{ event = "before-sleep"; command = "${pkgs.swaylock-effects}/bin/swaylock"; }
{ event = "lock"; command = "${pkgs.swaylock-effects}/bin/swaylock"; }
];
wayland.windowManager.hyprland = {
enable = true;
systemdIntegration = true;
# https://wiki.hyprland.org/Configuring/Variables/
extraConfig = ''
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = NIXOS_OZONE_WL,1
input {
kb_layout = gb
kb_options = caps:escape
touchpad {
natural_scroll = yes
scroll_factor = 0.5
}
}
bind = SUPER, RETURN, exec, foot
bind = SUPER_SHIFT, Q, killactive,
bind = SUPER_SHIFT, E, exit,
bind = SUPER, d, exec, wofi --show drun
bind = SUPER, Z, exec, swaylock -f
bind = SUPER, M, exec, foot -e ncmpcpp
bind = SUPER, E, exec, foot -e neomutt
bind = SUPER, O, exec, pcmanfm
bind = SUPER, h, movefocus,l
bind = SUPER, l, movefocus,r
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
bind = SUPER, j, layoutmsg,cyclenext
bind = SUPER, k, layoutmsg,cycleprev
bind = SUPER, space, layoutmsg,swapwithmaster
bind = SUPER, F, fullscreen,
bind = SUPER, V, togglefloating,
bind = SUPER_SHIFT, P, exec,~/.local/scripts/bwmenu
bind = SUPER_SHIFT, S, exec,~/.local/scripts/screenshot
bind =,XF86AudioRaiseVolume, exec,amixer sset Master 5%+ && amixer sset Master unmute
bind =,XF86AudioLowerVolume, exec,amixer sset Master 5%-
bind =,XF86AudioPlay, exec,~/.local/scripts/play-pause
bind =,XF86AudioNext, exec,playerctl next
bind =,XF86AudioPrev, exec,playerctl previous
bind =,XF86MonBrightnessUp, exec,~/.local/scripts/brightness-up
bind =,XF86MonBrightnessDown, exec,~/.local/scripts/brightness-down
bind = SUPER,1,workspace,1
bind = SUPER,2,workspace,2
bind = SUPER,3,workspace,3
bind = SUPER,4,workspace,4
bind = SUPER,5,workspace,5
bind = SUPER,6,workspace,6
bind = SUPER,7,workspace,7
bind = SUPER,8,workspace,8
bind = SUPER,9,workspace,9
bind = SUPER,0,workspace,10
bind = SUPER_SHIFT,1,movetoworkspace,1
bind = SUPER_SHIFT,2,movetoworkspace,2
bind = SUPER_SHIFT,3,movetoworkspace,3
bind = SUPER_SHIFT,4,movetoworkspace,4
bind = SUPER_SHIFT,5,movetoworkspace,5
bind = SUPER_SHIFT,6,movetoworkspace,6
bind = SUPER_SHIFT,7,movetoworkspace,7
bind = SUPER_SHIFT,8,movetoworkspace,8
bind = SUPER_SHIFT,9,movetoworkspace,9
bind = SUPER_SHIFT,0,movetoworkspace,10
gestures {
workspace_swipe = yes
}
decoration {
rounding = 5
blur = 0
}
bezier=overshot, 0.05, 0.9, 0.1, 1.1
animations {
enabled = 1
animation = windows, 1, 5, default
animation = border, 1, 5, default
animation = fade, 1, 10,default
animation = workspaces, 1, 3, overshot
}
general {
resize_on_border = yes
layout = master
}
'';
};
programs.waybar.enable = true;
programs.waybar.settings = {
mainBar = {
layer = "top";
position = "top";
height = 36;
modules-left = [ "hyprland/window" ];
modules-right = [ "mpris" "pulseaudio" "clock" "tray" "battery" ];
clock = {
format = "📅 {:%a %b-%d %I:%M %p}";
};
pulseaudio = {
format-muted = "🔇 {volume}%";
format = "{icon} {volume}";
format-icons.default = ["🔈" "🔉" "🔊"];
on-click = "pavucontrol";
};
mpris = {
format= "{player_icon} {title}";
format-paused= "{status_icon} {title}";
player-icons = {
default = "";
mpv = "🎵";
};
status-icons = {
paused = "";
};
on-click = "~/.local/scripts/play-pause";
};
battery = {
format = "{icon} {capacity}%";
format-icons = ["🤏" "🪫" "🔋"];
states = {
warning = 30;
critical = 15;
};
};
};
};
programs.waybar.systemd = {
enable = true;
target = "hyprland-session.target";
};
services.udiskie = {
enable = true;
notify = true;
};
gtk = {
enable = true;
theme = {
name = "Materia-dark";
package = pkgs.materia-theme;
};
iconTheme = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
};
cursorTheme = {
name = "Vanilla-DMZ";
package = pkgs.vanilla-dmz;
size = 24;
};
gtk3.bookmarks = [
"file:///home/tristan/Documents"
];
};
services.mako = {
enable = true;
};
programs.ncmpcpp = {
enable = true;
settings.mpd_host = "music.local";
bindings = [
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "l"; command = "select_item"; }
{ key = "k"; command = "scroll_up"; }
{ key = "J"; command = [ "select_item" "scroll_down" ]; }
{ key = "K"; command = [ "select_item" "scroll_up" ]; }
];
};
services.mpd-mpris.enable = true;
services.mpd-mpris.mpd = {
host = "music.local";
};
programs.mpv.enable = true;
programs.mpv.bindings = {
l = "seek 5";
h = "seek -5";
e = "add chapter 1";
b = "add chapter -1";
">" = "multiply speed 1.1";
"<" = "multiply speed 1/1.1";
"." = "frame-step";
"," = "frame-back-step";
"ctrl+n" = "playlist-next";
"ctrl+p" = "playlist-prev";
k = "add volume 2";
j = "add volume -2";
m = "cycle mute";
c = "cycle sub-visibility";
};
programs.foot.enable = true;
programs.foot.server.enable = true;
programs.foot.settings = {
main = {
term = "xterm-256color";
font = "mono:size=12";
};
colors = {
foreground="abb2bf";
background="282c34";
regular0="222222";
regular1="eb3a26";
regular2="7fbc59";
regular3="e9db65";
regular4="4781d1";
regular5="7d74bb";
regular6="50a2bd";
regular7="dcdccc";
bright0="666666";
bright1="e15d4e";
bright2="8fbd73";
bright3="e3d97e";
bright4="6791ce";
bright5="8f88be";
bright6="6caabf";
bright7="ffffff";
};
};
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = with pkgs; [
vscode-extensions.asvetliakov.vscode-neovim
vscode-extensions.jnoortheen.nix-ide
];
userSettings = {
"vscode-neovim.neovimExecutablePaths.linux" = "/run/current-system/sw/bin/nvim";
"keyboard.dispatch" = "keyCode";
};
};
programs.rbw = {
enable = true;
settings = {
email = "tristan@tristans.cloud";
base_url = "https://vault.tristans.cloud";
};
};
programs.ssh.enable = true;
programs.ssh.matchBlocks = {
"git.tristans.cloud" = {
user = "git";
port = 2222;
};
};
programs.neovim.defaultEditor = true;
programs.lf.enable = true;
programs.lf.keybindings = {
D = "trash";
};
home.sessionPath = [
"$HOME/.local/scripts"
];
home.file.".local/scripts" = {
source = ./scripts;
executable = true;
recursive = true;
};
home.file.".config/wofi/config".text = ''
term=foot
'';
home.file.".icons/default".source = "${pkgs.vanilla-dmz}/share/icons/Vanilla-DMZ";
programs.librewolf.enable = true;
programs.git = {
enable = true;
aliases = {
graph = "log --oneline --all --graph";
amend = "commit --amend --no-edit";
};
};
}