wip: switch to niri
Some checks failed
/ check (nvimDev) (push) Successful in 5s
/ check (nvimHeadless) (push) Successful in 2s
/ check (nvimNoBundledBins) (push) Successful in 4s
/ check (nvimNoLsp) (push) Successful in 5s
/ check (nvimNoTSGrammars) (push) Successful in 5s
/ check (treefmt) (push) Successful in 2s
/ check-renovaterc (push) Successful in 2s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 3s
/ build (jpassmenu) (push) Successful in 1s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Failing after 4s
/ build (nvim) (push) Successful in 8s
/ report-size (push) Has been skipped
Some checks failed
/ check (nvimDev) (push) Successful in 5s
/ check (nvimHeadless) (push) Successful in 2s
/ check (nvimNoBundledBins) (push) Successful in 4s
/ check (nvimNoLsp) (push) Successful in 5s
/ check (nvimNoTSGrammars) (push) Successful in 5s
/ check (treefmt) (push) Successful in 2s
/ check-renovaterc (push) Successful in 2s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 3s
/ build (jpassmenu) (push) Successful in 1s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Failing after 4s
/ build (nvim) (push) Successful in 8s
/ report-size (push) Has been skipped
Looks cooler c:
This commit is contained in:
parent
7dab7eb1dc
commit
ff771c3db2
8 changed files with 179 additions and 51 deletions
|
@ -158,13 +158,55 @@ in
|
|||
};
|
||||
|
||||
# Window Manager
|
||||
wayland.windowManager.sway = {
|
||||
inherit (cfg.sway) enable;
|
||||
package = swayPkg; # no sway package if it comes from the OS
|
||||
config = import ./sway-config.nix { inherit config pkgs; };
|
||||
systemd = {
|
||||
enable = true;
|
||||
xdgAutostart = true;
|
||||
programs.niri = {
|
||||
package = pkgs.niri; # use nixpkgs' package instead of the flake's
|
||||
settings = {
|
||||
binds =
|
||||
let
|
||||
# Modifier key
|
||||
mod = "Mod";
|
||||
# Available workspaces (1..=9)
|
||||
workspaces = lib.range 1 9;
|
||||
# Run function for each workspace
|
||||
perWorkspace = f: lib.mergeAttrsList (builtins.map f workspaces);
|
||||
in
|
||||
with config.lib.niri.actions;
|
||||
{
|
||||
# Open Terminal
|
||||
"${mod}+Return".action.spawn = config.jhome.gui.terminalCommand;
|
||||
# Open menu
|
||||
"${mod}+D".action =
|
||||
spawn "${lib.getExe pkgs.fuzzel}" "--terminal"
|
||||
"${builtins.concatStringSep " " terminalCommand}";
|
||||
# Close Window
|
||||
"${mod}+Q".action = close-window;
|
||||
# Fullscreen
|
||||
"${mod}+F".action = fullscreen-window;
|
||||
# Hotkey help menu
|
||||
"${mod}+Shift+/".action = show-hotkey-overlay;
|
||||
# Media Keys
|
||||
"XF86AudioRaiseVolume" = {
|
||||
action = spawn "${pkgs.avizo}/bin/volumectl" "up";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioLowerVolume" = {
|
||||
action = spawn "${pkgs.avizo}/bin/volumectl" "down";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioMute" = {
|
||||
action = spawn "${pkgs.avizo}/bin/volumectl" "toggle-mute";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
# Lock screen
|
||||
"XF86ScreenSaver".action = spawn "swaylock" "--image" "${cfg.background}";
|
||||
# Screen brightness
|
||||
"XF86MonBrightnessUp".action = spawn "${pkgs.avizo}/bin/lightctl" "up";
|
||||
"XF86MonBrightnessDown".action = spawn "${pkgs.avizo}/bin/lightctl" "down";
|
||||
}
|
||||
// perWorkspace (workspace: {
|
||||
# Focus workspace N
|
||||
"${mod}+${builtins.toString workspace}".action = focus-workspace workspace;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -2,14 +2,7 @@
|
|||
let
|
||||
cfg = config.jhome.gui.sway;
|
||||
modifier = "Mod4";
|
||||
inherit (config.jhome.gui) terminal;
|
||||
termCmd =
|
||||
if terminal == "wezterm" then
|
||||
"wezterm start"
|
||||
else if terminal == "alacritty" then
|
||||
"alacritty -e"
|
||||
else
|
||||
builtins.abort "no command configured for ${terminal}";
|
||||
termCmd = builtins.concatStringsSep " " config.jhome.gui.terminalCommand;
|
||||
menu = "${pkgs.fuzzel}/bin/fuzzel --terminal '${termCmd}'";
|
||||
# currently, there is some friction between sway and gtk:
|
||||
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
|
||||
|
@ -46,7 +39,8 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
inherit modifier terminal menu;
|
||||
inherit (config.jhome.gui) terminal;
|
||||
inherit modifier menu;
|
||||
keybindings = import ./keybindings.nix { inherit config pkgs; };
|
||||
# Appearance
|
||||
bars = [ ]; # Waybar is started as a systemd service
|
||||
|
|
|
@ -136,33 +136,58 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
gui.options = {
|
||||
enable = lib.mkEnableOption "GUI applications" // {
|
||||
default = fromConfig [
|
||||
"gui"
|
||||
"enable"
|
||||
] false;
|
||||
gui.options =
|
||||
let
|
||||
cfg = attrs.config.jhome.gui;
|
||||
in
|
||||
{
|
||||
enable = lib.mkEnableOption "GUI applications" // {
|
||||
default = fromConfig [
|
||||
"gui"
|
||||
"enable"
|
||||
] false;
|
||||
};
|
||||
tempInfo = lib.mkOption {
|
||||
description = "Temperature info to display in the statusbar.";
|
||||
default = null;
|
||||
type = types.nullOr (types.submodule tempInfo);
|
||||
};
|
||||
sway = lib.mkOption {
|
||||
description = "Sway window manager configuration.";
|
||||
default = { };
|
||||
type = types.submodule sway;
|
||||
};
|
||||
terminal = lib.mkOption {
|
||||
description = "The terminal emulator to use.";
|
||||
default = "alacritty";
|
||||
example = "wezterm";
|
||||
type = types.enum [
|
||||
"wezterm"
|
||||
"alacritty"
|
||||
];
|
||||
};
|
||||
terminalCommand = lib.mkOption {
|
||||
description = "The command to run in order to start the terminal.";
|
||||
default =
|
||||
if cfg.terminal == "wezterm" then
|
||||
[
|
||||
"wezterm"
|
||||
"start"
|
||||
]
|
||||
else if cfg.terminal == "alacritty" then
|
||||
[
|
||||
"alacritty"
|
||||
"-e"
|
||||
]
|
||||
else
|
||||
builtins.abort "no command configured for ${cfg.terminal}";
|
||||
example = [
|
||||
"wezterm"
|
||||
"start"
|
||||
];
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
};
|
||||
tempInfo = lib.mkOption {
|
||||
description = "Temperature info to display in the statusbar.";
|
||||
default = null;
|
||||
type = types.nullOr (types.submodule tempInfo);
|
||||
};
|
||||
sway = lib.mkOption {
|
||||
description = "Sway window manager configuration.";
|
||||
default = { };
|
||||
type = types.submodule sway;
|
||||
};
|
||||
terminal = lib.mkOption {
|
||||
description = "The terminal emulator to use.";
|
||||
default = "alacritty";
|
||||
example = "wezterm";
|
||||
type = types.enum [
|
||||
"wezterm"
|
||||
"alacritty"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.jhome = lib.mkOption {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue