flake.nix now only declares inputs and calls flake-parts with import-tree
over ./modules: every .nix file under modules/ is a flake-parts module.
Features are aspects (flake.modules.nixos.<name> and
flake.modules.homeManager.<name>); importing an aspect enables it, so the
my.* option modules and their enable flags are gone.
- Add the flake-parts glue: modules/flake/ (systems, shared meta data,
host construction through configurations.nixos, overlays, packages,
apps, dev shell, formatter, checks), modules/users/faumaray.nix
(meta.owner) and modules/core/{nixpkgs,home-manager,install-facts}.nix.
config.my is kept as one read-only derived option so install-system
keeps working unchanged.
- Add the aspects that are already final: secrets, ssh, hyprland,
wezterm, git, stylix, proxy-suite, gitea-runner and claude-code, and
the desktop host (modules/hosts/desktop/{host,hardware,disks}.nix).
- Port the always-on basics to the `core` aspect (nix, boot, locale,
networking, users), lanzaboote and plain systemd-boot to the
`secure-boot` and `systemd-boot` aspects, and the installer ISO to
modules/installer/iso.nix. Behaviour is unchanged; the time zone,
default locale, XKB layouts and the firewall setting now live in
modules/hosts/desktop/host.nix.
- Move the Lua files (Hyprland settings, binds, rules; Neovim init.lua)
with git mv, byte-identical.
- Add bare stubs, marked STUB, for the aspects that the next phase
ports: amd, rocm, gaming, vpn, docker, noctalia, audio, fonts, xdg,
apps, shell and neovim. The host evaluates with them, but those
features are not configured until they are ported.
- Remove lib/, overlays/, apps/, modules/nixos/, modules/home/,
modules/installer/default.nix and hosts/desktop/{default,disks,home}.nix.
- flake.lock: add flake-parts, import-tree, stylix and serena with their
transitive inputs (22 new nodes); every existing pin is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
130 lines
6.2 KiB
Lua
130 lines
6.2 KiB
Lua
-- Keybindings. Shell features (launcher, panels, media keys) go through
|
|
-- Noctalia's IPC: https://docs.noctalia.dev/noctalia/ipc/
|
|
local nix = require("nixvars")
|
|
|
|
local mainMod = "SUPER"
|
|
local ipc = "noctalia msg "
|
|
|
|
-- Binds act as if the first layout (us) were active, so they also work while
|
|
-- the Russian layout is selected.
|
|
|
|
----------------------
|
|
---- APPLICATIONS ----
|
|
----------------------
|
|
|
|
hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(nix.terminal))
|
|
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(nix.fileManager))
|
|
|
|
---------------
|
|
---- WINDOWS ----
|
|
---------------
|
|
|
|
hl.bind(mainMod .. " + Q", hl.dsp.window.close())
|
|
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen())
|
|
hl.bind(mainMod .. " + SHIFT + F", hl.dsp.window.fullscreen({ mode = "maximized" }))
|
|
hl.bind(mainMod .. " + SHIFT + Space", hl.dsp.window.float({ action = "toggle" }))
|
|
hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
|
|
hl.bind(mainMod .. " + T", hl.dsp.layout("togglesplit")) -- dwindle only
|
|
|
|
-- Emergency exit if the shell is not running.
|
|
hl.bind(mainMod .. " + SHIFT + Escape", hl.dsp.exit())
|
|
|
|
-- Move focus with mainMod + arrow keys or hjkl
|
|
hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" }))
|
|
hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" }))
|
|
hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" }))
|
|
hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" }))
|
|
hl.bind(mainMod .. " + H", hl.dsp.focus({ direction = "left" }))
|
|
hl.bind(mainMod .. " + L", hl.dsp.focus({ direction = "right" }))
|
|
hl.bind(mainMod .. " + K", hl.dsp.focus({ direction = "up" }))
|
|
hl.bind(mainMod .. " + J", hl.dsp.focus({ direction = "down" }))
|
|
|
|
-- Move the window with mainMod + SHIFT + arrow keys or hjkl
|
|
hl.bind(mainMod .. " + SHIFT + left", hl.dsp.window.move({ direction = "left" }))
|
|
hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.move({ direction = "right" }))
|
|
hl.bind(mainMod .. " + SHIFT + up", hl.dsp.window.move({ direction = "up" }))
|
|
hl.bind(mainMod .. " + SHIFT + down", hl.dsp.window.move({ direction = "down" }))
|
|
hl.bind(mainMod .. " + SHIFT + H", hl.dsp.window.move({ direction = "left" }))
|
|
hl.bind(mainMod .. " + SHIFT + L", hl.dsp.window.move({ direction = "right" }))
|
|
hl.bind(mainMod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }))
|
|
hl.bind(mainMod .. " + SHIFT + J", hl.dsp.window.move({ direction = "down" }))
|
|
|
|
-- Resize with mainMod + CTRL + arrow keys or hjkl
|
|
local resizeStep = 40
|
|
local resizeKeys = {
|
|
{ "left", "H", -resizeStep, 0 },
|
|
{ "right", "L", resizeStep, 0 },
|
|
{ "up", "K", 0, -resizeStep },
|
|
{ "down", "J", 0, resizeStep },
|
|
}
|
|
for _, r in ipairs(resizeKeys) do
|
|
local action = hl.dsp.window.resize({ x = r[3], y = r[4], relative = true })
|
|
hl.bind(mainMod .. " + CTRL + " .. r[1], action, { repeating = true })
|
|
hl.bind(mainMod .. " + CTRL + " .. r[2], action, { repeating = true })
|
|
end
|
|
|
|
-- Move/resize windows with mainMod + LMB/RMB and dragging
|
|
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
|
|
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
|
|
|
|
--------------------
|
|
---- WORKSPACES ----
|
|
--------------------
|
|
|
|
-- Switch workspaces with mainMod + [0-9]
|
|
-- Move active window to a workspace with mainMod + SHIFT + [0-9]
|
|
for i = 1, 10 do
|
|
local key = i % 10 -- 10 maps to key 0
|
|
hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }))
|
|
hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
|
|
end
|
|
|
|
-- Scratchpad (special workspace)
|
|
hl.bind(mainMod .. " + minus", hl.dsp.workspace.toggle_special("magic"))
|
|
hl.bind(mainMod .. " + SHIFT + minus", hl.dsp.window.move({ workspace = "special:magic" }))
|
|
|
|
-- Scroll through existing workspaces with mainMod + scroll
|
|
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
|
|
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
|
|
|
|
------------------
|
|
---- NOCTALIA ----
|
|
------------------
|
|
|
|
hl.bind(mainMod .. " + Space", hl.dsp.exec_cmd(ipc .. "panel-toggle launcher"))
|
|
hl.bind(mainMod .. " + S", hl.dsp.exec_cmd(ipc .. "panel-toggle control-center"))
|
|
hl.bind(mainMod .. " + comma", hl.dsp.exec_cmd(ipc .. "settings-toggle"))
|
|
hl.bind(mainMod .. " + V", hl.dsp.exec_cmd(ipc .. "panel-toggle clipboard"))
|
|
hl.bind(mainMod .. " + W", hl.dsp.exec_cmd(ipc .. "panel-toggle wallpaper"))
|
|
hl.bind(mainMod .. " + Escape", hl.dsp.exec_cmd(ipc .. "panel-toggle session"))
|
|
hl.bind(mainMod .. " + ALT + L", hl.dsp.exec_cmd(ipc .. "session lock"))
|
|
hl.bind("ALT + Tab", hl.dsp.exec_cmd(ipc .. "window-switcher hold"))
|
|
|
|
-- Volume, microphone, brightness and media keys
|
|
local held = { locked = true, repeating = true }
|
|
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd(ipc .. "volume-up"), held)
|
|
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd(ipc .. "volume-down"), held)
|
|
hl.bind("XF86AudioMute", hl.dsp.exec_cmd(ipc .. "volume-mute"), held)
|
|
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd(ipc .. "mic-mute"), held)
|
|
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd(ipc .. "brightness-up"), held)
|
|
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd(ipc .. "brightness-down"), held)
|
|
|
|
hl.bind("XF86AudioNext", hl.dsp.exec_cmd(ipc .. "media next"), { locked = true })
|
|
hl.bind("XF86AudioPause", hl.dsp.exec_cmd(ipc .. "media toggle"), { locked = true })
|
|
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd(ipc .. "media toggle"), { locked = true })
|
|
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd(ipc .. "media previous"), { locked = true })
|
|
|
|
---------------------
|
|
---- SCREENSHOTS ----
|
|
---------------------
|
|
|
|
-- grim + slurp, straight to the clipboard. Cancelling slurp aborts the capture.
|
|
hl.bind("Print", hl.dsp.exec_cmd('geometry=$(slurp) && grim -g "$geometry" - | wl-copy'))
|
|
hl.bind("SHIFT + Print", hl.dsp.exec_cmd("grim - | wl-copy"))
|
|
-- Region to ~/Pictures/Screenshots and the clipboard.
|
|
hl.bind("CTRL + Print", hl.dsp.exec_cmd(
|
|
'dir="$HOME/Pictures/Screenshots"; mkdir -p "$dir" && geometry=$(slurp) && ' ..
|
|
'file="$dir/$(date +%F_%H-%M-%S).png" && grim -g "$geometry" "$file" && wl-copy < "$file"'))
|
|
-- Noctalia's own region capture with the annotation editor.
|
|
hl.bind(mainMod .. " + Print", hl.dsp.exec_cmd(ipc .. "screenshot-region"))
|