Switch desktop configuration over to niri, niri monitor configuration for desktop, fix bug with cd, disable emacs daemon

This commit is contained in:
Curt Spark 2024-08-13 12:52:54 +01:00
parent a9e1c26974
commit 35ebd4983a
6 changed files with 67 additions and 31 deletions

View File

@ -28,9 +28,9 @@
# Custom desktop environments # Custom desktop environments
# cspark-desktop-plasma.enable = true; # cspark-desktop-plasma.enable = true;
cspark-desktop-gnome.enable = true; # cspark-desktop-gnome.enable = true;
# cspark-desktop-sway.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. # 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 = { systemd.services.audiointerface-reset-unbind = {

View File

@ -17,9 +17,9 @@
# Custom Desktop Configurations # Custom Desktop Configurations
# cspark-desktop-plasma-config-1.enable = true; # 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-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 # Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'. # plain files is through 'home.file'.

View File

@ -53,7 +53,7 @@ in
# Scripts to replace user utils with ones that can interface with the neovim inbuilt terminal # Scripts to replace user utils with ones that can interface with the neovim inbuilt terminal
(pkgs.writeShellScriptBin "cd-nvim" '' (pkgs.writeShellScriptBin "cd-nvim" ''
if [ $1 ]; then if [ "$1" ]; then
builtin cd "''$(realpath "$1")" && printf "\033]7;file://''${PWD}\033\\" builtin cd "''$(realpath "$1")" && printf "\033]7;file://''${PWD}\033\\"
else else
builtin cd "''${HOME}" && printf "\033]7;file://''${PWD}\033\\" 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) # Emacs install and enable daemon/server mode. Set to use unstable pure gtk branch (From emacs-overlay)
services.emacs = { #services.emacs = {
enable = true; # enable = true;
package = pkgs.emacs-gtk; # package = pkgs.emacs-gtk;
}; #};
# MPDCRON to automate MPD related events, using it to automatically restart mpd-discord-rpc service to solve issues # MPDCRON to automate MPD related events, using it to automatically restart mpd-discord-rpc service to solve issues
systemd.user.services.mpdcron = let systemd.user.services.mpdcron = let

View File

@ -44,6 +44,7 @@
nixd nixd
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
emacs-gtk
fastfetch fastfetch
appimage-run appimage-run
imagemagick imagemagick
@ -216,23 +217,23 @@
}; };
# Emacs install and enable daemon/server mode. # Emacs install and enable daemon/server mode.
services.emacs = { #services.emacs = {
enable = true; # enable = true;
package = pkgs.emacs-gtk; # package = pkgs.emacs-gtk;
}; #};
systemd.services.emacs = { #systemd.services.emacs = {
description = "Emacs server daemon for root"; # description = "Emacs server daemon for root";
wantedBy = [ "multi-user.target" ]; # wantedBy = [ "multi-user.target" ];
path = with pkgs; [ emacs-gtk ]; # path = with pkgs; [ emacs-gtk ];
enable = true; # enable = true;
serviceConfig = { # serviceConfig = {
User = "root"; # User = "root";
Group = "root"; # Group = "root";
}; # };
script = " # script = "
emacs --daemon # emacs --daemon
"; # ";
}; #};
# Virt Manager Installation # Virt Manager Installation
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;

View File

@ -25,6 +25,7 @@ in
foot # Terminal Emulator foot # Terminal Emulator
fuzzel # Application Launcher - Wayland fuzzel # Application Launcher - Wayland
wdisplays # Manage wayland displays wdisplays # Manage wayland displays
wlr-randr # Manage wayland displays - xrandr clone
wlsunset # Day/night gamma adjustment/filter for wayland wlsunset # Day/night gamma adjustment/filter for wayland
light # GNU/Linux application to control backlights light # GNU/Linux application to control backlights
mako # Notification Daemon mako # Notification Daemon
@ -41,6 +42,7 @@ in
lxappearance # Manage GTK Themes lxappearance # Manage GTK Themes
kdePackages.polkit-kde-agent-1 # Polkit Prompt for password prompts etc kdePackages.polkit-kde-agent-1 # Polkit Prompt for password prompts etc
lxqt.lxqt-openssh-askpass # GUI to query passwords on behalf of SSH agents lxqt.lxqt-openssh-askpass # GUI to query passwords on behalf of SSH agents
pavucontrol # Audio control
(writeShellScriptBin "niri-start-session" (writeShellScriptBin "niri-start-session"
'' ''
@ -59,7 +61,7 @@ in
# Xwayland support via xwayland-satellite-flake # Xwayland support via xwayland-satellite-flake
export DISPLAY=":0" export DISPLAY=":0"
DISPLAY=":0" niri-session niri-session
'') '')
]; ];
# The minimal login manager I'm using for niri # The minimal login manager I'm using for niri

View File

@ -48,7 +48,10 @@ input {
// Find more information on the wiki: // Find more information on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs // https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
// Remember to uncomment the node by removing "/-"! // Remember to uncomment the node by removing "/-"!
/-output "eDP-1" {
// Desktop monitor configuration
output "DP-2" {
// Uncomment this line to disable this output. // Uncomment this line to disable this output.
// off // off
@ -58,10 +61,10 @@ input {
// for the resolution. // for the resolution.
// If the mode is omitted altogether or is invalid, niri will pick one automatically. // 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. // 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 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: // Transform allows to rotate the output counter-clockwise, valid values are:
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. // 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. // 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 // If the position is unset or results in an overlap, the output is instead placed
// automatically. // 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 "<width>x<height>" or "<width>x<height>@<refresh rate>".
// 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. // Settings that influence how windows are positioned and sized.