split sway module
This commit is contained in:
parent
260b9b89cf
commit
d0a8ffa12c
7 changed files with 146 additions and 100 deletions
|
@ -1,28 +1,15 @@
|
||||||
{ pkgs, ... }: {
|
{ ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
./clipman.nix
|
./clipman.nix
|
||||||
|
./gammastep.nix
|
||||||
|
./kanshi.nix
|
||||||
./network.nix
|
./network.nix
|
||||||
|
./pipewire.nix
|
||||||
|
./programs.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./sway.nix
|
./sway.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
|
./wofi.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
firefox-wayland
|
|
||||||
keepassxc
|
|
||||||
(kodi-wayland.withPackages (kodiPackages: with kodiPackages; [
|
|
||||||
jellyfin
|
|
||||||
]))
|
|
||||||
libqalculate
|
|
||||||
mpv
|
|
||||||
spotify
|
|
||||||
tor-browser-bundle-bin
|
|
||||||
vlc
|
|
||||||
webcord # discord
|
|
||||||
];
|
|
||||||
|
|
||||||
services.logind.extraConfig = ''
|
|
||||||
HandlePowerKey=ignore
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
18
modules/desktop/gammastep.nix
Normal file
18
modules/desktop/gammastep.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ home-manager, ... }: {
|
||||||
|
# Gammestep automatically adjusts the screen's colour temperature. It's
|
||||||
|
# basically redshift for Wayland.
|
||||||
|
# https://gitlab.com/chinstrap/gammastep
|
||||||
|
# https://nixos.wiki/wiki/Gammastep
|
||||||
|
|
||||||
|
home-manager.users.caspervk = {
|
||||||
|
services.gammastep = {
|
||||||
|
enable = true;
|
||||||
|
dawnTime = "06:00";
|
||||||
|
duskTime = "22:30";
|
||||||
|
temperature = {
|
||||||
|
day = 6500; # default upstream but not in nixpkgs, neutral
|
||||||
|
night = 4500; # default upstream but not in nixpkgs
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
35
modules/desktop/kanshi.nix
Normal file
35
modules/desktop/kanshi.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ home-manager, ... }: {
|
||||||
|
# kanshi allows you to define output profiles that are automatically enabled
|
||||||
|
# and disabled on hotplug. For instance, this can be used to turn a laptop's
|
||||||
|
# internal screen off when docked. This is a Wayland equivalent for tools
|
||||||
|
# like autorandr.
|
||||||
|
# https://sr.ht/~emersion/kanshi/
|
||||||
|
|
||||||
|
home-manager.users.caspervk = {
|
||||||
|
services.kanshi = {
|
||||||
|
enable = true;
|
||||||
|
profiles = {
|
||||||
|
# Output names (criteria) from `swaymsg -t get_outputs`.
|
||||||
|
omega.outputs = [
|
||||||
|
{
|
||||||
|
criteria = "ASUSTek COMPUTER INC ROG XG27AQ M3LMQS370969";
|
||||||
|
mode = "2560x1440@144Hz";
|
||||||
|
position = "0,0";
|
||||||
|
adaptiveSync = false; # seems to flicker
|
||||||
|
}
|
||||||
|
{
|
||||||
|
criteria = "BNQ BenQ XL2411Z SCD06385SL0";
|
||||||
|
mode = "1920x1080@144Hz";
|
||||||
|
position = "2560,400";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
zeta.outputs = [
|
||||||
|
{
|
||||||
|
criteria = "Chimei Innolux Corporation 0x14D2 Unknown";
|
||||||
|
mode = "1920x1080@60Hz";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
22
modules/desktop/pipewire.nix
Normal file
22
modules/desktop/pipewire.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ home-manager, lib, pkgs, ... }: {
|
||||||
|
# PipeWire is a new low-level multimedia framework. It aims to offer capture
|
||||||
|
# and playback for both audio and video with minimal latency and support for
|
||||||
|
# PulseAudio-, JACK-, ALSA- and GStreamer-based applications.
|
||||||
|
# https://nixos.wiki/wiki/PipeWire
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
jack.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# RealtimeKit is a D-Bus system service that allows user processes to gain
|
||||||
|
# realtime scheduling priority on request. It is intended to be used as a
|
||||||
|
# secure mechanism to allow real-time scheduling to be used by normal user
|
||||||
|
# processes.
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
}
|
25
modules/desktop/programs.nix
Normal file
25
modules/desktop/programs.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ home-manager, pkgs, ... }: {
|
||||||
|
# Packages useful on a desktop computer which don't require their own module
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
firefox-wayland
|
||||||
|
keepassxc
|
||||||
|
(kodi-wayland.withPackages (kodiPackages: with kodiPackages; [
|
||||||
|
jellyfin
|
||||||
|
]))
|
||||||
|
libqalculate
|
||||||
|
mpv
|
||||||
|
spotify
|
||||||
|
tor-browser-bundle-bin
|
||||||
|
vlc
|
||||||
|
webcord # discord
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.caspervk = {
|
||||||
|
home.sessionVariables = {
|
||||||
|
# The firefox-wayland package works with wayland without any further
|
||||||
|
# configuration, but tor-browser doesn't.
|
||||||
|
MOZ_ENABLE_WAYLAND = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,10 +7,6 @@
|
||||||
home-manager.users.caspervk = {
|
home-manager.users.caspervk = {
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# Execute sway with required environment variables for GTK applications
|
|
||||||
wrapperFeatures = {
|
|
||||||
gtk = true;
|
|
||||||
};
|
|
||||||
config = {
|
config = {
|
||||||
input = {
|
input = {
|
||||||
"type:keyboard" = {
|
"type:keyboard" = {
|
||||||
|
@ -64,12 +60,16 @@
|
||||||
"XF86AudioPrev" = "exec 'playerctl previous'";
|
"XF86AudioPrev" = "exec 'playerctl previous'";
|
||||||
};
|
};
|
||||||
focus = {
|
focus = {
|
||||||
|
# Don't automatically focus hovered windows
|
||||||
followMouse = "no";
|
followMouse = "no";
|
||||||
};
|
};
|
||||||
gaps = {
|
gaps = {
|
||||||
smartBorders = "no_gaps";
|
smartBorders = "no_gaps";
|
||||||
};
|
};
|
||||||
window = {
|
window = {
|
||||||
|
# Don't show unnecessary window titlebars, e.g. when there is only
|
||||||
|
# one window on screen. The titlebars will still be shown if tabbing
|
||||||
|
# or stacking windows.
|
||||||
titlebar = false;
|
titlebar = false;
|
||||||
};
|
};
|
||||||
colors = {
|
colors = {
|
||||||
|
@ -84,12 +84,21 @@
|
||||||
terminal = "alacritty";
|
terminal = "alacritty";
|
||||||
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Execute sway with required environment variables for GTK applications
|
||||||
|
wrapperFeatures = {
|
||||||
|
gtk = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/Alexays/Waybar/wiki/Configuration
|
# https://github.com/Alexays/Waybar/wiki/Configuration
|
||||||
# https://github.com/Alexays/Waybar/blob/master/resources/config
|
# https://github.com/Alexays/Waybar/blob/master/resources/config
|
||||||
programs.waybar =
|
programs.waybar =
|
||||||
let
|
let
|
||||||
|
# It isn't possible to extend the default Waybar config in Home
|
||||||
|
# Manager; as soon as any setting is defined it overwrites the entire
|
||||||
|
# default configuration. To combat this, we parse the default config
|
||||||
|
# into Nix and merge it with our changes.
|
||||||
mkDefaultConfig = pkgs.stdenv.mkDerivation {
|
mkDefaultConfig = pkgs.stdenv.mkDerivation {
|
||||||
name = "waybarDefaultConfig";
|
name = "waybarDefaultConfig";
|
||||||
src = "${pkgs.waybar}/etc/xdg/waybar";
|
src = "${pkgs.waybar}/etc/xdg/waybar";
|
||||||
|
@ -184,67 +193,13 @@
|
||||||
{ timeout = 600; command = lock; }
|
{ timeout = 600; command = lock; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://hg.sr.ht/~scoopta/wofi
|
|
||||||
programs.wofi = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
show = "drun";
|
|
||||||
allow_images = true;
|
|
||||||
gtk_dark = true;
|
|
||||||
insensitive = true;
|
|
||||||
prompt = ""; # hides 'drun' from the search bar
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# https://sr.ht/~emersion/kanshi/
|
|
||||||
services.kanshi = {
|
|
||||||
enable = true;
|
|
||||||
profiles = {
|
|
||||||
# Output names ("criteria") from `swaymsg -t get_outputs`.
|
|
||||||
omega.outputs = [
|
|
||||||
{
|
|
||||||
criteria = "ASUSTek COMPUTER INC ROG XG27AQ M3LMQS370969";
|
|
||||||
mode = "2560x1440@144Hz";
|
|
||||||
position = "0,0";
|
|
||||||
adaptiveSync = false; # seems to flicker
|
|
||||||
}
|
|
||||||
{
|
|
||||||
criteria = "BNQ BenQ XL2411Z SCD06385SL0";
|
|
||||||
mode = "1920x1080@144Hz";
|
|
||||||
position = "2560,0";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
zeta.outputs = [
|
|
||||||
{
|
|
||||||
criteria = "Chimei Innolux Corporation 0x14D2 Unknown";
|
|
||||||
mode = "1920x1080@60Hz";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Gammestep automatically adjusts the screen's colour temperature. It's
|
|
||||||
# basically redshift for wayland.
|
|
||||||
# https://gitlab.com/chinstrap/gammastep
|
|
||||||
# https://nixos.wiki/wiki/Gammastep
|
|
||||||
services.gammastep = {
|
|
||||||
enable = true;
|
|
||||||
dawnTime = "07:00";
|
|
||||||
duskTime = "23:00";
|
|
||||||
temperature = {
|
|
||||||
day = 6500; # neutral
|
|
||||||
night = 4500;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home.sessionVariables = {
|
|
||||||
# The firefox-wayland package works with wayland without any further
|
|
||||||
# configuration, but tor-browser doesn't.
|
|
||||||
MOZ_ENABLE_WAYLAND = 1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Don't shut down the system when the power key is pressed
|
||||||
|
services.logind.extraConfig = ''
|
||||||
|
HandlePowerKey=ignore
|
||||||
|
'';
|
||||||
|
|
||||||
# Connect swaylock to PAM. If this isn't done, swaylock needs the suid flag
|
# Connect swaylock to PAM. If this isn't done, swaylock needs the suid flag
|
||||||
security.pam.services.swaylock.text = ''
|
security.pam.services.swaylock.text = ''
|
||||||
auth include login
|
auth include login
|
||||||
|
@ -264,24 +219,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Audio
|
|
||||||
# https://nixos.wiki/wiki/PipeWire
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
};
|
|
||||||
jack.enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# The RealtimeKit system services allows user processes to gain realtime scheduling priority
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
brightnessctl
|
brightnessctl
|
||||||
clipman # TODO
|
|
||||||
gnome3.adwaita-icon-theme # cursor TODO
|
gnome3.adwaita-icon-theme # cursor TODO
|
||||||
grim # screenshot TODO
|
grim # screenshot TODO
|
||||||
pavucontrol # PulseAudio Volume Control gui
|
pavucontrol # PulseAudio Volume Control gui
|
||||||
|
@ -293,8 +232,9 @@
|
||||||
wtype # xdotool for wayland
|
wtype # xdotool for wayland
|
||||||
];
|
];
|
||||||
|
|
||||||
# xdg portal allows applications secury access to resources outside their sandbox.
|
# xdg portal allows applications secure access to resources outside their
|
||||||
# In particular, this allows screen sharing on Wayland via PipeWire and file open/save dialogues in Firefox.
|
# sandbox. In particular, this allows screen sharing on Wayland via PipeWire
|
||||||
|
# and file open/save dialogues in Firefox.
|
||||||
# https://wiki.archlinux.org/title/XDG_Desktop_Portal
|
# https://wiki.archlinux.org/title/XDG_Desktop_Portal
|
||||||
# https://mozilla.github.io/webrtc-landing/gum_test.html
|
# https://mozilla.github.io/webrtc-landing/gum_test.html
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
|
@ -302,6 +242,7 @@
|
||||||
wlr.enable = true;
|
wlr.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [ intel-media-driver ];
|
extraPackages = with pkgs; [ intel-media-driver ];
|
||||||
|
|
18
modules/desktop/wofi.nix
Normal file
18
modules/desktop/wofi.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ home-manager, ... }: {
|
||||||
|
# Rofi-inspired menu program for Wayland.
|
||||||
|
# Used to open programs and view the clipman clipboard history.
|
||||||
|
# https://hg.sr.ht/~scoopta/wofi
|
||||||
|
|
||||||
|
home-manager.users.caspervk = {
|
||||||
|
programs.wofi = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
show = "drun";
|
||||||
|
allow_images = true; # show icons
|
||||||
|
gtk_dark = true;
|
||||||
|
insensitive = true;
|
||||||
|
prompt = ""; # hides 'drun' text from the search bar
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue