nix/common/home-manager.nix

382 lines
11 KiB
Nix

{ config, pkgs, lib, ... }:
{
imports = [
<home-manager/nixos>
];
home-manager.users.sijmen = {
imports = [
./home-manager/home.nix
./home-manager/gtk.nix
];
nixpkgs.config.allowUnfree = true;
home.stateVersion = config.system.stateVersion;
programs = {
bash = {
enable = true;
initExtra = ''
source ${pkgs.fetchurl {
url = "https://raw.githubusercontent.com/rupa/z/b82ac78a2d4457d2ca09973332638f123f065fd1/z.sh";
sha256 = "98e4438cd31afb3ce594130335e7fbd8be5d75d9a53e4f3e084d97e6b8d19b0e";
}}
# SSH agent
eval $(${pkgs.openssh}/bin/ssh-agent) > /dev/null
trap 'test -n "$SSH_AUTH_SOCK" && eval $(${pkgs.openssh}/bin/ssh-agent -k)' 0
'';
sessionVariables = {
PYTHON_KEYRING_BACKEND = "keyring.backends.null.Keyring";
};
};
firefox = {
enable = true;
package = pkgs.firefox-wayland;
};
ncmpcpp = {
enable = true;
settings = {
colors_enabled = false;
};
};
foot = {
enable = true;
settings = {
main = {
term = "xterm-256color";
font = "Iosevka:size=12";
};
colors = {
background = "fafafa";
foreground = "383a42";
regular0 = "383a42";
regular1 = "e45649";
regular2 = "50a14f";
regular3 = "c18401";
regular4 = "0184bc";
regular5 = "a626a4";
regular6 = "0997b3";
regular7 = "fafafa";
bright0 = "383a42";
bright1 = "e45649";
bright2 = "50a14f";
bright3 = "c18401";
bright4 = "0184bc";
bright5 = "a626a4";
bright6 = "0997b3";
bright7 = "fafafa";
};
};
};
git = {
enable = true;
lfs.enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "Sijmen";
userEmail = "me@sijman.nl";
signing = {
signByDefault = true;
key = "0xDAF7821E067D9C48";
};
extraConfig = {
fetch.prune = true;
init.defaultBranch = "main";
pull.rebase = true;
push.autoSetupRemote = true;
safe.directory = [ "/etc/nixos" ];
};
};
mpv = {
enable = true;
config = {
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
};
};
neovim = {
enable = true;
vimAlias = true;
extraConfig = ''
luafile /etc/nixos/common/nvim.lua
'';
extraPackages = with pkgs; [
gcc
rnix-lsp
nodePackages.pyright
];
plugins = with pkgs.vimPlugins; [
bufferline-nvim
cmp-nvim-lsp
cmp_luasnip
ctrlp-vim
galaxyline-nvim
indentLine
leap-nvim
lualine-nvim
luasnip
neorg
nvim-cmp
nvim-colorizer-lua
nvim-lspconfig
nvim-tree-lua
nvim-treesitter.withAllGrammars
nvim-web-devicons
onehalf
pears-nvim
plenary-nvim
vim-closetag
vim-nix
vim-startify
vim-startuptime
];
};
tmux = {
enable = true;
prefix = "C-a";
extraConfig = ''
set -g mouse on
set-option -g set-titles on
set-option -g set-titles-string "#W"
'';
};
yt-dlp = {
enable = true;
settings = {
sponsorblock-mark = "sponsor,selfpromo,intro,outro,poi_highlight";
};
};
waybar = {
enable = true;
};
beets = {
enable = true;
settings = {
paths.default = "$albumartist/$year - $album%aunique{}/$track $title";
};
};
ssh = {
enable = true;
matchBlocks = {
# Home
"rpi" = {
user = "root";
hostname = "cloud.sijmenschoon.nl";
};
"desktop" = {
user = "vijfhoek";
hostname = "192.168.1.99";
proxyJump = "cloud.sijmenschoon.nl";
};
"nas" = {
user = "sijmen";
hostname = "192.168.1.123";
proxyJump = "cloud.sijmenschoon.nl";
};
# Servers
"hermes" = {
user = "ubuntu";
hostname = "hermes.sijmenschoon.nl";
};
# Scintilla
"linscin" = {
user = "sijmens";
hostname = "linscin.scintilla.utwente.nl";
};
"britt" = {
user = "sijmens";
hostname = "britt.scintilla.utwente.nl";
proxyJump = "linscin";
};
"*.scintilla.utwente.nl" = {
user = "sijmens";
};
"*.scintilla.nl" = {
user = "sijmens";
};
# Uni
"xoc2" = {
user = "s2639149";
hostname = "xoc2.ewi.utwente.nl";
proxyJump = "sijmens@linscin.scintilla.utwente.nl";
};
"noc2" = {
user = "s2639149";
hostname = "noc2.ewi.utwente.nl";
proxyJump = "sijmens@linscin.scintilla.utwente.nl";
};
"hidde" = {
user = "hidde";
hostname = "84.245.15.16";
};
};
extraConfig = ''
AddKeysToAgent 15m
'';
};
alot.enable = true;
chromium.enable = true;
gpg.enable = true;
home-manager.enable = true;
mbsync.enable = true;
msmtp.enable = true;
password-store.enable = true;
};
wayland.windowManager.sway = {
enable = true;
config = let
scintillaDellOutput = { pos = "0 0"; };
scintillaHpOutput = { pos = "0 120"; };
in rec {
modifier = "Mod4";
terminal = "foot";
fonts = {
names = [ "Ubuntu" ];
style = "Regular";
size = 11.0;
};
input = {
"type:touchpad" = {
natural_scroll = "enabled";
dwt = "disabled";
click_method = "clickfinger";
};
"type:keyboard" = {
xkb_layout = "us,kr";
xkb_options = "grp:alt_caps_toggle";
};
"type:mouse" = {
accel_profile = "flat";
};
};
output = {
"*" = {
bg = "~/Pictures/berg.jpg fill";
subpixel = "none";
};
"Unknown 0x095F 0x00000000" = { pos = "92 1200"; scale = "1.3"; }; # framework
"Dell Inc. DELL U2410 F525M13318GL" = scintillaDellOutput; # bibi
"Dell Inc. DELL U2410 F525M12P08RL" = scintillaDellOutput; # fabienne
"Hewlett Packard HP E222 CNK6110ZM2" = scintillaHpOutput; # floortje
"Hewlett Packard HP E222 CNK6110ZM7" = scintillaHpOutput;
"Hewlett Packard HP E222 CNK6110ZMF" = scintillaHpOutput; # tamara
"Hewlett Packard HP E222 CNK6110ZR8" = scintillaHpOutput; # megan
"Hewlett Packard HP E222 CNK611104P" = scintillaHpOutput; # charissa
"Hewlett Packard HP E222 CNK611104X" = scintillaHpOutput;
"Hewlett Packard HP E222 CNK6111052" = scintillaHpOutput; # ilona
"Goldstar Company Ltd LG Ultra HD 0x00008520" = { mode = "2560x1440@60Hz"; }; # thuis rechts
"Dell Inc. DELL S2722DGM 3P84Z83" = { mode = "2560x1440@144Hz"; }; # thuis links (hdmi)
};
keybindings = lib.mkOptionDefault {
XF86MonBrightnessDown = "exec ${pkgs.light}/bin/light -U 5";
XF86MonBrightnessUp = "exec ${pkgs.light}/bin/light -A 5";
"shift+XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 1";
"shift+XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 1";
XF86AudioRaiseVolume = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%'";
XF86AudioLowerVolume = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%'";
XF86AudioMute = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle'";
Print = "exec '${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | wl-copy -t image/png'";
"${modifier}+alt+l" = "exec '${pkgs.swaylock}/bin/swaylock -c 000000 -i eDP-1:Pictures/vista32.jpg'";
"${modifier}+ctrl+Return" = "exec '${pkgs.gnome.nautilus}/bin/nautilus'";
"${modifier}+ctrl+Down" = "move workspace to down";
"${modifier}+ctrl+Up" = "move workspace to up";
"${modifier}+ctrl+Left" = "move workspace to left";
"${modifier}+ctrl+Right" = "move workspace to right";
"${modifier}+ctrl+j" = "move workspace to down";
"${modifier}+ctrl+k" = "move workspace to up";
"${modifier}+ctrl+h" = "move workspace to left";
"${modifier}+ctrl+l" = "move workspace to right";
"${modifier}+ctrl+f" = "exec '${pkgs.python3}/bin/python /etc/nixos/common/sway/next_free.py | xargs swaymsg -- workspace number'";
"${modifier}+comma" = "workspace prev_on_output";
"${modifier}+period" = "workspace next_on_output";
};
};
};
services = {
gpg-agent = {
enable = true;
pinentryFlavor = "qt";
};
gnome-keyring = {
enable = true;
components = ["secrets" "ssh"];
};
mpd = {
enable = true;
musicDirectory = "/home/sijmen/Music";
};
mako = {
enable = true;
font = "Ubuntu 11";
defaultTimeout = 5000;
groupBy = "app-name,summary";
};
};
accounts.email.accounts.Personal = {
primary = true;
address = "me@sijmenschoon.nl";
aliases = [ "me@sijman.nl" "me@vijf.life" "info@sijmenschoon.nl" ];
realName = "Sijmen Schoon";
userName = "me@sijmenschoon.nl";
passwordCommand = "pass show email/personal";
imap.host = "imap.soverin.net";
smtp.host = "smtp.soverin.net";
folders.inbox = "INBOX";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
};
accounts.email.accounts.Scintilla = {
primary = false;
address = "sijmens@scintilla.utwente.nl";
aliases = [ "sschoon@scintilla.utwente.nl" ];
realName = "Sijmen Schoon";
userName = "sijmens";
passwordCommand = "pass show email/scintilla";
folders.inbox = "INBOX";
};
};
}