nixos/system/hyprland.nix
Evie Litherland-Smith ecc9fae75a Major changes: switch to tracking nixos-23.11 and remove stylix.
Motivated by the xz backdoor bug, switch NixOS system to track 23.11
instead of unstable, and will bump version numbers as they come along
rather than do rolling release.
Reverted a couple of changes that were introduced in recent nixpkgs
versions, only major one was switching back to swaylock as hyprlock
isn't in nixpkgs 23.11

Remove stylix and replace with lower-level base16.nix, partly because
stylix was doing something strange pulling in extra flakes (and
breaking on 23.11), partly because I was most of the way there anyway.
Remove last references to stylix in config, mostly just changing
stylix.colors to scheme (from base16) and defining fonts in
specialArgs to be used in the same way as before.
2024-03-31 12:59:24 +01:00

140 lines
3.8 KiB
Nix

{
lib,
pkgs,
...
}: {
imports = [./desktop.nix ./firefox.nix ./chromium.nix];
nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
environment = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_CURRENT_DESKTOP = "Hyprland";
GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim";
};
systemPackages = with pkgs; [
swaylock-effects
hyprpaper
xdg-utils
wtype
wl-clipboard
swayimg
pamixer
pavucontrol
playerctl
brightnessctl
mpv
streamlink
];
};
security.pam.services = {
swaylock = {};
hyprlock = {};
};
services = {
xserver.enable = false;
blueman.enable = true;
udisks2.enable = true;
tumbler.enable = true;
gvfs = {
enable = true;
package = lib.mkForce pkgs.gnome3.gvfs;
};
greetd.settings = let
command = "Hyprland";
in {
default_session = {inherit command;};
initial_session = {inherit command;};
};
};
xdg.portal.enable = true;
xdg.mime = let
emacs = ["emacsclient.desktop" "emacs.desktop"];
# TODO add nyxt back to browser when I can fix opening
# links in existing sessions
browser = ["firefox.desktop"]; # nyxt.desktop
applications = {
"inode/directory" = emacs;
"inode/symlink" = emacs;
"image/jpeg" = ["swayimg.desktop"] ++ emacs;
"image/png" = ["swayimg.desktop"] ++ emacs;
"video/mp4" = ["mpv.desktop"];
"text/plain" = emacs;
"text/richtext" = emacs;
"text/org" = emacs;
"text/markdown" = emacs;
"text/rust" = emacs;
"text/csv" = emacs;
"text/html" = emacs;
"text/css" = emacs;
"text/tab-separated-values" = emacs;
"text/x-emacs-lisp" = emacs;
"text/x-fortran" = emacs;
"text/x-idl" = emacs;
"text/x-log" = emacs;
"text/x-lua" = emacs;
"text/x-makefile" = emacs;
"text/x-python" = emacs;
"text/x-python3" = emacs;
"text/x-readme" = emacs;
"text/x-scheme" = emacs;
"text/x-tex" = emacs;
"text/x-texinfo" = emacs;
"application/json" = emacs;
"application/toml" = emacs;
"application/yaml" = emacs;
"application/xml" = emacs;
"application/pdf" = emacs;
"application/epub+zip" = emacs;
"application/rss+xml" = emacs;
"application/oxps" = emacs;
# "application/msword" = emacs;
"application/xhtml+xml" = browser;
"application/x-shellscript" = emacs;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
"application/x-mozilla-bookmarks" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/chrome" = browser;
"x-scheme-handler/webcal" = browser;
# "x-scheme-handler/ms-word" = emacs;
# "x-scheme-handler/ms-powerpoint" = emacs;
# "x-scheme-handler/ms-excel" = emacs;
"x-scheme-handler/unknown" = emacs;
"x-scheme-handler/msteams" = ["teams-for-linux.desktop"];
};
in {
enable = true;
defaultApplications = applications;
addedAssociations = applications;
removedAssociations = {
"x-scheme-handler/msteams" = browser;
"x-scheme-handler/zoomus" = browser;
};
};
programs = {
dconf.enable = true;
light.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
hyprland = {
enable = true;
xwayland.enable = true;
};
};
}