2022-09-09 01:04:25 +01:00
|
|
|
{ lib, pkgs, config, ... }:
|
|
|
|
let
|
2023-08-22 12:41:23 +01:00
|
|
|
inherit (lib) genAttrs mkIf mkMerge mkForce;
|
2022-09-09 01:04:25 +01:00
|
|
|
inherit (lib.my) mkBoolOpt';
|
|
|
|
|
|
|
|
cfg = config.my.gui;
|
2023-09-20 15:01:04 +01:00
|
|
|
|
|
|
|
font = {
|
|
|
|
package = pkgs.monocraft;
|
|
|
|
name = "Monocraft";
|
|
|
|
size = 10;
|
|
|
|
};
|
2022-09-09 01:04:25 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.gui = {
|
|
|
|
enable = mkBoolOpt' true "Enable settings and packages meant for graphical systems";
|
2023-08-22 11:50:14 +01:00
|
|
|
manageGraphical = mkBoolOpt' false "Configure the graphical session";
|
2022-09-09 01:04:25 +01:00
|
|
|
standalone = mkBoolOpt' false "Enable settings for fully Nix managed systems";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
{
|
|
|
|
home = {
|
|
|
|
packages = with pkgs; [
|
2023-09-20 15:01:04 +01:00
|
|
|
font.package
|
2022-09-09 01:04:25 +01:00
|
|
|
(nerdfonts.override {
|
|
|
|
fonts = [ "DroidSansMono" "SourceCodePro" ];
|
|
|
|
})
|
2023-02-11 17:52:31 +00:00
|
|
|
noto-fonts-emoji
|
|
|
|
|
2023-08-22 15:01:16 +01:00
|
|
|
grim
|
|
|
|
slurp
|
|
|
|
swappy
|
|
|
|
|
2023-02-11 17:52:31 +00:00
|
|
|
python310Packages.python-lsp-server
|
|
|
|
nil # nix language server
|
2023-02-18 23:51:40 +00:00
|
|
|
zls # zig language server
|
2023-09-24 11:17:28 +01:00
|
|
|
rust-analyzer
|
2023-04-23 23:44:55 +01:00
|
|
|
neofetch
|
2022-09-09 01:04:25 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
2022-09-14 11:53:28 +01:00
|
|
|
gh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
git_protocol = "ssh";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-09 01:04:25 +01:00
|
|
|
alacritty = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2023-09-20 15:01:04 +01:00
|
|
|
font.normal.family = font.name;
|
2022-09-09 01:04:25 +01:00
|
|
|
};
|
|
|
|
};
|
2023-02-11 17:52:31 +00:00
|
|
|
|
|
|
|
kitty = {
|
|
|
|
enable = true;
|
2023-09-20 15:01:04 +01:00
|
|
|
inherit font;
|
2023-02-11 17:52:31 +00:00
|
|
|
settings = {
|
|
|
|
background_opacity = "0.8";
|
|
|
|
tab_bar_edge = "top";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
helix = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
keys = {
|
|
|
|
normal = {
|
|
|
|
"^" = "goto_first_nonwhitespace";
|
|
|
|
"$" = "goto_line_end";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
editor = {
|
|
|
|
whitespace = {
|
|
|
|
render.newline = "all";
|
|
|
|
};
|
|
|
|
indent-guides = {
|
|
|
|
render = true;
|
|
|
|
character = "┊";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-09-09 01:04:25 +01:00
|
|
|
};
|
|
|
|
}
|
2023-08-22 11:50:14 +01:00
|
|
|
|
|
|
|
(mkIf (cfg.manageGraphical && !pkgs.stdenv.isDarwin) {
|
2022-09-09 14:11:48 +01:00
|
|
|
systemd.user = {
|
|
|
|
services = {
|
|
|
|
wait-for-sway = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Wait for sway to be ready";
|
|
|
|
Before = "graphical-session.target";
|
|
|
|
};
|
|
|
|
Service = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = toString (pkgs.writeShellScript "wait-for-sway.sh" ''
|
|
|
|
until ${pkgs.sway}/bin/swaymsg -t get_version -q; do
|
|
|
|
${pkgs.coreutils}/bin/sleep 0.1
|
|
|
|
done
|
|
|
|
${pkgs.coreutils}/bin/sleep 0.5
|
|
|
|
'');
|
|
|
|
RemainAfterExit = true;
|
|
|
|
};
|
|
|
|
Install.RequiredBy = [ "sway-session.target" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-09 01:04:25 +01:00
|
|
|
home = {
|
2022-09-09 19:20:01 +01:00
|
|
|
packages = with pkgs; [
|
|
|
|
wtype
|
|
|
|
wl-clipboard
|
2023-02-12 15:20:19 +00:00
|
|
|
wev
|
2023-02-13 19:43:18 +00:00
|
|
|
wdisplays
|
|
|
|
|
2022-09-13 14:15:20 +01:00
|
|
|
pavucontrol
|
2023-02-12 15:20:19 +00:00
|
|
|
libsecret
|
2023-02-13 19:41:21 +00:00
|
|
|
|
2023-02-12 15:20:19 +00:00
|
|
|
playerctl
|
2023-02-13 19:41:21 +00:00
|
|
|
spotify
|
2022-09-09 19:20:01 +01:00
|
|
|
];
|
|
|
|
|
2022-09-09 01:04:25 +01:00
|
|
|
pointerCursor = {
|
|
|
|
package = pkgs.vanilla-dmz;
|
|
|
|
name = "Vanilla-DMZ";
|
2022-09-09 19:58:25 +01:00
|
|
|
size = 16;
|
2022-09-09 01:04:25 +01:00
|
|
|
gtk.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts.fontconfig.enable = true;
|
|
|
|
|
2022-09-09 19:35:29 +01:00
|
|
|
xsession.preferStatusNotifierItems = true;
|
2022-09-09 01:04:25 +01:00
|
|
|
wayland = {
|
|
|
|
windowManager = {
|
|
|
|
sway = {
|
|
|
|
enable = true;
|
|
|
|
xwayland = true;
|
|
|
|
config = {
|
|
|
|
input = {
|
|
|
|
"type:touchpad" = {
|
|
|
|
tap = "enabled";
|
|
|
|
natural_scroll = "enable";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
output = {
|
|
|
|
"*".bg = "${./stop-nixos.png} stretch";
|
|
|
|
};
|
2023-04-23 13:00:30 +01:00
|
|
|
window.titlebar = false;
|
2022-09-09 01:04:25 +01:00
|
|
|
|
|
|
|
modifier = "Mod4";
|
2023-02-11 17:52:31 +00:00
|
|
|
terminal = "kitty";
|
2022-09-09 01:04:25 +01:00
|
|
|
keybindings =
|
|
|
|
let
|
|
|
|
cfg = config.wayland.windowManager.sway.config;
|
|
|
|
mod = cfg.modifier;
|
|
|
|
in
|
|
|
|
lib.mkOptionDefault {
|
|
|
|
"${mod}+d" = null;
|
2023-08-22 23:45:16 +01:00
|
|
|
"${mod}+l" = "exec swaylock -i ${./lock.png} -s stretch";
|
2022-09-09 01:04:25 +01:00
|
|
|
"${mod}+x" = "exec ${cfg.menu}";
|
2023-08-22 12:09:40 +01:00
|
|
|
"${mod}+Shift+x" = "exec rofi -show drun";
|
2022-09-09 01:04:25 +01:00
|
|
|
"${mod}+q" = "kill";
|
2022-09-09 14:11:48 +01:00
|
|
|
"${mod}+Shift+q" = "exec swaynag -t warning -m 'bruh you really wanna kill sway?' -b 'ye' 'systemctl --user stop graphical-session.target && swaymsg exit'";
|
2023-08-22 15:01:16 +01:00
|
|
|
# "${mod}+Shift+s" = "exec flameshot gui";
|
|
|
|
"${mod}+Shift+s" = ''exec grim -g "$(slurp)" - | swappy -f -'';
|
2022-09-09 19:20:01 +01:00
|
|
|
"${mod}+Shift+e" = "exec rofi -show emoji";
|
|
|
|
# Config for this doesn't seem to work :/
|
|
|
|
"${mod}+c" = ''exec rofi -show calc -calc-command "echo -n '{result}' | ${pkgs.wl-clipboard}/bin/wl-copy"'';
|
2023-02-11 17:52:31 +00:00
|
|
|
|
|
|
|
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
|
|
|
|
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
|
2023-08-27 22:14:12 +01:00
|
|
|
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play";
|
|
|
|
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl pause";
|
2023-02-12 15:20:19 +00:00
|
|
|
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
|
|
|
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
2022-09-09 01:04:25 +01:00
|
|
|
};
|
2023-08-27 22:14:12 +01:00
|
|
|
keycodebindings = {
|
|
|
|
# keycode for XF86AudioPlayPause (no sym for some reason)
|
|
|
|
"172" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
};
|
2022-09-09 01:04:25 +01:00
|
|
|
|
|
|
|
menu = "rofi -show run";
|
|
|
|
bars = mkForce [ ];
|
|
|
|
};
|
|
|
|
|
|
|
|
swaynag = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-09 19:44:09 +01:00
|
|
|
gtk = {
|
|
|
|
enable = true;
|
|
|
|
theme = {
|
|
|
|
name = "Numix";
|
|
|
|
package = pkgs.numix-gtk-theme;
|
|
|
|
};
|
|
|
|
iconTheme = {
|
|
|
|
name = "Numix";
|
|
|
|
package = pkgs.numix-icon-theme;
|
|
|
|
};
|
2023-09-20 15:01:04 +01:00
|
|
|
font.name = font.name;
|
2022-09-09 19:44:09 +01:00
|
|
|
};
|
|
|
|
qt = {
|
|
|
|
enable = true;
|
|
|
|
platformTheme = "gtk";
|
|
|
|
};
|
|
|
|
|
2022-09-09 18:57:14 +01:00
|
|
|
services = {
|
2023-02-12 15:20:19 +00:00
|
|
|
swaync = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
widgets = [ "title" "dnd" "mpris" "notifications" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-09 18:57:14 +01:00
|
|
|
flameshot = {
|
2023-08-22 15:01:16 +01:00
|
|
|
enable = false;
|
2022-09-09 18:57:14 +01:00
|
|
|
settings = {
|
|
|
|
General = {
|
|
|
|
disabledTrayIcon = true;
|
|
|
|
savePath = "/tmp/screenshots";
|
|
|
|
savePathFixed = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-12 15:20:19 +00:00
|
|
|
|
|
|
|
playerctld.enable = true;
|
|
|
|
spotifyd = {
|
2023-02-13 19:41:21 +00:00
|
|
|
enable = false;
|
2023-02-12 15:20:19 +00:00
|
|
|
package = pkgs.spotifyd.override {
|
|
|
|
withMpris = true;
|
|
|
|
withKeyring = true;
|
|
|
|
};
|
|
|
|
settings.global = {
|
|
|
|
username = "devplayer0";
|
|
|
|
use_keyring = true;
|
|
|
|
use_mpris = true;
|
|
|
|
backend = "pulseaudio";
|
|
|
|
bitrate = 320;
|
|
|
|
device_type = "computer";
|
|
|
|
};
|
|
|
|
};
|
2022-09-09 18:57:14 +01:00
|
|
|
};
|
|
|
|
|
2022-09-09 01:04:25 +01:00
|
|
|
programs = {
|
|
|
|
git = {
|
|
|
|
enable = true;
|
|
|
|
diff-so-fancy.enable = true;
|
|
|
|
userEmail = "jackos1998@gmail.com";
|
|
|
|
userName = "Jack O'Sullivan";
|
2022-10-06 11:55:14 +01:00
|
|
|
extraConfig = {
|
|
|
|
pull.rebase = true;
|
|
|
|
};
|
2022-09-09 01:04:25 +01:00
|
|
|
};
|
|
|
|
|
2023-09-20 15:01:04 +01:00
|
|
|
waybar = import ./waybar.nix { inherit lib pkgs config font; };
|
2022-09-09 01:04:25 +01:00
|
|
|
rofi = {
|
|
|
|
enable = true;
|
2023-09-20 15:01:04 +01:00
|
|
|
font = "${font.name} ${toString font.size}";
|
2022-09-09 01:04:25 +01:00
|
|
|
plugins = with pkgs; [
|
|
|
|
rofi-calc
|
|
|
|
rofi-emoji
|
|
|
|
];
|
|
|
|
extraConfig = {
|
|
|
|
modes = "window,run,ssh,filebrowser,calc,emoji";
|
2022-09-09 19:20:01 +01:00
|
|
|
emoji-mode = "copy";
|
2022-09-09 01:04:25 +01:00
|
|
|
};
|
|
|
|
};
|
2023-08-27 20:04:53 +01:00
|
|
|
swaylock = {
|
|
|
|
enable = true;
|
|
|
|
# need to use system swaylock for PAM reasons
|
|
|
|
package = pkgs.runCommandWith { name = "swaylock-dummy"; } ''mkdir $out'';
|
|
|
|
};
|
2022-09-09 01:04:25 +01:00
|
|
|
|
|
|
|
chromium = {
|
|
|
|
enable = true;
|
|
|
|
package = (pkgs.chromium.override { enableWideVine = true; }).overrideAttrs (old: {
|
|
|
|
buildCommand = ''
|
|
|
|
${old.buildCommand}
|
|
|
|
|
|
|
|
# Re-activate Google sync
|
|
|
|
wrapProgram "$out"/bin/chromium \
|
|
|
|
--set NIXOS_OZONE_WL 1 \
|
|
|
|
--set GOOGLE_DEFAULT_CLIENT_ID "77185425430.apps.googleusercontent.com" \
|
|
|
|
--set GOOGLE_DEFAULT_CLIENT_SECRET "OTJgUOQcT7lO7GsGZq2G4IlT"
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
2023-08-22 12:41:23 +01:00
|
|
|
|
|
|
|
xdg = {
|
|
|
|
mimeApps = {
|
|
|
|
enable = true;
|
|
|
|
defaultApplications = genAttrs [
|
|
|
|
"text/html"
|
|
|
|
"x-scheme-handler/http"
|
|
|
|
"x-scheme-handler/https"
|
|
|
|
"x-scheme-handler/about"
|
|
|
|
"x-scheme-handler/unknown"
|
|
|
|
] (_: "chromium-browser.desktop");
|
|
|
|
};
|
|
|
|
};
|
2022-09-09 01:04:25 +01:00
|
|
|
})
|
2023-08-22 11:50:14 +01:00
|
|
|
|
|
|
|
(mkIf (cfg.standalone && !pkgs.stdenv.isDarwin) {
|
|
|
|
xdg = {
|
|
|
|
userDirs = {
|
|
|
|
enable = true;
|
|
|
|
createDirectories = true;
|
|
|
|
desktop = "$HOME/desktop";
|
|
|
|
documents = "$HOME/documents";
|
|
|
|
download = "$HOME/downloads";
|
|
|
|
music = "$HOME/music";
|
|
|
|
pictures = "$HOME/pictures";
|
|
|
|
publicShare = "$HOME/public";
|
|
|
|
templates = "$HOME/templates";
|
|
|
|
videos = "$HOME/videos";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
2022-09-09 01:04:25 +01:00
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|