Compare commits

...

22 Commits

Author SHA1 Message Date
Nathan McCarty 67bf01f74a
Make alacritty background transparent 2023-06-16 23:50:43 -04:00
Nathan McCarty 7874797f87
gamescope window rules 2023-06-16 23:29:53 -04:00
Nathan McCarty f629025368
Fix swayidle 2023-06-16 23:18:21 -04:00
Nathan McCarty 1cd915d53b
Revert "Refactor out some configs"
This reverts commit d48370536f.
2023-06-16 23:15:25 -04:00
Nathan McCarty ae1c933dc2
Setup swaynotificationcenter 2023-06-16 23:05:53 -04:00
Nathan McCarty d48370536f
Refactor out some configs 2023-06-16 22:54:29 -04:00
Nathan McCarty 8b65defd6c
Rename hyprland files 2023-06-16 22:46:15 -04:00
Nathan McCarty 89354f8032
Use gamescope from git 2023-06-16 22:27:44 -04:00
Nathan McCarty 08884cf6e2
Setup screenshots in hyprland 2023-06-16 21:29:47 -04:00
Nathan McCarty 5735e28243
Add file 2023-06-16 21:02:52 -04:00
Nathan McCarty 3cd8e9776a
Fix wayland envvars 2023-06-16 20:58:52 -04:00
Nathan McCarty e6ba10685c
Fix hyprland version 2023-06-16 20:57:07 -04:00
Nathan McCarty 787094af1e
Selenized dark fuzzel 2023-06-16 20:27:37 -04:00
Nathan McCarty a904fdfb1f
Clipboard history 2023-06-16 20:20:58 -04:00
Nathan McCarty 74b502737c
Wayland forcing env vars 2023-06-16 20:20:31 -04:00
Nathan McCarty f018b1b916
Amdgpu early on levitation 2023-06-16 20:19:55 -04:00
Nathan McCarty 94519e0faa
Update hyprland 2023-06-16 20:19:37 -04:00
Nathan McCarty 839073b63c
Disable xwayland hidpi patches 2023-06-16 20:19:21 -04:00
Nathan McCarty 83f16029e3
Disable 10bit output for now 2023-06-16 20:16:56 -04:00
Nathan McCarty 15bb2763ef
Remove manual xdg-portal tweaking 2023-06-16 19:19:58 -04:00
Nathan McCarty 42eade00a8
Swayosd 2023-06-16 19:06:13 -04:00
Nathan McCarty 9c9c9132d6
Remove sway config 2023-06-16 18:57:46 -04:00
14 changed files with 300 additions and 259 deletions

130
configs/hyprland.conf Normal file
View File

@ -0,0 +1,130 @@
# Set environment variables to force wayland
env = XCURSOR_SIZE,24
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 10
border_size = 3
col.active_border = rgba(3fc5b7ee) rgba(70b433ee) 45deg
col.inactive_border = rgba(252525aa)
layout = dwindle
}
decoration {
rounding = 10
blur = true
blur_size = 3
blur_passes = 1
blur_new_optimizations = true
drop_shadow = true
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(181818ee)
}
animations {
enabled = true;
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # you probably want this
}
gestures {
workspace_swipe = false
}
$mainMod = SUPER
bind = $mainMod, Q, exec, alacritty
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, dolphin
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, ${fuzzel-command}
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, B, togglesplit, # dwindle
bind = $mainMod, Z, exec, ${swaylock-command}
# Move focus with mainMod + arrow keys
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Media key binds
bind = , xf86audioraisevolume, exec, swayosd --output-volume=raise
bind = SHIFT, xf86audioraisevolume, exec, swayosd --output-volume=+2
bind = , xf86audiolowervolume, exec, swayosd --output-volume=lower
bind = SHIFT, xf86audiolowervolume, exec, swayosd --output-volume=-2
bind = , xf86audiomute, exec, swayosd --output-volume mute-toggle
# Screenshots
bind = , print, exec, grimblast copysave area ~/Pictures/Screenshots/$(date -Iseconds).png
bind = SHIFT, print, exec, grimblast copysave output ~/Pictures/Screenshots/$(date -Iseconds).png
# Caps lock indicator
bindr = CAPS, caps_lock, exec, swayosd --caps-lock
# Notif bind
bind = $mainMod, T, exec, swaync-client -t -sw
# systemd integration
exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && sleep 2 && systemctl --user start hyprland-session.target
# Clipboard history management
exec-once=wl-paste --watch cliphist store
bind = $mainMod, X, exec, cliphist list | ${fuzzel-command} --dmenu | cliphist decode | wl-copy

