Move anything that's no hyprland-specific into desktop.nix

This commit is contained in:
Evie Litherland-Smith 2024-04-11 22:38:26 +01:00
parent 6e6e50d2b5
commit 5179a0d03a
2 changed files with 151 additions and 154 deletions

View file

@ -1,16 +1,34 @@
{ {
lib,
pkgs, pkgs,
user, user,
... ...
}: { }: {
imports = [./default.nix]; imports = [./default.nix ./firefox.nix];
environment.systemPackages = with pkgs; [ nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
environment = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim";
};
systemPackages = with pkgs; [
wtype
wl-clipboard
xdg-utils
libnotify libnotify
libcamera libcamera
glib glib
gsettings-desktop-schemas gsettings-desktop-schemas
hunspell hunspell
hunspellDicts.en_GB-large hunspellDicts.en_GB-large
swayimg
swaylock-effects
pamixer
pavucontrol
playerctl
brightnessctl
mpv
xarchiver xarchiver
libreoffice-fresh libreoffice-fresh
zathura zathura
@ -22,13 +40,35 @@
remmina remmina
nomachine-client nomachine-client
]; ];
};
security = { security = {
pam.services.swaylock = {};
polkit.enable = true; polkit.enable = true;
rtkit.enable = true; rtkit.enable = true;
}; };
sound.enable = false; sound.enable = false;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
programs = {
dconf.enable = true;
light.enable = true;
noisetorch.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
};
gtk.iconCache.enable = true;
qt = {
enable = true;
platformTheme = "gtk2";
style = "gtk2";
};
services = { services = {
blueman.enable = true;
gvfs = {
enable = true;
package = lib.mkForce pkgs.gnome3.gvfs;
};
accounts-daemon.enable = true; accounts-daemon.enable = true;
dbus.packages = with pkgs; [gcr]; dbus.packages = with pkgs; [gcr];
greetd = { greetd = {
@ -46,20 +86,90 @@
pulse.enable = true; pulse.enable = true;
wireplumber.enable = true; wireplumber.enable = true;
}; };
xserver.xkb = { tumbler.enable = true;
udisks2.enable = true;
xserver = {
enable = false;
xkb = {
layout = "gb"; layout = "gb";
variant = ""; variant = "";
options = "ctrl:nocaps"; options = "ctrl:nocaps";
}; };
}; };
programs = {
dconf.enable = true;
noisetorch.enable = true;
}; };
gtk.iconCache.enable = true; xdg = {
qt = { portal.enable = true;
mime = let
emacs = ["emacsclient.desktop" "emacs.desktop"];
browser = ["firefox.desktop"];
applications = {
"inode/directory" = ["thunar.desktop"];
"inode/symlink" = ["thunar.desktop"];
"image/jpeg" = ["swayimg.desktop"];
"image/png" = ["swayimg.desktop"];
"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/rss+xml" = emacs;
"application/xhtml+xml" = emacs;
"application/oxps" = emacs;
"application/x-shellscript" = emacs;
"application/pdf" = ["org.pwmt.zathura.desktop"];
"application/epub+zip" = ["org.pwmt.zathura.desktop"];
"application/msword" = ["writer.desktop"];
"application/zip" = ["xarchiver.desktop"];
"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/unknown" = emacs;
"x-scheme-handler/ms-word" = ["writer.desktop"];
"x-scheme-handler/ms-powerpoint" = ["impress.desktop"];
"x-scheme-handler/ms-excel" = ["calc.desktop"];
};
in {
enable = true; enable = true;
platformTheme = "gtk2"; defaultApplications = applications;
style = "gtk2"; addedAssociations = applications;
removedAssociations = {"x-scheme-handler/zoomus" = browser;};
};
}; };
} }

View file

@ -1,136 +1,23 @@
{ {pkgs, ...}: {
lib, imports = [./desktop.nix];
pkgs,
...
}: {
imports = [./desktop.nix ./firefox.nix];
nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
environment = { environment = {
sessionVariables = { sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland"; XDG_SESSION_DESKTOP = "Hyprland";
XDG_CURRENT_DESKTOP = "Hyprland"; XDG_CURRENT_DESKTOP = "Hyprland";
GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim";
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [
wtype
wl-clipboard
xdg-utils
hyprpaper hyprpaper
hyprpicker hyprpicker
swaylock-effects
swayimg
pamixer
pavucontrol
playerctl
brightnessctl
mpv
]; ];
}; };
security.pam.services = { services.greetd.settings = let
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"; command = "Hyprland";
in { in {
default_session = {inherit command;}; default_session = {inherit command;};
initial_session = {inherit command;}; initial_session = {inherit command;};
}; };
}; programs.hyprland = {
xdg.portal.enable = true;
xdg.mime = let
emacs = ["emacsclient.desktop" "emacs.desktop"];
browser = ["firefox.desktop"];
applications = {
"inode/directory" = ["thunar.desktop"];
"inode/symlink" = ["thunar.desktop"];
"image/jpeg" = ["swayimg.desktop"];
"image/png" = ["swayimg.desktop"];
"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/rss+xml" = emacs;
"application/xhtml+xml" = emacs;
"application/oxps" = emacs;
"application/x-shellscript" = emacs;
"application/pdf" = ["org.pwmt.zathura.desktop"];
"application/epub+zip" = ["org.pwmt.zathura.desktop"];
"application/msword" = ["writer.desktop"];
"application/zip" = ["xarchiver.desktop"];
"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/unknown" = emacs;
"x-scheme-handler/ms-word" = ["writer.desktop"];
"x-scheme-handler/ms-powerpoint" = ["impress.desktop"];
"x-scheme-handler/ms-excel" = ["calc.desktop"];
};
in {
enable = true;
defaultApplications = applications;
addedAssociations = applications;
removedAssociations = {"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; enable = true;
xwayland.enable = true; xwayland.enable = true;
}; };
};
} }