From 35ebd4983aa8259b1f1f921db53907de7be508d9 Mon Sep 17 00:00:00 2001 From: cspark Date: Tue, 13 Aug 2024 12:52:54 +0100 Subject: [PATCH] Switch desktop configuration over to niri, niri monitor configuration for desktop, fix bug with cd, disable emacs daemon --- configurations/desktop/configuration.nix | 4 +- configurations/desktop/home.nix | 4 +- global-home.nix | 10 ++--- global.nix | 35 ++++++++-------- modules/nixos/cspark-desktop-niri/module.nix | 4 +- .../home-manager/.config/niri/config.kdl | 41 +++++++++++++++++-- 6 files changed, 67 insertions(+), 31 deletions(-) diff --git a/configurations/desktop/configuration.nix b/configurations/desktop/configuration.nix index 500c0236..62c6009c 100644 --- a/configurations/desktop/configuration.nix +++ b/configurations/desktop/configuration.nix @@ -28,9 +28,9 @@ # Custom desktop environments # cspark-desktop-plasma.enable = true; - cspark-desktop-gnome.enable = true; + # cspark-desktop-gnome.enable = true; # cspark-desktop-sway.enable = true; - # cspark-desktop-niri.enable = true; + cspark-desktop-niri.enable = true; # My audio interface has issues after coming out from suspend/hibernate, this will reset it to fix it when necessary. systemd.services.audiointerface-reset-unbind = { diff --git a/configurations/desktop/home.nix b/configurations/desktop/home.nix index c2d7987b..f299198f 100644 --- a/configurations/desktop/home.nix +++ b/configurations/desktop/home.nix @@ -17,9 +17,9 @@ # Custom Desktop Configurations # cspark-desktop-plasma-config-1.enable = true; - cspark-desktop-gnome-config-1.enable = true; + # cspark-desktop-gnome-config-1.enable = true; # cspark-desktop-sway-config-1.enable = true; - # cspark-desktop-niri-config-1.enable = true; + cspark-desktop-niri-config-1.enable = true; # Home Manager is pretty good at managing dotfiles. The primary way to manage # plain files is through 'home.file'. diff --git a/global-home.nix b/global-home.nix index b157fc03..0f50dbad 100644 --- a/global-home.nix +++ b/global-home.nix @@ -53,7 +53,7 @@ in # Scripts to replace user utils with ones that can interface with the neovim inbuilt terminal (pkgs.writeShellScriptBin "cd-nvim" '' -if [ $1 ]; then +if [ "$1" ]; then builtin cd "''$(realpath "$1")" && printf "\033]7;file://''${PWD}\033\\" else builtin cd "''${HOME}" && printf "\033]7;file://''${PWD}\033\\" @@ -234,10 +234,10 @@ fi }; # Emacs install and enable daemon/server mode. Set to use unstable pure gtk branch (From emacs-overlay) - services.emacs = { - enable = true; - package = pkgs.emacs-gtk; - }; + #services.emacs = { + # enable = true; + # package = pkgs.emacs-gtk; + #}; # MPDCRON to automate MPD related events, using it to automatically restart mpd-discord-rpc service to solve issues systemd.user.services.mpdcron = let diff --git a/global.nix b/global.nix index 434dffd2..ef9b6f82 100644 --- a/global.nix +++ b/global.nix @@ -44,6 +44,7 @@ nixd neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + emacs-gtk fastfetch appimage-run imagemagick @@ -216,23 +217,23 @@ }; # Emacs install and enable daemon/server mode. - services.emacs = { - enable = true; - package = pkgs.emacs-gtk; - }; - systemd.services.emacs = { - description = "Emacs server daemon for root"; - wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ emacs-gtk ]; - enable = true; - serviceConfig = { - User = "root"; - Group = "root"; - }; - script = " - emacs --daemon - "; - }; + #services.emacs = { + # enable = true; + # package = pkgs.emacs-gtk; + #}; + #systemd.services.emacs = { + # description = "Emacs server daemon for root"; + # wantedBy = [ "multi-user.target" ]; + # path = with pkgs; [ emacs-gtk ]; + # enable = true; + # serviceConfig = { + # User = "root"; + # Group = "root"; + # }; + # script = " + # emacs --daemon + # "; + #}; # Virt Manager Installation virtualisation.libvirtd.enable = true; diff --git a/modules/nixos/cspark-desktop-niri/module.nix b/modules/nixos/cspark-desktop-niri/module.nix index 20796e82..9946ed21 100644 --- a/modules/nixos/cspark-desktop-niri/module.nix +++ b/modules/nixos/cspark-desktop-niri/module.nix @@ -25,6 +25,7 @@ in foot # Terminal Emulator fuzzel # Application Launcher - Wayland wdisplays # Manage wayland displays + wlr-randr # Manage wayland displays - xrandr clone wlsunset # Day/night gamma adjustment/filter for wayland light # GNU/Linux application to control backlights mako # Notification Daemon @@ -41,6 +42,7 @@ in lxappearance # Manage GTK Themes kdePackages.polkit-kde-agent-1 # Polkit Prompt for password prompts etc lxqt.lxqt-openssh-askpass # GUI to query passwords on behalf of SSH agents + pavucontrol # Audio control (writeShellScriptBin "niri-start-session" '' @@ -59,7 +61,7 @@ in # Xwayland support via xwayland-satellite-flake export DISPLAY=":0" - DISPLAY=":0" niri-session + niri-session '') ]; # The minimal login manager I'm using for niri diff --git a/modules/nixos/cspark-desktop-niri/resources/home-manager/.config/niri/config.kdl b/modules/nixos/cspark-desktop-niri/resources/home-manager/.config/niri/config.kdl index 97b279f6..f200f0c5 100644 --- a/modules/nixos/cspark-desktop-niri/resources/home-manager/.config/niri/config.kdl +++ b/modules/nixos/cspark-desktop-niri/resources/home-manager/.config/niri/config.kdl @@ -48,7 +48,10 @@ input { // Find more information on the wiki: // https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs // Remember to uncomment the node by removing "/-"! -/-output "eDP-1" { + + +// Desktop monitor configuration +output "DP-2" { // Uncomment this line to disable this output. // off @@ -58,10 +61,10 @@ input { // for the resolution. // If the mode is omitted altogether or is invalid, niri will pick one automatically. // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes. - mode "1920x1080@120.030" + mode "1920x1080@60.000" // Scale is a floating-point number, but at the moment only integer values work. - scale 2.0 + scale 1.0 // Transform allows to rotate the output counter-clockwise, valid values are: // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. @@ -76,7 +79,37 @@ input { // so to put another output directly adjacent to it on the right, set its x to 1920. // If the position is unset or results in an overlap, the output is instead placed // automatically. - position x=1280 y=0 + position x=0 y=0 +} +output "HDMI-A-1" { + // Uncomment this line to disable this output. + // off + + // Resolution and, optionally, refresh rate of the output. + // The format is "x" or "x@". + // If the refresh rate is omitted, niri will pick the highest refresh rate + // for the resolution. + // If the mode is omitted altogether or is invalid, niri will pick one automatically. + // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes. + mode "1920x1080@60.000" + + // Scale is a floating-point number, but at the moment only integer values work. + scale 1.0 + + // Transform allows to rotate the output counter-clockwise, valid values are: + // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. + transform "normal" + + // Position of the output in the global coordinate space. + // This affects directional monitor actions like "focus-monitor-left", and cursor movement. + // The cursor can only move between directly adjacent outputs. + // Output scale and rotation has to be taken into account for positioning: + // outputs are sized in logical, or scaled, pixels. + // For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080, + // so to put another output directly adjacent to it on the right, set its x to 1920. + // If the position is unset or results in an overlap, the output is instead placed + // automatically. + position x=1920 y=0 } // Settings that influence how windows are positioned and sized.