View File

@ -182,11 +182,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1686764691, "lastModified": 1686819210,
"narHash": "sha256-H4Pd2ny0euUNqYAQEi4ZQhbgUCBXarceOokNnjGcUSE=", "narHash": "sha256-mM+9CGiLOZ7qGMf1mw6xz3O1hxPmb/6PIaqJfm+GAec=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "c4dec4f79697cb789b585f8e4febf92e929b5291", "rev": "d768226de9281828c6346d7acff3ddc10b3e657f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -195,6 +195,24 @@
"type": "github" "type": "github"
} }
}, },
"hyprland-contrib": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1686925761,
"narHash": "sha256-H+i0VQvc2gx/QUCRNFoLZmHmCDITMQiF9zkDLj0pYCc=",
"owner": "hyprwm",
"repo": "contrib",
"rev": "fd07e8b82042c0d2ca0c492df2b8f4854573c7d0",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "contrib",
"type": "github"
}
},
"hyprland-protocols": { "hyprland-protocols": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -463,11 +481,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1686501370, "lastModified": 1686592866,
"narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=", "narHash": "sha256-riGg89eWhXJcPNrQGcSwTEEm7CGxWC06oSX44hajeMw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519", "rev": "0eeebd64de89e4163f4d3cf34ffe925a5cf67a05",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -478,6 +496,22 @@
} }
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": {
"lastModified": 1658161305,
"narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e4d49de45a3b5dbcb881656b4e3986e666141ea9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1686736559, "lastModified": 1686736559,
"narHash": "sha256-YyUSVoOKIDAscTx7IZhF9x3qgZ9dPNF19fKk+4c5irc=", "narHash": "sha256-YyUSVoOKIDAscTx7IZhF9x3qgZ9dPNF19fKk+4c5irc=",
@ -493,7 +527,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1667292599, "lastModified": 1667292599,
"narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=", "narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=",
@ -509,7 +543,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1667085676, "lastModified": 1667085676,
"narHash": "sha256-jPHYYoSdrV3ypWG4oi9SUeI2MU6dLjxM88+9io5Rrx0=", "narHash": "sha256-jPHYYoSdrV3ypWG4oi9SUeI2MU6dLjxM88+9io5Rrx0=",
@ -601,12 +635,13 @@
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-contrib": "hyprland-contrib",
"idris2": "idris2", "idris2": "idris2",
"java": "java", "java": "java",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"quilt-server": "quilt-server", "quilt-server": "quilt-server",
"scripts": "scripts", "scripts": "scripts",
@ -617,7 +652,7 @@
"scripts": { "scripts": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_5",
"swaywm-toggler": "swaywm-toggler" "swaywm-toggler": "swaywm-toggler"
}, },
"locked": { "locked": {
@ -659,7 +694,7 @@
"swaywm-toggler": { "swaywm-toggler": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1667366374, "lastModified": 1667366374,
@ -740,11 +775,11 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1686573751, "lastModified": 1686753331,
"narHash": "sha256-5vnFxEMvn4wzT+XKR5Jo8VSn1hXrdf/mWuTmdHhRFBs=", "narHash": "sha256-KovjVFwcuoUO0eu/UiWrnD3+m/K+SHSAVIz4xF9K1XA=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "6e8fb5509f2c94d09d4efa0f9b1f40b37bf73863", "rev": "7e7633abf09b362d0bad9e3fc650fd692369291d",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {

View File

@ -10,6 +10,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
hyprland-contrib.url = "github:hyprwm/contrib";
nix-on-droid = { nix-on-droid = {
url = "github:t184256/nix-on-droid"; url = "github:t184256/nix-on-droid";
inputs = { inputs = {

View File

@ -21,6 +21,8 @@ with lib; {
tealdeer tealdeer
# rsync for _The Cloud_ :tm: # rsync for _The Cloud_ :tm:
rclone rclone
# File
file
]; ];
# Configure tmux # Configure tmux
programs.tmux = { programs.tmux = {

View File

@ -25,6 +25,7 @@ in with lib; {
# Bigger on darwin # Bigger on darwin
size = if pkgs.stdenv.isLinux then 10.0 else 12.0; size = if pkgs.stdenv.isLinux then 10.0 else 12.0;
}; };
window = { opacity = 0.9; };
colors = { colors = {
primary = { primary = {
background = "0x181818"; background = "0x181818";
@ -50,6 +51,7 @@ in with lib; {
cyan = "0x3fc5b7"; cyan = "0x3fc5b7";
white = "0xdedede"; white = "0xdedede";
}; };
transparent_background_colors = true;
}; };
}; };
}; };

View File

@ -15,7 +15,7 @@ with nLib; {
../common/programs/git.nix ../common/programs/git.nix
../common/programs/ssh.nix ../common/programs/ssh.nix
../common/programs/fish.nix ../common/programs/fish.nix
./programs/sway.nix ./programs/hyprland.nix
./programs/communications.nix ./programs/communications.nix
./programs/devel.nix ./programs/devel.nix
./programs/emacs.nix ./programs/emacs.nix

View File

@ -7,9 +7,9 @@ in with lib; {
swaylock-command = '' swaylock-command = ''
${swaylock-package}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3''; ${swaylock-package}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3'';
fuzzel-command = '' fuzzel-command = ''
fuzzel -f "Iosevka Sans Quasi" -b "103c48ff" -S "adbcbcff" -s "184956ff" -t "72898fff" -B 5 -r 5 -C "ed8649ff" fuzzel -f "Iosevka Sans Quasi" -b "181818dd" -S "b9b9b9ff" -s "252525dd" -t "777777ff" -B 5 -r 5 -C "70b433dd"'';
''; notif-package =
wob-package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.wob; inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.swaynotificationcenter;
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
# Locking and display management # Locking and display management
@ -18,9 +18,9 @@ in with lib; {
swayidle swayidle
# Clipboard # Clipboard
wl-clipboard wl-clipboard
wl-clipboard-x11 cliphist
# Notifications # Notifications
mako notif-package
# Terminal # Terminal
alacritty alacritty
# glib for sound stuff # glib for sound stuff
@ -36,7 +36,9 @@ in with lib; {
}; };
})) }))
# Screenshots # Screenshots
sway-contrib.grimshot (inputs.hyprland-contrib.packages.${pkgs.system}.grimblast.override {
hyprland = config.wayland.windowManager.hyprland.package;
})
# fuzzel for launcher # fuzzel for launcher
fuzzel fuzzel
# for image viewing # for image viewing
@ -49,8 +51,8 @@ in with lib; {
libreoffice-fresh libreoffice-fresh
## Sway addons ## Sway addons
font-awesome font-awesome
wob-package
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.hyprpaper inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.hyprpaper
swayosd
# For fancy x11 scaling # For fancy x11 scaling
sommelier sommelier
# Polkit # Polkit
@ -65,12 +67,17 @@ in with lib; {
enable = true; enable = true;
xwayland = { xwayland = {
enable = true; enable = true;
hidpi = true; hidpi = false;
}; };
recommendedEnvironment = true; recommendedEnvironment = true;
systemdIntegration = false; systemdIntegration = false;
extraConfig = '' extraConfig = ''
# Set environment variables to force wayland
env = XCURSOR_SIZE,24 env = XCURSOR_SIZE,24
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland
input { input {
kb_layout = us kb_layout = us
kb_variant = kb_variant =
@ -129,7 +136,7 @@ in with lib; {
bind = $mainMod, M, exit, bind = $mainMod, M, exit,
bind = $mainMod, E, exec, dolphin bind = $mainMod, E, exec, dolphin
bind = $mainMod, V, togglefloating, bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, fuzzel -f "Iosevka Sans Quasi" -b "103c48ff" -S "adbcbcff" -s "184956ff" -t "72898fff" -B 5 -r 5 -C "ed8649ff" bind = $mainMod, R, exec, ${fuzzel-command}
bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, B, togglesplit, # dwindle bind = $mainMod, B, togglesplit, # dwindle
bind = $mainMod, Z, exec, ${swaylock-command} bind = $mainMod, Z, exec, ${swaylock-command}
@ -172,8 +179,35 @@ in with lib; {
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
# Media key binds
bind = , xf86audioraisevolume, exec, swayosd --output-volume=raise
bind = SHIFT, xf86audioraisevolume, exec, swayosd --output-volume=+2
bind = , xf86audiolowervolume, exec, swayosd --output-volume=lower
bind = SHIFT, xf86audiolowervolume, exec, swayosd --output-volume=-2
bind = , xf86audiomute, exec, swayosd --output-volume mute-toggle
# Screenshots
bind = , print, exec, grimblast copysave area ~/Pictures/Screenshots/$(date -Iseconds).png
bind = SHIFT, print, exec, grimblast copysave output ~/Pictures/Screenshots/$(date -Iseconds).png
# Caps lock indicator
bindr = CAPS, caps_lock, exec, swayosd --caps-lock
# systemd integration # systemd integration
exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && sleep 2 && systemctl --user start hyprland-session.target exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && sleep 2 && systemctl --user start hyprland-session.target
# Notif bind
bind = $mainMod, T, exec, swaync-client -t -sw
## Window rules
# Gamescope
windowrulev2 = float,class:^(.gamescope-wrapped)$
windowrulev2 = noborder,class:^(.gamescope-wrapped)$
windowrulev2 = rounding 0,class:^(.gamescope-wrapped)$
# Clipboard history management
exec-once=wl-paste --watch cliphist store
bind = $mainMod, X, exec, cliphist list | ${fuzzel-command} --dmenu | cliphist decode | wl-copy
''; '';
}; };
@ -189,166 +223,7 @@ in with lib; {
}; };
}; };
######################### #########################
## Sway ## Hyprland Addons
#########################
wayland.windowManager.sway = let modifier = "Mod4";
in {
enable = true;
systemdIntegration = true;
wrapperFeatures = {
base = true;
gtk = true;
};
extraSessionCommands = ''
# Make qt theming work
export QT_QPA_PLATFORMTHEME="qt5ct"
# Prepare for wob
export WOBSOCK="$XDG_RUNTIME_DIR/wob.sock"
rm -rf $WOBSOCK && mkfifo $WOBSOCK
'';
config = {
# Startup wob
startup = [{ command = "tail -f $WOBSOCK | wob"; }];
# Setup gaps
gaps = {
smartGaps = true;
inner = 9;
};
# Window configuration
window = {
# Configure borders
border = 2;
# Application specific configuration
commands = [
# Make pinentry float
{
command = "floating enable";
criteria = { app_id = "pinentry-qt"; };
}
# Make bitwarden float
{
command = "floating enable";
criteria = { title = ".*Bitwarden.*"; };
}
# Make swayimg float, this is required to make it work
{
command = "floating enable";
criteria = { app_id = "^swayimg.*"; };
}
# Work around for chrome ui bug
{
command = "shortcuts_inhibitor disable";
criteria = { app_id = "chrome-.*"; };
}
];
};
# Use windows key as modifier
modifier = "Mod4";
# Alacritty as default terminal
terminal = "alacritty";
# Use krunner (from kde) as our launcher
menu = ''
${fuzzel-command}
'';
# Use waybar, but through systemd
bars = [
# {
# command = "waybar";
# }
];
# Use Iosevka
fonts = {
names = [ "Iosevka Sans Quasi" ];
size = 10.0;
};
# Selenize it
colors = {
focused = {
border = "75b938";
background = "184956";
text = "adbcbc";
indicator = "84c747";
childBorder = "75b938";
};
focusedInactive = {
border = "41c7b9";
background = "#103c48";
text = "adbcbc";
indicator = "53d6c7";
childBorder = "41c7b9";
};
unfocused = {
border = "72898f";
background = "103c48";
text = "72898f";
indicator = "adbcbc";
childBorder = "72898f";
};
urgent = {
border = "f275be";
background = "184956";
text = "fa5750";
indicator = "fa5750";
childBorder = "f275be";
};
};
# Setup keybindings
keybindings = lib.mkOptionDefault {
"${modifier}+q" = "kill";
"${modifier}+z" = "exec ${swaylock-command}";
## Sreenshot keybinds
# Copy area to clipboard
"${modifier}+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
# Copy window to clipboard
"${modifier}+Ctrl+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window";
# Clpy entire output to clipboard
"${modifier}+Alt+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output";
# Make the mute key work
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
# Make the volume keys work
"XF86AudioRaiseVolume" =
"exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $WOBSOCK";
"XF86AudioLowerVolume" =
"exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $WOBSOCK";
# Play/pause and next song
"XF86AudioPlay" = "exec mpc toggle";
"XF86AudioNext" = "exec mpc next";
# Setup scratchpads
"${modifier}+n" =
"exec sh -c 'swaymsg [app_id=\"emacs\"] scratchpad show'";
"${modifier}+m" =
"exec sh -c 'swaymsg [app_id=\"Alacritty\"] scratchpad show'";
# Rebind movement keys to use layman
"${modifier}+Shift+h" = "nop layman move left";
"${modifier}+Shift+j" = "nop layman move down";
"${modifier}+Shift+k" = "nop layman move up";
"${modifier}+Shift+l" = "nop layman move right";
# Switch to layman mode
"${modifier}+g" = "mode layout";
};
modes = lib.mkOptionDefault {
layout = {
h = "nop layman layout none; mode default";
j = "nop layman layout Autotiling; mode default";
k = "nop layman layout Grid; mode default";
l = "nop layman layout MasterStack; mode default";
Escape = "mode default";
Return = "mode default";
};
};
# Setup a custom mode for layman operations
# Turn on numlock by default
input = {
"*" = { xkb_numlock = "enable"; };
"type:pointer" = { accel_profile = "flat"; };
};
};
};
#########################
## Sway Addons
######################### #########################
# Setup polkit as a service # Setup polkit as a service
systemd.user.services.polkit-gnome = { systemd.user.services.polkit-gnome = {
@ -364,42 +239,31 @@ in with lib; {
}; };
Install = { WantedBy = [ "graphical-session.target" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; };
}; };
######################### # Setup swayosd as a service
## Mako (notifications) systemd.user.services.swayosd = {
#########################
services.mako = {
enable = true;
# Selenized color scheme
borderColor = "#f275be";
backgroundColor = "#184956";
textColor = "#adbcbc";
# Border configuration
borderSize = 3;
# Use Iosevka for font
font = "Iosevka Sans Quasi 10";
# Group by application
groupBy = "app-name";
# Bottom right corner
anchor = "bottom-right";
# Maximum visible notifications
maxVisible = 10;
# Sort by time in descending order (newest first)
sort = "-time";
# Don't time out notifications , I want to have to dismiss them
defaultTimeout = 0;
ignoreTimeout = true;
};
systemd.user.services.mako = {
Unit = { Unit = {
Description = "mako notification daemon"; Description = "Swayosd";
After = [ "graphical-session.target" ]; After = [ "graphical-session.target" ];
}; };
Service = { Service = {
Type = "simple"; Type = "simple";
ExecStart = '' ExecStart = "${pkgs.swayosd}/bin/swayosd";
${pkgs.mako}/bin/mako Restart = "on-failure";
''; };
Restart = "always"; Install = { WantedBy = [ "graphical-session.target" ]; };
};
#########################
## SwayNotificationCenter (notifications)
#########################
systemd.user.services.swaync = {
Unit = {
Description = "SwayNotificationCenter";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${notif-package}/bin/swaync";
Restart = "on-failure";
}; };
Install = { WantedBy = [ "graphical-session.target" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; };
}; };
@ -417,8 +281,8 @@ in with lib; {
# Turn off the displays after 10 minutes of inactivity # Turn off the displays after 10 minutes of inactivity
{ {
timeout = 600; timeout = 600;
command = ''swaymsg "output * dpms off"''; command = "hyprctl dispatch dpms off";
resumeCommand = ''swaymsg "output * dpms on"''; resumeCommand = "hyprctl dispatch dpms on";
} }
]; ];
}; };
@ -428,6 +292,7 @@ in with lib; {
######################### #########################
## Waybar ## Waybar
######################### #########################
# https://github.com/DN-debug/waybar-examples/tree/main/waybar-examples/sway
programs.waybar = { programs.waybar = {
enable = true; enable = true;
package = package =

View File

@ -8,7 +8,7 @@
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View File

@ -37,7 +37,9 @@
# Hyprland outputs # Hyprland outputs
wayland.windowManager.hyprland.extraConfig = '' wayland.windowManager.hyprland.extraConfig = ''
monitor=DP-1,preferred,auto,1.4,bitdepth,10 # monitor=DP-1,preferred,auto,1.4,bitdepth,10
# disable 10 bit output for now as this breaks screenshots
monitor=DP-1,preferred,auto,1.4
input { input {
sensitivity = -0.3 sensitivity = -0.3
# accel_profile = flat # accel_profile = flat

View File

@ -11,7 +11,7 @@ in {
./base.nix ./base.nix
./user.nix ./user.nix
./desktop.nix ./desktop.nix
./swaywm.nix ./hyprland.nix
./hardware.nix ./hardware.nix
./virtualization.nix ./virtualization.nix
./windows.nix ./windows.nix

View File

@ -14,7 +14,7 @@ in with lib; {
}; };
theme = "sugar-dark"; theme = "sugar-dark";
}; };
defaultSession = "sway"; defaultSession = "hyprland";
}; };
# Enable plasma for the applications # Enable plasma for the applications
desktopManager.plasma5.enable = true; desktopManager.plasma5.enable = true;
@ -51,34 +51,16 @@ in with lib; {
}) })
]; ];
qt.platformTheme = "qt5ct"; qt.platformTheme = "qt5ct";
# Enable and configure sway itself
programs.sway = {
enable = true;
# Enable the wrapper for gtk applications
wrapperFeatures.gtk = true;
# package = null;
};
# Enable and configure hyperland # Enable and configure hyperland
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;
xwayland = { xwayland = {
enable = true; enable = true;
hidpi = true; hidpi = false;
}; };
}; };
environment.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; }; environment.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; };
# Enable the xdg-portal
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
};
};
}; };
} }

