Compare commits

..

8 commits

8 changed files with 105 additions and 21 deletions

View file

@ -15,10 +15,6 @@
programs = {
fzf.enable = true;
hyfetch.enable = true;
yazi = {
enable = true;
enableFishIntegration = true;
};
};
# miscellaneous programs that do not need to be configured

View file

@ -8,14 +8,19 @@
terminal = "foot";
browser = "firefox";
prefix = "Alt";
guiFileManager = "nautilus";
cliFileManager = "yazi";
in {
programs.niri.settings.binds = {
"${prefix}+D".action.spawn = appLauncher;
"${prefix}+Return".action.spawn = terminal;
"${prefix}+W".action.spawn = browser;
"${prefix}+Shift+E".action.quit.skip-confirmation = true;
"${prefix}+E".action.spawn = guiFileManager;
"${prefix}+Shift+E".action.spawn = [terminal "-e" cliFileManager];
"${prefix}+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay;
"${prefix}+Q".action = config.lib.niri.actions.close-window;
"${prefix}+Shift+Q".action.quit.skip-confirmation = true;
"${prefix}+F".action = config.lib.niri.actions.maximize-column;
"${prefix}+Shift+F".action = config.lib.niri.actions.fullscreen-window;
"${prefix}+C".action = config.lib.niri.actions.center-column;
@ -157,5 +162,7 @@ in {
"XF86AudioMedia" = {
action.spawn = ["sh" "-c" "env XDG_CURRENT_DESKTOP=gnome gnome-control-center"];
};
"XF86PowerOff".action.spawn = "wlogout";
};
}

View file

@ -26,9 +26,12 @@ in {
programs.niri = {
settings = {
input.keyboard.xkb = {
layout = "us";
options = "compose:ralt";
input = {
power-key-handling.enable = false;
keyboard.xkb = {
layout = "us";
options = "compose:ralt";
};
};
prefer-no-csd = true;
@ -117,4 +120,64 @@ in {
Restart = "on-failure";
};
};
programs.wlogout = {
enable = true;
layout = let
systemd = let
systemd = lib.getExe' pkgs.systemd;
in {
loginctl = systemd "loginctl";
systemctl = systemd "systemctl";
};
in [
{
action = "${systemd.loginctl} lock-session";
keybind = "l";
label = "lock";
text = "Lock";
}
{
action = "${systemd.systemctl} hibernate";
keybind = "h";
label = "hibernate";
text = "Hibernate";
}
{
action = "${
systemd.loginctl
} terminate-user ${
config.home.username
}";
keybind = "q";
label = "logout";
text = "Logout";
}
{
action = "${systemd.systemctl} poweroff";
keybind = "p";
label = "shutdown";
text = "Shutdown";
}
{
action = "${systemd.systemctl} suspend";
keybind = "s";
label = "suspend";
text = "Suspend";
}
{
action = "${systemd.systemctl} reboot";
keybind = "r";
label = "reboot";
text = "Reboot";
}
];
};
}

View file

@ -4,8 +4,8 @@
./gnupg.nix
./tmux.nix
./direnv.nix
./zellij.nix
./nix-index.nix
./yazi.nix
];
home.packages = with pkgs; [

View file

@ -0,0 +1,26 @@
{pkgs, ...}: {
programs.yazi = let
# https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11
mkYaziPlugin = name: text: {
"${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi";
};
in {
enable = true;
enableFishIntegration = true;
plugins = mkYaziPlugin "smart-enter" ''
return {
entry = function()
local h = cx.active.current.hovered
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true })
end,
}
'';
keymap.manager.prepend_keymap = [
{
on = "l";
run = "plugin --sync smart-enter";
desc = "Enter the child directory, or open the file";
}
];
};
}

View file

@ -1,8 +0,0 @@
{
programs.zellij = {
enable = true;
settings = {
pane_frames = false;
};
};
}

View file

@ -1,5 +1,9 @@
{
services.logind = {
lidSwitch = "suspend";
extraConfig = ''
HandlePowerKey=ignore
HandlePowerKeyLongPress=poweroff
'';
};
}

View file

@ -1,9 +1,5 @@
{
services = {
logind.extraConfig = ''
HandlePowerKey=suspend
'';
power-profiles-daemon.enable = true;
# battery info