Finish (?) transition to Niri.

This commit is contained in:
Fern Garden 2025-08-04 19:49:05 +08:00
parent c8f81f4190
commit a4f0d899c1
4 changed files with 49 additions and 40 deletions

View file

@ -113,7 +113,7 @@
# Universal styling. # Universal styling.
stylix = { stylix = {
enable = true; enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/kanagawa-dragon.yaml"; base16Scheme = "${pkgs.base16-schemes}/share/themes/everforest-dark-hard.yaml";
polarity = "dark"; polarity = "dark";
cursor = { cursor = {

View file

@ -37,9 +37,6 @@ with lib; {
# Enable smart card support (for YubiKey). # Enable smart card support (for YubiKey).
services.pcscd.enable = true; services.pcscd.enable = true;
# Encrypt user's home with fscrypt
security.pam.enableFscrypt = true;
# Enable login manager. # Enable login manager.
programs.regreet = { programs.regreet = {
enable = true; enable = true;
@ -65,14 +62,6 @@ with lib; {
services.upower.enable = true; services.upower.enable = true;
services.libinput.enable = true; services.libinput.enable = true;
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gnome
pkgs.xdg-desktop-portal-gtk
];
};
# Virtualisation. # Virtualisation.
programs.virt-manager.enable = true; programs.virt-manager.enable = true;
users.groups.libvirtd.members = ["fern"]; users.groups.libvirtd.members = ["fern"];
@ -122,6 +111,10 @@ with lib; {
hardware.brillo.enable = true; hardware.brillo.enable = true;
users.groups.video.members = ["fern"]; users.groups.video.members = ["fern"];
# Control external monitor
hardware.i2c.enable = true;
services.ddccontrol.enable = true;
# Enable sound with pipewire. # Enable sound with pipewire.
services.pulseaudio.enable = false; services.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
@ -133,7 +126,6 @@ with lib; {
}; };
# Enable CPU frequency scaling management. # Enable CPU frequency scaling management.
services.power-profiles-daemon.enable = mkForce false; # enabled by gnome
services.tlp.enable = mkForce false; # enabled by nixos-hardware services.tlp.enable = mkForce false; # enabled by nixos-hardware
services.auto-cpufreq.enable = true; services.auto-cpufreq.enable = true;

View file

@ -10,6 +10,19 @@ with lib; {
qt.enable = true; qt.enable = true;
gtk.enable = true; gtk.enable = true;
# XDG portals.
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gnome
pkgs.xdg-desktop-portal-gtk
];
};
# Create home directories.
xdg.userDirs.createDirectories = true;
# Niri WM.
programs.niri = { programs.niri = {
settings = { settings = {
# Wayland environment variables. # Wayland environment variables.
@ -22,6 +35,7 @@ with lib; {
QT_QPA_PLATFORM = "wayland;xcb"; QT_QPA_PLATFORM = "wayland;xcb";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland"; SDL_VIDEODRIVER = "wayland";
GTK_CSD = "0";
}; };
# X11 support. # X11 support.
@ -49,8 +63,12 @@ with lib; {
# Spawn programs. # Spawn programs.
"Mod+Return".action.spawn = "kitty"; "Mod+Return".action.spawn = "kitty";
"Mod+Space".action.spawn = "fuzzel"; "Mod+Space".action.spawn = "fuzzel";
"Mod+E".action.spawn = "smile";
"Mod+Alt+L".action.spawn = "hyprlock"; "Mod+Alt+L".action.spawn = "hyprlock";
# Show overview
"Mod+Escape".action.toggle-overview = {};
# Media & brightness control. # Media & brightness control.
"XF86AudioRaiseVolume" = { "XF86AudioRaiseVolume" = {
allow-when-locked = true; allow-when-locked = true;
@ -72,6 +90,26 @@ with lib; {
action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"]; action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"];
}; };
"XF86AudioPlay" = {
allow-when-locked = true;
action.spawn = ["playerctl" "play-pause"];
};
"XF86AudioStop" = {
allow-when-locked = true;
action.spawn = ["playerctl" "pause"];
};
"XF86AudioPrev" = {
allow-when-locked = true;
action.spawn = ["playerctl" "previous"];
};
"XF86AudioNext" = {
allow-when-locked = true;
action.spawn = ["playerctl" "next"];
};
"XF86MonBrightnessUp" = { "XF86MonBrightnessUp" = {
allow-when-locked = true; allow-when-locked = true;
action.spawn = ["brillo" "-A" "5"]; action.spawn = ["brillo" "-A" "5"];
@ -248,12 +286,6 @@ with lib; {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
style = ''
* {
border-radius: 0;
}
'';
settings.main = { settings.main = {
modules-left = ["niri/workspaces"]; modules-left = ["niri/workspaces"];
modules-center = ["clock"]; modules-center = ["clock"];
@ -263,6 +295,7 @@ with lib; {
bat = "BAT0"; bat = "BAT0";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂁" "󰂂" "󰁹"]; format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂁" "󰂂" "󰁹"];
format = "{icon} {capacity}%"; format = "{icon} {capacity}%";
format-charging = "󱐋 {icon} {capacity}%";
tooltip = false; tooltip = false;
}; };
@ -297,24 +330,8 @@ with lib; {
stylix.targets.waybar.font = "sansSerif"; # use sans-serif font, not monospaced. stylix.targets.waybar.font = "sansSerif"; # use sans-serif font, not monospaced.
# polkit-gnome. # Enable polkit-gnome.
systemd.user.services.polkit-gnome-authentication-agent-1 = { services.polkit-gnome.enable = true;
Unit.Description = "polkit-gnome-authentication-agent-1";
Install = {
WantedBy = ["graphical-session.target"];
Wants = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
# Wallpaper manager. # Wallpaper manager.
services.hyprpaper.enable = true; services.hyprpaper.enable = true;
@ -357,6 +374,7 @@ with lib; {
noto-fonts-cjk-serif noto-fonts-cjk-serif
ns-usbloader ns-usbloader
obsidian obsidian
playerctl
prismlauncher prismlauncher
protonmail-desktop protonmail-desktop
rockbox-utility rockbox-utility

View file

@ -82,10 +82,9 @@
} }
]; ];
colorschemes.kanagawa = { colorschemes.everforest = {
enable = true; enable = true;
settings.colors.theme.all.ui.bg_gutter = "none"; # Remove gutter background. settings.background = "hard";
settings.background.dark = "dragon";
}; };
opts = rec { opts = rec {