View File

@ -13,7 +13,6 @@ in with lib; {
}) })
# Prism Launcher minecraft stuff # Prism Launcher minecraft stuff
glfw-patched glfw-patched
gamescope
]; ];
unstable-packages = unstable-packages =
with inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; [ with inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}"; [
@ -22,25 +21,32 @@ in with lib; {
prismlauncher prismlauncher
]; ];
in stable-packages ++ unstable-packages; in stable-packages ++ unstable-packages;
# Setup gamescope
programs.gamescope = {
enable = true;
package = pkgs.gamescope.overrideAttrs (old: {
src = let
vals = builtins.fromJSON
(builtins.readFile ../../../sources/gamescope.json);
in pkgs.fetchFromGitHub {
owner = "ValveSoftware";
repo = "gamescope";
rev = vals.rev;
hash = vals.hash;
fetchSubmodules = true;
};
patches = [ ];
buildInputs = with pkgs;
old.buildInputs
++ [ glm xorg.xcbutilwm xorg.xcbutilerrors gbenchmark ];
});
};
# Install steam # Install steam
programs.steam.enable = true; programs.steam = {
# Make steam work with gamescope enable = true;
nixpkgs.config.packageOverrides = pkgs: { gamescopeSession = {
steam = pkgs.steam.override { enable = true;
extraPkgs = pkgs: args = [ "--rt" ];
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
gtk3
];
}; };
}; };
}; };

