nixos-config/user/home.nix

372 lines
9.6 KiB
Nix
Raw Normal View History

2022-07-21 00:32:09 -03:00
{ config, pkgs, lib, ... }:
let
2022-08-04 23:46:59 -03:00
inherit (import ./variables.nix) key theme color accent font;
2022-07-16 02:12:18 -03:00
papirus_red = (pkgs.unstable.papirus-icon-theme.override { color = "red"; });
2022-07-21 00:32:09 -03:00
orchis_theme_compact =
(pkgs.orchis-theme.override { tweaks = [ "compact" "solid" ]; });
nerdfonts_fira_hack =
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; });
2022-08-02 22:33:21 -03:00
volumesh =
pkgs.writeShellScriptBin "volumesh" (builtins.readFile ./scripts/volumesh);
2022-07-20 22:14:36 -03:00
in {
2022-08-05 21:09:52 -03:00
imports = [ ./waybar.nix ./helix.nix ./kakoune.nix ./sway.nix ./git.nix ];
2022-06-05 01:43:16 -03:00
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "lelgenio";
home.homeDirectory = "/home/lelgenio";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.packages = with pkgs; [
alacritty
exa
fd
2022-08-05 21:09:52 -03:00
_diffr
kak-pager
2022-07-20 22:14:36 -03:00
# text manipulation
2022-07-20 20:07:58 -03:00
sd
2022-06-05 01:43:16 -03:00
ripgrep
2022-07-20 22:14:36 -03:00
# desktop
kanshi
xfce.thunar
2022-07-20 22:44:41 -03:00
pass
2022-08-01 20:15:26 -03:00
dhist
2022-08-01 20:59:20 -03:00
bmenu
2022-08-02 00:07:04 -03:00
volumesh
pamixer
libnotify
2022-07-20 22:14:36 -03:00
# media
2022-06-12 23:47:05 -03:00
yt-dlp
2022-06-09 23:16:20 -03:00
ffmpeg
imagemagick
mpv
2022-07-21 10:36:38 -03:00
mpc-cli
2022-08-05 11:20:13 -03:00
# pulse_sink
2022-08-02 21:36:25 -03:00
#games
lutris
steam
2022-07-20 20:07:58 -03:00
# chat
tdesktop
2022-08-02 21:36:25 -03:00
# discord # I'm using webcord, see home.activation
2022-08-03 11:56:30 -03:00
thunderbird
2022-07-20 20:07:58 -03:00
# Theming
2022-07-20 22:14:36 -03:00
orchis_theme_compact
papirus_red
2022-07-21 00:29:12 -03:00
libsForQt5.qtstyleplugins
qt5.qtsvg
2022-07-20 22:14:36 -03:00
## fonts
2022-06-13 10:34:47 -03:00
liberation_ttf
hack-font
font-awesome_5
fira-code
2022-07-21 00:32:09 -03:00
nerdfonts_fira_hack
2022-07-20 20:07:58 -03:00
# Programming
vscode
2022-08-04 11:58:56 -03:00
rustup
# cargo
# cargo-edit
2022-08-06 10:59:22 -03:00
# cargo-feature
2022-07-20 20:07:58 -03:00
rust-analyzer
gcc
2022-07-21 10:36:38 -03:00
nixfmt
2022-06-05 01:43:16 -03:00
];
2022-08-01 21:14:29 -03:00
programs.fish = {
enable = true;
interactiveShellInit = ''
2022-08-01 23:38:27 -03:00
set -g __accent_color "${accent.color}"
alias _fish_prompt_accent "_fish_prompt_color '$__accent_color'"
2022-08-01 21:14:29 -03:00
'';
2022-08-01 21:32:44 -03:00
shellAbbrs = {
2022-08-04 21:26:50 -03:00
v = "kak";
# system
2022-08-01 23:38:27 -03:00
sv = "sudo systemct";
suv = "sudo systemct --user";
# git abbrs
g = "git";
ga = "git add";
gs = "git status";
gsh = "git show";
gl = "git log";
gg = "git graph";
gd = "git diff";
gds = "git diff --staged";
gc = "git commit";
gca = "git commit --all";
gcf = "git commit --fixup";
gp = "git push -u origin (git branch --show-current)";
gw = "git switch";
gr = "cd (git root)";
gri = "git rebase --interactive FETCH_HEAD";
2022-08-01 23:18:35 -03:00
};
2022-08-01 23:38:27 -03:00
functions = { fish_greeting = ""; };
2022-08-01 23:18:35 -03:00
};
programs.zoxide = {
enable = true;
enableFishIntegration = true;
2022-08-01 21:14:29 -03:00
};
2022-08-06 10:59:22 -03:00
programs.direnv.enable = true;
2022-08-01 21:14:29 -03:00
home.file = {
".config/fish/conf.d/prompt.fish".source = ./fish_prompt.fish;
2022-08-01 23:18:29 -03:00
".local/share/backgrounds".source = ./backgrounds;
2022-08-01 21:14:29 -03:00
};
2022-08-01 21:40:12 -03:00
programs.alacritty = {
enable = true;
settings = {
2022-08-04 11:58:56 -03:00
font = {
size = font.size.small;
normal = { family = font.mono; };
};
2022-08-01 23:38:27 -03:00
colors = {
primary = {
background = "${color.bg}";
foreground = "${color.txt}";
2022-08-01 21:40:12 -03:00
};
2022-08-01 23:38:27 -03:00
cursor = {
text = "#000000";
cursor = "${accent.color}";
2022-08-01 21:40:12 -03:00
};
2022-08-01 23:38:27 -03:00
normal = {
black = "${color.normal.black}";
red = "${color.normal.red}";
green = "${color.normal.green}";
yellow = "${color.normal.yellow}";
blue = "${color.normal.blue}";
magenta = "${color.normal.magenta}";
cyan = "${color.normal.cyan}";
white = "${color.normal.white}";
2022-08-01 21:40:12 -03:00
};
};
2022-08-01 23:38:27 -03:00
draw_bold_text_with_bright_colors = false;
window = {
opacity = theme.opacity / 100.0;
dynamic_padding = true;
2022-08-01 21:40:12 -03:00
};
2022-08-04 11:58:56 -03:00
hints = {
alphabet = key.hints;
enabled = [{
regex = let
mimes =
"(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)";
# I fucking hate regex, look at this bullshit
delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^`'';
in "${mimes}[${delimiters}]+";
command = "xdg-open";
post_processing = true;
mouse = {
enabled = true;
mods = "None";
};
binding = {
key = "U";
mods = "Control|Shift";
};
}];
};
mouse = { hide_when_typing = true; };
key_bindings = [
{
key = lib.toUpper key.up;
mode = "Vi|~Search";
action = "Up";
}
{
key = lib.toUpper key.down;
mode = "Vi|~Search";
action = "Down";
}
{
key = lib.toUpper key.left;
mode = "Vi|~Search";
action = "Left";
}
{
key = lib.toUpper key.right;
mode = "Vi|~Search";
action = "Right";
}
{
key = lib.toUpper key.insertMode;
mode = "Vi|~Search";
action = "ScrollToBottom";
}
{
key = lib.toUpper key.insertMode;
mode = "Vi|~Search";
action = "ToggleViMode";
}
{
key = lib.toUpper key.next;
mode = "Vi|~Search";
action = "SearchNext";
}
{
key = "Up";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollLineUp";
}
{
key = "Down";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollLineDown";
}
{
key = "PageUp";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollHalfPageUp";
}
{
key = "PageDown";
mods = "Control|Shift";
mode = "~Alt";
action = "ScrollHalfPageDown";
}
{
key = "N";
mods = "Control|Shift";
action = "SpawnNewInstance";
}
# {%@@ if key.layout == "colemak" @@%}
{
key = "T";
mode = "Vi|~Search";
action = "SemanticRightEnd";
}
# {%@@ endif @@%}
];
2022-08-01 21:40:12 -03:00
};
};
2022-08-04 23:25:17 -03:00
2022-08-02 22:33:21 -03:00
home.sessionVariables = {
VOLUME_CHANGE_SOUND =
"${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/audio-volume-change.oga";
2022-08-02 00:07:04 -03:00
};
2022-06-05 01:43:16 -03:00
programs.firefox = {
enable = true;
package = pkgs.firefox;
2022-07-19 23:43:50 -03:00
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
ublock-origin
tree-style-tab
sponsorblock
duckduckgo-privacy-essentials
];
2022-06-13 20:10:58 -03:00
profiles = {
main = {
isDefault = true;
settings = {
"devtools.theme" = "dark";
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.tabs.inTitlebar" = 0;
};
userChrome = ''
2022-07-16 02:12:18 -03:00
#tabbrowser-tabs { visibility: collapse !important; }
2022-06-13 20:10:58 -03:00
'';
};
};
2022-06-05 01:43:16 -03:00
};
2022-06-12 23:47:05 -03:00
programs.command-not-found.enable = true;
2022-08-02 21:17:03 -03:00
home.activation = {
2022-08-02 22:33:21 -03:00
install_flatpaks = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
2022-08-04 23:12:25 -03:00
$DRY_RUN_CMD flatpak $VERBOSE_ARG remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$DRY_RUN_CMD flatpak $VERBOSE_ARG install -y flathub io.github.spacingbat3.webcord
2022-08-02 21:17:03 -03:00
'';
2022-06-12 23:47:05 -03:00
};
2022-06-13 12:07:08 -03:00
services.kdeconnect = {
enable = true;
indicator = true;
};
2022-07-21 10:36:38 -03:00
services.mpd = {
enable = true;
musicDirectory = "~/Música";
};
2022-07-19 22:20:55 -03:00
home.pointerCursor = {
name = "capitaine-cursors";
package = pkgs.capitaine-cursors;
x11.enable = true;
gtk.enable = true;
};
2022-06-13 22:21:47 -03:00
gtk = {
enable = true;
theme = {
name = "Orchis-Red-Dark-Compact";
package = orchis_theme_compact;
};
iconTheme = {
name = "Papirus-Dark";
2022-07-16 02:12:18 -03:00
package = papirus_red;
2022-06-13 22:21:47 -03:00
};
};
2022-07-19 22:05:48 -03:00
qt = {
enable = true;
platformTheme = "gtk";
style.package = pkgs.libsForQt5.qtstyleplugins;
style.name = "gtk2";
};
2022-07-21 00:29:12 -03:00
2022-07-20 00:14:01 -03:00
programs.mangohud.enable = true;
2022-07-20 20:07:58 -03:00
systemd.user.services = {
firefox = {
Unit = {
Description = "Firefox Web browser";
Documentation = "https://github.com/Alexays/Waybar/wiki";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
2022-08-02 21:17:03 -03:00
ExecStart = "${pkgs.firefox}/bin/firefox";
2022-07-20 20:07:58 -03:00
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
discord = {
Unit = {
Description = "Discord Internet voice chat";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
2022-08-02 21:17:03 -03:00
ExecStart = "/usr/bin/env flatpak run io.github.spacingbat3.webcord";
2022-07-20 20:07:58 -03:00
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
telegram = {
Unit = {
Description = "Telegram Internet chat";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.tdesktop}/bin/telegram-desktop";
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
2022-08-02 00:16:05 -03:00
mako = {
Unit = {
Description = "Notification daemon";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
Restart = "on-failure";
};
Install = { WantedBy = [ "sway-session.target" ]; };
};
2022-07-20 20:07:58 -03:00
};
2022-07-21 00:32:09 -03:00
}