nixos-dots

nixos dots
git clone git://popovic.xyz/nixos-dots.git
Log | Files | Refs

commit 3db2e1b8a5faca6adc9c227ac3e73543fe21591c
parent 43262263573c282b74c528f9d0538fa9f3d305e4
Author: Milutin Popovic <milutin@popovic.xyz>
Date:   Thu, 26 Mar 2026 00:35:32 +0000

add alacritty

Diffstat:
Mflake.lock | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mflake.nix | 1+
Amodules/alacitty.nix | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/niri.nix | 173++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
Mmodules/packages.nix | 3++-
5 files changed, 331 insertions(+), 29 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -267,6 +267,22 @@ "type": "indirect" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1774106199, + "narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_stable": { "locked": { "lastModified": 1772822230, @@ -282,6 +298,48 @@ "type": "indirect" } }, + "noctalia": { + "inputs": { + "nixpkgs": "nixpkgs_4", + "noctalia-qs": "noctalia-qs" + }, + "locked": { + "lastModified": 1774480350, + "narHash": "sha256-VXExNKgF6Nl/jlKItb8esSKZgIiLWGzUJfWPcRt6XZc=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "021f0026da654dd202df6df20eb0335b35192ca2", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, + "noctalia-qs": { + "inputs": { + "nixpkgs": [ + "noctalia", + "nixpkgs" + ], + "systems": "systems_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1774351986, + "narHash": "sha256-N131zILQ06ZNEvtgtjjFZ0N5qEI70rKKhCZsBcZoDH8=", + "owner": "noctalia-dev", + "repo": "noctalia-qs", + "rev": "066835ebd5daeabc86df1e62fb5fe82a51407cc0", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-qs", + "type": "github" + } + }, "root": { "inputs": { "betterfox": "betterfox", @@ -293,6 +351,7 @@ "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_3", "nixpkgs_stable": "nixpkgs_stable", + "noctalia": "noctalia", "sops-nix": "sops-nix" } }, @@ -331,6 +390,43 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "noctalia", + "noctalia-qs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772660329, + "narHash": "sha256-IjU1FxYqm+VDe5qIOxoW+pISBlGvVApRjiw/Y/ttJzY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "3710e0e1218041bbad640352a0440114b1e10428", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix @@ -11,6 +11,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware"; niri.url = "github:sodiboo/niri-flake"; + noctalia.url = "github:noctalia-dev/noctalia-shell"; betterfox.url = "github:HeitorAugustoLN/betterfox-nix"; diff --git a/modules/alacitty.nix b/modules/alacitty.nix @@ -0,0 +1,87 @@ +{ ... }: +{ + programs.alacritty = { + enable = true; + + settings = { + env.TERM = "st-256color"; + + window = { + padding = { + x = 2; + y = 2; + }; + opacity = 0.96; + }; + + font = { + normal = { + family = "Terminus"; + style = "Regular"; + }; + italic = { + family = "Terminus"; + style = "Regular"; + }; + bold_italic = { + family = "Terminus"; + style = "Bold"; + }; + size = 12; + }; + + colors = { + primary = { + background = "#000000"; + foreground = "#EEEEEE"; + }; + + cursor = { + text = "#000000"; + cursor = "#EEEEEE"; + }; + + normal = { + black = "#000000"; + red = "#ed0b0b"; + green = "#40a62f"; + yellow = "#f2e635"; + blue = "#327bd1"; + magenta = "#b30ad0"; + cyan = "#3975b8"; + white = "#EEEEEE"; + }; + + bright = { + black = "#262626"; + red = "#b55454"; + green = "#78a670"; + yellow = "#faf380"; + blue = "#68a7d4"; + magenta = "#c583d0"; + cyan = "#3975b8"; + white = "#EEEEEE"; + }; + }; + + bell = { + duration = 0; + }; # st bellvolume=0 (closest match) + + cursor = { + style = { + shape = "Block"; + }; + thickness = 0.2; # st cursorthickness=2px; approximate (Alacritty uses fraction) + }; + + selection = { + semantic_escape_chars = " "; + }; + + mouse = { + hide_when_typing = false; + }; + }; + }; +} diff --git a/modules/niri.nix b/modules/niri.nix @@ -1,41 +1,158 @@ -{ inputs, pkgs, ... }: { - imports = [ inputs.niri.homeModules.niri ]; + lib, + inputs, + pkgs, + config, + ... +}: +{ + imports = [ + inputs.niri.homeModules.niri + ]; programs.niri = { enable = true; package = pkgs.niri; - settings = { - prefer-no-csd = false; - layout = { - focus-ring = { - width = 2; + settings = + let + noctaliaPkg = inputs.noctalia.packages.${pkgs.system}.default; + noctaliaExe = lib.getExe noctaliaPkg; + in + { + prefer-no-csd = true; + binds = { + "Mod+Return".action.spawn = "alacritty"; + "Mod+C".action.spawn = "firefox"; + + "Mod+Shift+E".action.quit.skip-confirmation = true; + "Mod+Shift+Q".action.close-window = { }; + "Mod+G".action.maximize-column = { }; + "Mod+F".action.fullscreen-window = { }; + "Mod+Shift+F".action.toggle-window-floating = { }; + "Mod+Shift+C".action.center-column = { }; + + "Mod+H".action.focus-column-left = { }; + "Mod+L".action.focus-column-right = { }; + "Mod+K".action.focus-window-up = { }; + "Mod+J".action.focus-window-down = { }; + + "Mod+WheelScrollDown".action.focus-column-left = { }; + "Mod+WheelScrollUp".action.focus-column-right = { }; + "Mod+Ctrl+WheelScrollDown".action.focus-workspace-down = { }; + "Mod+Ctrl+WheelScrollUp".action.focus-workspace-up = { }; + + "Mod+Shift+H".action.move-column-left = { }; + "Mod+Shift+L".action.move-column-right = { }; + "Mod+Shift+K".action.move-window-up = { }; + "Mod+Shift+J".action.move-window-down = { }; + + "Mod+1".action.focus-workspace = "1"; + "Mod+2".action.focus-workspace = "2"; + "Mod+3".action.focus-workspace = "3"; + "Mod+4".action.focus-workspace = "4"; + "Mod+5".action.focus-workspace = "5"; + "Mod+6".action.focus-workspace = "6"; + "Mod+7".action.focus-workspace = "7"; + "Mod+8".action.focus-workspace = "8"; + "Mod+9".action.focus-workspace = "9"; + + "Mod+Shift+1".action.move-column-to-workspace = "1"; + "Mod+Shift+2".action.move-column-to-workspace = "2"; + "Mod+Shift+3".action.move-column-to-workspace = "3"; + "Mod+Shift+4".action.move-column-to-workspace = "4"; + "Mod+Shift+5".action.move-column-to-workspace = "5"; + "Mod+Shift+6".action.move-column-to-workspace = "6"; + "Mod+Shift+7".action.move-column-to-workspace = "7"; + "Mod+Shift+8".action.move-column-to-workspace = "8"; + "Mod+Shift+9".action.move-column-to-workspace = "9"; + + "Mod+F2".action.spawn-sh = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-"; + "Mod+F3".action.spawn-sh = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+"; + + "Mod+Ctrl+H".action.set-column-width = "-5%"; + "Mod+Ctrl+L".action.set-column-width = "+5%"; + "Mod+Ctrl+J".action.set-window-height = "-5%"; + "Mod+Ctrl+K".action.set-window-height = "+5%"; + + "Shift+Alt+C".action.spawn-sh = "${lib.getExe pkgs.grim} -l 0 - | ${pkgs.wl-clipboard}/bin/wl-copy"; + + "Shift+Alt+V".action.spawn-sh = + "${pkgs.wl-clipboard}/bin/wl-paste | ${lib.getExe pkgs.swappy} -f -"; + + "Shift+Alt+S".action.spawn-sh = lib.getExe ( + pkgs.writeShellApplication { + name = "screenshot"; + text = '' + ${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -w 0)" - \ + | ${pkgs.wl-clipboard}/bin/wl-copy + ''; + } + ); }; - }; - input = { - focus-follows-mouse.enable = true; - keyboard = { - xkb = { - layout = "us,de"; - model = "pc104"; - options = "grp:shifts_toggle"; + layout = { + border = { + enable = true; + width = 4; + active = { + color = "#A96C8A"; + }; + inactive = { + color = "#263238"; + }; + }; + gaps = 15; + focus-ring = { + enable = false; }; - repeat-rate = 50; - repeat-delay = 200; }; - touchpad = { - natural-scroll = false; - tap = true; + cursor.size = 16; + + workspaces = { + "1" = { }; + "2" = { }; + "3" = { }; + "4" = { }; + "5" = { }; + "6" = { }; + "7" = { }; + "8" = { }; + "9" = { }; }; - mouse = { - accel-profile = "flat"; + + xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite; + + spawn-at-startup = [ + { command = [ "${noctaliaExe}" ]; } + { + command = [ + "${lib.getExe pkgs.swaybg}" + "-i" + "${config.home.homeDirectory}/.local/share/wallpaper/TahoeNight.png" + "-m" + "fill" + ]; + } + ]; + + input = { + focus-follows-mouse.enable = true; + keyboard = { + xkb = { + layout = "us,de"; + model = "pc104"; + options = "grp:shifts_toggle"; + }; + repeat-rate = 50; + repeat-delay = 200; + }; + touchpad = { + natural-scroll = false; + tap = true; + }; + mouse = { + accel-profile = "flat"; + }; }; }; - binds = { - "Mod+Return".action.spawn = "alacritty"; - "XF86AudioRaiseVolume".action.spawn-sh = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+"; - "XF86AudioLowerVolume".action.spawn-sh = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-"; - }; - }; }; } diff --git a/modules/packages.nix b/modules/packages.nix @@ -57,11 +57,12 @@ with pkgs; ]; wayland = [ - alacritty swaybg swaylock xwayland-satellite fuzzel + wl-clipboard + grim ]; cli = [