nix-infra/common/fragments/graphical/default.nix

304 lines
7.6 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.

{ pkgs, config, lib, ... }: {
imports = [
./bspwm.nix
./picom.nix
./audio.nix
./polybar.nix
./dunst.nix
./rofi.nix
./iosevka.nix
./kitty.nix
./element.nix
./url-eater.nix
./spotify.nix
];
nixpkgs.overlays = [
(final: prev: {
pads = final.callPackage ../../../common/pkgs/pads.nix { };
bspm = final.callPackage ../../../common/pkgs/bspm.nix { };
polybar-spotify =
final.callPackage ../../../common/pkgs/polybar-spotify.nix { };
element-desktop =
prev.element-desktop.override { electron = prev.electron_24; };
})
];
# User packages
users.users.agatha.packages = with pkgs; [
blueberry
brightnessctl
broot
bspm
clipmenu
colmena
element-desktop
ffmpeg
flameshot
gimp
glib
gnome.eog
gnome.file-roller
gnome.gnome-calendar
gnome.gnome-control-center
gnome.gnome-disk-utility
gnome.gnome-font-viewer
gnome.nautilus
gnome.totem
hyperfine
lxappearance
magic-wormhole
neofetch
nil
nitrogen
nmap
obs-studio
obsidian
pfetch
polybar-spotify
pridefetch
prismlauncher
rofi-calc
rofimoji
speechd
tdesktop
wireguard-tools
xdg-utils
xdotool
yubioath-flutter
];
# Brightness/volume keys
users.users.agatha.extraGroups = [ "video" ];
location = {
latitude = 49.0;
longitude = 8.4;
};
services.redshift = {
enable = true;
brightness.night = "0.8";
};
services.xserver = {
enable = true;
displayManager = {
gdm.enable = true;
# gdm.wayland = true;
sessionPackages = [ pkgs.sway ];
session = [{
manage = "window";
name = "bspwm";
start = let cfg = config.home-manager.users.agatha;
in ''
${cfg.services.sxhkd.package}/bin/sxhkd ${
toString cfg.services.sxhkd.extraOptions
} &
${cfg.xsession.windowManager.bspwm.package}/bin/bspwm -c ${cfg.xdg.configHome}/bspwm/bspwmrc
'';
}];
};
# Layout overrides
layout = lib.mkForce "eu,de(qwerty),ua,ru";
xkbOptions = "ctrl:nocaps,compose:rctrl";
libinput.enable = true;
};
home-manager.users.agatha = {
# Compose key sequences
home.file.".XCompose".text = ''
include "%L"
<Multi_key> <l> <f> : "( ͡° ͜ʖ ͡°)"
<Multi_key> <s> <f> : "¯\\_()_/¯"
<Multi_key> <g> <f> : " _ "
<Multi_key> <B> <B> : "🅱"
<Multi_key> <o> <asterisk> : ""
<Multi_key> <h> <r> : ""
<Multi_key> <v> <v> : ""
<Multi_key> <v> <period> <v> : ""
<Multi_key> <space> <space> : ""
<Multi_key> <s> <0> : "§"
<Multi_key> <b><l> : ""
<Multi_key> <h><s> : ""
<Multi_key> <s><r> : ""
<Multi_key> <t><r> : " trans rights uwu"
<Multi_key> <w><apostrophe> : "òwó"
<Multi_key> <W><apostrophe> : "ÒwÓ"
<Multi_key> <p><t> : "👉👈"
<Multi_key> <p><l> : "🥺"
<Multi_key> <m><s> : "/html <span data-mx-spoiler=\"\"></span>"
'';
# Cursor theme
home.pointerCursor = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = 24;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
};
# Lockscreen
services.betterlockscreen = {
enable = true;
arguments = [ "dimblur" ];
};
# Update lockscreen wallpaper after locking
xdg.configFile."betterlockscreen/custom-post.sh".text =
"betterlockscreen -u ${
config.environment.graphical.colorschemes."${config.environment.graphical.theme.name}".image
}";
# Send a notification 10 seconds before locking
services.screen-locker.xautolock.extraOptions = [
"-notify 10"
"-notifier '${pkgs.dunst}/bin/dunstify -t 10000 -u 2 \"Screen will lock in 10 seconds\"'"
];
# GTK theme
home.file.".themes" = {
recursive = true;
source = pkgs.fetchgit {
url = "https://github.com/ZorinOS/zorin-desktop-themes.git";
rev = "6708d5148545c6d9a99712f63b5efe5a5c0eb2d9";
sha256 = "sha256-3KEPP39dCr0ZjyqbAb/isoGdeiySDTvHL9k4oxcw19M=";
sparseCheckout = [ "ZorinPurple-Dark" "ZorinPurple-Light" ];
};
};
gtk = {
enable = true;
font.name = "Cantarell";
font.size = 12;
theme.name = if config.environment.graphical.theme.light then
"ZorinPurple-Light"
else
"ZorinPurple-Dark";
};
programs.helix.settings.theme =
if config.environment.graphical.theme.light then
"paramount-light"
else
"paramount-dark";
programs.direnv.enable = true;
home.sessionVariables = { "DIRENV_LOG_FORMAT" = ""; };
programs.ssh.enable = true;
programs.ssh.matchBlocks = {
"bloodletting" = { hostname = "technogothic.net"; };
"backups" = {
match = ''originalhost backups exec "ip r | rg 10.42.0.0/24"'';
hostname = "10.20.1.2";
user = "agatha";
identityFile = [ "~/.ssh/id_ed25519" ];
};
"work" = {
match = ''originalhost work exec "ip r | rg 10.42.0.0/24"'';
hostname = "10.42.0.222";
forwardX11 = true;
forwardX11Trusted = true;
forwardAgent = true;
remoteForwards = [{
bind.address = "/run/user/1000/gnupg/S.gpg-agent";
host.address = "/run/user/1000/gnupg/S.gpg-agent.extra";
}];
extraOptions."TCPKeepAlive" = "yes";
};
"ritual" = {
match = ''originalhost ritual exec "ip r | rg 10.42.0.0/24"'';
hostname = "10.42.0.104";
};
};
xdg.desktopEntries.element-work = {
name = "Element @ Work";
icon = "im.riot.Riot";
exec = "${pkgs.element-desktop}/bin/element-desktop --profile=work";
categories = [ "Network" "InstantMessaging" "Chat" "VideoConference" ];
mimeType = [ "x-scheme-handler/element" ];
settings.StartupWMClass = "element";
settings.Keywords =
"Matrix;matrix.org;chat;irc;communications;talk;riot;vector;";
};
};
environment.graphical.colorschemes = {
purple = {
image = ../../../external/the_reliquary.png;
params = [ "--lighten" "0.05" "--bold-delta" "0.1" ];
};
purple-light = {
image = ../../../external/the_reliquary.png;
params = [ "--light" "--bold-delta" "0.2" "--saturate" "0.1" ];
};
blue = { image = ../../../external/blue.jpg; };
dark = { image = ../../../external/the_falls_by_night.jpg; };
};
environment.graphical.theme.name = "dark";
services.gvfs.enable = true;
security.polkit.enable = true;
programs.dconf.enable = true;
programs.geary.enable = true;
programs.steam.enable = true;
programs.firefox = {
enable = true;
autoConfig = ''
pref("privacy.webrtc.legacyGlobalIndicator", false);
pref("privacy.webrtc.hideGlobalIndicator", true);
'';
};
# Screenshare on wlroots
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
wlr.enable = true;
};
};
fonts.fontconfig.enable = true;
fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "DaddyTimeMono" "NerdFontsSymbolsOnly" ]; })
cantarell-fonts
cm_unicode
corefonts
crimson
dejavu_fonts
fira-code
fira-code-symbols
font-awesome_5
iosevka
noto-fonts-cjk
siji
twitter-color-emoji
];
services.printing = {
enable = true;
drivers = [ pkgs.hplip ];
};
# Fix Wireguard NetworkManager connections
networking.firewall.checkReversePath = "loose";
}