Updated emacs to wayland

This commit is contained in:
Aleksandr Lebedev 2025-01-27 07:49:58 +01:00
parent fa1edc0995
commit 6b248c9097
4 changed files with 64 additions and 38 deletions

View file

@ -7,19 +7,33 @@
username,
inputs,
...
}: let
in {
}:
let
in
{
imports =
[
./modules/fastfetch
./modules/tmux/home.nix
]
++ lib.optional (hwconfig.useImpermanence) (import ./modules/impermanence/home.nix {
inherit username;
inherit inputs;
})
++ lib.optional (config.programs.hyprland.enable) ./modules/hyprland/home.nix
++ lib.optional (builtins.pathExists ./homes/${username}) (import ./homes/${username} {inherit username;});
++ lib.optional (hwconfig.useImpermanence) (
import ./modules/impermanence/home.nix {
inherit username;
inherit inputs;
}
)
++ lib.optional (config.programs.hyprland.enable) (
import ./modules/hyprland/home.nix {
inherit pkgs;
inherit username;
inherit inputs;
inherit hwconfig;
inherit lib;
}
)
++ lib.optional (builtins.pathExists ./homes/${username}) (
import ./homes/${username} { inherit username; }
);
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = username;

View file

@ -4,20 +4,21 @@
lib,
inputs,
...
}: let
emacs = pkgs.emacs; #pkgs.emacs-pgtk;
in {
}:
let
emacs = pkgs.emacs-pgtk; # pkgs.emacs; #pkgs.emacs-pgtk;
in
{
#services.emacs.enable = true;
services.emacs.startWithGraphical = true;
#services.emacs.install = true;
services.emacs.package = emacs; #pkgs.emacs-unstable
services.emacs.package = emacs; # pkgs.emacs-unstable
environment.systemPackages =
(import ./packages.nix {
inherit pkgs;
inherit emacs;
})
.packages;
}).packages;
nixpkgs.overlays = [
inputs.emacs-overlay.overlays.default
];

View file

@ -1,7 +1,18 @@
{ ... }:
{
imports = [
./hyprland.nix
#../kando
];
pkgs,
username,
lib,
hwconfig,
...
}:
{
imports = [
(import ./hyprland.nix {
inherit pkgs;
inherit lib;
inherit hwconfig;
inherit username;
})
#../kando
];
}

View file

@ -4,10 +4,12 @@
hwconfig,
username,
...
}: let
}:
let
toggle_monitors = ./toggle_monitors.sh;
wallpaper-image = ./wallpaper.jpg;
in {
in
{
imports = [
./waybar.nix
./hyprlock.nix
@ -18,15 +20,15 @@ in {
xwayland.enable = true;
settings = {
monitor =
if hwconfig.hostname == "kylekrein-homepc"
then [
"DP-1,2560x1440@75,1600x0,1.6"
"DP-3,2560x1440@75,0x0,1.6"
]
if hwconfig.hostname == "kylekrein-homepc" then
[
"DP-1,2560x1440@75,1600x0,1.6"
"DP-3,2560x1440@75,0x0,1.6"
]
else
[",highres,auto,1.6"]
[ ",highres,auto,1.6" ]
++ [
"FALLBACK,1920x1080@60,auto,1" #to fix crash on hyprlock https://github.com/hyprwm/hyprlock/issues/434#issuecomment-2341710088
"FALLBACK,1920x1080@60,auto,1" # to fix crash on hyprlock https://github.com/hyprwm/hyprlock/issues/434#issuecomment-2341710088
];
xwayland = {
@ -34,18 +36,14 @@ in {
};
exec-once = [
"${
if hwconfig.isLaptop
then "brightnessctl set 25%"
else ""
}"
"${if hwconfig.isLaptop then "brightnessctl set 25%" else ""}"
"dbus-update-activation-environment --systemd --all"
"${pkgs.waybar}/bin/waybar &"
"${pkgs.networkmanagerapplet}/bin/nm-applet &"
"${pkgs.swaynotificationcenter}/bin/swaync &"
"${pkgs.solaar}/bin/solaar -w hide &"
#"${pkgs.hypridle}/bin/hypridle &"
"${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 &" #https://nixos.wiki/wiki/Polkit
"${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 &" # https://nixos.wiki/wiki/Polkit
"${pkgs.clipse}/bin/clipse -listen &"
"${pkgs.swww}/bin/swww-daemon &"
"${pkgs.swww}/bin/swww img ${wallpaper-image} &"
@ -58,12 +56,14 @@ in {
"$mod" = "SUPER";
"$mainMod" = "$mod";
"$terminal" = "${pkgs.kitty}/bin/kitty";
"$fileManager" = "$terminal ${pkgs.yazi}/bin/yazi";
"$emacs" = "emacsclient -c -a 'emacs'";
"$fileManager" = "$emacs --eval '(dired \"/home/${username}\")'"; # "$terminal ${pkgs.yazi}/bin/yazi";
"$fileManager2" = "${pkgs.kdePackages.dolphin}/bin/dolphin";
"$browser" = "${pkgs.firefox}/bin/firefox";
"$menu" = "${pkgs.wofi}/bin/wofi --show drun";
"$clipboardManager" = "$terminal --class clipse -e 'clipse'";
"$makeRegionScreenshot" = "${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -w 0)\" - | ${pkgs.satty}/bin/satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush";
"$makeRegionScreenshot" =
"${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -w 0)\" - | ${pkgs.satty}/bin/satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush";
bind = [
"$mod, T, exec, $terminal"
"$mod, Q, killactive,"
@ -123,7 +123,7 @@ in {
"$mainMod, P, exec, $makeRegionScreenshot"
"$mainMod ALT, L, exec, ${pkgs.hyprlock}/bin/hyprlock"
''$mainMod, E, exec, emacsclient -c -a "send-notify 'Unable to launch Emacs. Daemon is not running'"''
''$mainMod, E, exec, $emacs''
];
bindm = [
@ -153,7 +153,7 @@ in {
#"GDK_SCALE,1.6"
#"QT_SCALE_FACTOR,1.6"
"GSK_RENDERER,ngl" #for satty until https://github.com/NixOS/nixpkgs/issues/359069 is fixed
"GSK_RENDERER,ngl" # for satty until https://github.com/NixOS/nixpkgs/issues/359069 is fixed
];
cursor = {