4
sources/gamescope.json Normal file
View File

@ -0,0 +1,4 @@
{
"rev": "789cfc90575a7dbfc61ffa3325a4fb7f59f4d8b5",
"hash": "sha256-ThirEuHlxTTd2T8kuPTcDohMv7N7ZoSyWt0tzjpN6A0="
}

View File

@ -15,3 +15,15 @@ jq --null-input \
'{"version": $version, "url": $url, "hash": $hash}' \ '{"version": $version, "url": $url, "hash": $hash}' \
> $DIRECTORY/swayimg.json > $DIRECTORY/swayimg.json
echo "swayimg now at $SWAYIMG_VERSION" echo "swayimg now at $SWAYIMG_VERSION"
# Update gamescope
GAMESCOPE_BRANCH=$(curl https://api.github.com/repos/ValveSoftware/gamescope | jq -r '.default_branch')
GAMESCOPE_REV=$(curl https://api.github.com/repos/ValveSoftware/gamescope/git/refs/heads/$GAMESCOPE_BRANCH | \
jq -r '.object.sha')
GAMESCOPE_HASH=$(nix-prefetch fetchFromGitHub --owner ValveSoftware --repo gamescope --rev $GAMESCOPE_REV --fetchSubmodules)
jq --null-input \
--arg rev "$GAMESCOPE_REV" \
--arg hash "$GAMESCOPE_HASH" \
'{"rev": $rev, "hash": $hash}' \
> $DIRECTORY/gamescope.json
echo "gamescope now at $GAMESCOPE_REV"