From 530c67601a4c84f003d0d18e60a34a1128705c6e Mon Sep 17 00:00:00 2001 From: bogale Date: Sat, 10 Oct 2026 16:34:47 +0900 Subject: [PATCH] configured noctalia --- common.nix | 2 +- desktop/configuration.nix | 13 ++- flake.lock | 12 +-- home/bogale.nix | 84 +---------------- home/common.nix | 4 +- home/mods/niri.kdl | 74 +++++++++++++++ home/mods/noctalia.toml | 190 ++++++++++++++++++++++++++++++++++++++ home/root.nix | 5 + server/configuration.nix | 36 ++++---- server/mods/system.nix | 4 +- 10 files changed, 312 insertions(+), 112 deletions(-) create mode 100644 home/mods/niri.kdl create mode 100644 home/mods/noctalia.toml diff --git a/common.nix b/common.nix index 79ebd8e..f3fd890 100644 --- a/common.nix +++ b/common.nix @@ -7,7 +7,7 @@ swapDevices = [ { device = "/var/swapfile"; } ]; users.users.root.hashedPasswordFile = "/secrets/user/root-pw"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - environment.systemPackages = with pkgs; [ jq _7zz sbctl openssl ]; + environment.systemPackages = with pkgs; [ jq _7zz sbctl openssl python314 ]; fileSystems = { "/".options = [ "noatime" ]; "/boot".options = [ "noatime" ]; diff --git a/desktop/configuration.nix b/desktop/configuration.nix index 92a31d3..a2622fa 100644 --- a/desktop/configuration.nix +++ b/desktop/configuration.nix @@ -11,9 +11,10 @@ }; networking = { hostName = "nixos-desktop"; + firewall.allowedTCPPorts = [ 8000 ]; wg-quick.interfaces.awg0 = { configFile = "/secrets/awg/2.conf"; - address = [ "fc00::3/128" "10.0.0.3/32" ]; + address = [ "10.0.0.3/32" "fc00::3/128" ]; }; networkmanager.ensureProfiles.profiles.wifi = { wifi.ssid = "bogale_5"; @@ -24,7 +25,6 @@ }; services = { tuned.enable = true; - displayManager.noctalia-greeter.enable = true; pipewire = { enable = true; pulse.enable = true; @@ -42,5 +42,14 @@ command = "${pkgs.noctalia-greeter}/bin/noctalia-greeter-session -- --session niri --user bogale"; }; }; + displayManager.noctalia-greeter = { + enable = true; + settings.cursor.size = 24; + passwordlessSyncUsers = [ "bogale" ]; + cursorTheme = { + name = "Bibata-Modern-Amber"; + package = pkgs.bibata-cursors; + }; + }; }; } diff --git a/flake.lock b/flake.lock index 8dae76d..f46c202 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1789618856, - "narHash": "sha256-OSqj7eOijvCZfN7owFWRxLWRhej5lZI+Kt82q3INLvc=", + "lastModified": 1791600313, + "narHash": "sha256-/2gb2WTztITD/JU1XUCg63vDsIfJGLr0LDsjSCTTJc8=", "owner": "nix-community", "repo": "home-manager", - "rev": "afa6821c70560bb19d1a8c577bff398f7f239869", + "rev": "427c74a88a93cc9f856c8bb99bf6b4a5187a6b33", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1789546076, - "narHash": "sha256-zVxLZiSnmaaPLwnhj7pwmqe3axBg/C6nG5JZsJMh2g4=", + "lastModified": 1791456040, + "narHash": "sha256-H83yz/do+hjOO0uujHyH8RgtIQP2v7Mw+cLwcZK/xKc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b1b875982b17dabde9b4a37f3e229e74913e6db3", + "rev": "e7439b6b14ad3cc35d05608ebca9bce01a25f5f8", "type": "github" }, "original": { diff --git a/home/bogale.nix b/home/bogale.nix index 43d5225..6e520cc 100644 --- a/home/bogale.nix +++ b/home/bogale.nix @@ -1,21 +1,19 @@ { config, pkgs, ... }: { imports = [ ./common.nix ]; - gtk = { - enable = true; - colorScheme = "dark"; - }; + wayland.windowManager.niri.enable = true; + xdg.configFile."niri/config.kdl".source = ./mods/niri.kdl; home = { username = "bogale"; homeDirectory = "/home/bogale"; - packages = with pkgs; [ bibata-cursors brave-origin ]; + packages = with pkgs; [ bluez brave-origin libqalculate bibata-cursors ]; }; programs = { alacritty.enable = true; noctalia = { enable = true; systemd.enable = true; - #launch_apps_as_systemd_services + settings = ./mods/noctalia.toml; }; }; services.gammastep = { @@ -31,78 +29,4 @@ brightness-night = 0.6; }; }; - wayland.windowManager.niri = { - enable = true; - settings = { - gestures.hot-corners.off = {}; - binds."Mod+T".spawn = "alacritty"; - hotkey-overlay.skip-at-startup = {}; - screenshot-path = "~/Multimedia/Screenshots/%Y-%m-%d_%H-%M-%S.png"; - cursor = { - xcursor-size = 24; - xcursor-theme = "Bibata-Modern-Amber"; - }; - layout = { - center-focused-column = "always"; - default-column-width.proportion = 0.8; - }; - window-rule = { - open-floating = false; - clip-to-geometry = true; - geometry-corner-radius = 24; - }; - input = { - touchpad = { - dwt = {}; - tap = {}; - natural-scroll = {}; - }; - keyboard = { - numlock = {}; - xkb = { - layout = "us,ru"; - options = "grp:alt_shift_toggle"; - }; - }; - }; - binds = { - "Print".screenshot = {}; - "Mod+Q".close-window = {}; - "Mod+F".maximize-column = {}; - "Mod+O".toggle-overview = {}; - "Mod+H".focus-column-left = {}; - "Mod+L".focus-column-right = {}; - "Alt+Print".screenshot-window = {}; - "Mod+Ctrl+K".focus-monitor-up = {}; - "Ctrl+Print".screenshot-screen = {}; - "Mod+Shift+H".move-column-left = {}; - "Mod+Ctrl+H".focus-monitor-left = {}; - "Mod+Ctrl+J".focus-monitor-down = {}; - "Mod+Shift+F".fullscreen-window = {}; - "Mod+Shift+L".move-column-right = {}; - "Mod+Ctrl+L".focus-monitor-right = {}; - "Mod+Shift+P".power-off-monitors = {}; - "Mod+K".focus-window-or-workspace-up = {}; - "Mod+J".focus-window-or-workspace-down = {}; - "Mod+Ctrl+Shift+K".move-column-to-monitor-up = {}; - "Mod+Ctrl+Shift+H".move-column-to-monitor-left = {}; - "Mod+Ctrl+Shift+J".move-column-to-monitor-down = {}; - "Mod+Ctrl+Shift+L".move-column-to-monitor-right = {}; - "Mod+Shift+K".move-window-up-or-to-workspace-up = {}; - "Mod+Shift+S".spawn-sh = "noctalia msg settings-open"; - "XF86AudioMute".spawn-sh = "noctalia msg volume-mute"; - "Mod+E".spawn-sh = "noctalia msg panel-toggle session"; - "Mod+D".spawn-sh = "noctalia msg panel-toggle launcher"; - "Mod+Shift+J".move-window-down-or-to-workspace-down = {}; - "Shift+XF86AudioMute".spawn-sh = "noctalia msg mic-mute"; - "XF86AudioRaiseVolume".spawn-sh = "noctalia msg volume-up"; - "XF86AudioLowerVolume".spawn-sh = "noctalia msg volume-down"; - "Mod+S".spawn-sh = "noctalia msg panel-toggle control-center"; - "XF86MonBrightnessUp".spawn-sh = "noctalia msg brightness-up"; - "XF86MonBrightnessDown".spawn-sh = "noctalia msg brightness-down"; - "Shift+XF86AudioRaiseVolume".spawn-sh = "noctalia msg mic-volume-up"; - "Shift+XF86AudioLowerVolume".spawn-sh = "noctalia msg mic-volume-down"; - }; - }; - }; } diff --git a/home/common.nix b/home/common.nix index ed39198..f138fc8 100644 --- a/home/common.nix +++ b/home/common.nix @@ -32,10 +32,10 @@ enable = true; defaultEditor = true; extraConfig = '' + set number + set expandtab set tabstop=4 set shiftwidth=4 - set expandtab - set number set relativenumber autocmd FileType nix set tabstop=2 shiftwidth=2 ''; diff --git a/home/mods/niri.kdl b/home/mods/niri.kdl new file mode 100644 index 0000000..e6ea619 --- /dev/null +++ b/home/mods/niri.kdl @@ -0,0 +1,74 @@ +include "./noctalia.kdl"; +gestures { hot-corners { off; }; }; +hotkey-overlay { skip-at-startup; }; +screenshot-path "~/Multimedia/Screenshots/%Y-%m-%d_%H-%M-%S.png"; +cursor { + xcursor-size 24; + xcursor-theme "Bibata-Modern-Amber"; +}; +layout { + center-focused-column "always"; + default-column-width { proportion 0.8; }; +}; +window-rule { + open-floating false; + clip-to-geometry true; + geometry-corner-radius 24; +}; +input { + touchpad { + dwt; + tap; + natural-scroll; + }; + keyboard { + numlock; + xkb { + layout "us,ru"; + options "grp:alt_shift_toggle"; + }; + }; +}; +binds { + Mod+T { spawn "alacritty"; }; + Mod+D { spawn-sh "noctalia msg panel-toggle launcher"; }; + Mod+E { spawn-sh "noctalia msg panel-toggle session"; }; + Mod+S { spawn-sh "noctalia msg panel-toggle control-center"; }; + Mod+Shift+S { spawn-sh "noctalia msg settings-open"; }; + + Mod+H { focus-column-left; }; + Mod+J { focus-window-or-workspace-down; }; + Mod+K { focus-window-or-workspace-up; }; + Mod+L { focus-column-right; }; + Mod+Shift+H { move-column-left; }; + Mod+Shift+J { move-window-down-or-to-workspace-down; }; + Mod+Shift+K { move-window-up-or-to-workspace-up; }; + Mod+Shift+L { move-column-right; }; + + Mod+Ctrl+H { focus-monitor-left; }; + Mod+Ctrl+J { focus-monitor-down; }; + Mod+Ctrl+K { focus-monitor-up; }; + Mod+Ctrl+L { focus-monitor-right; }; + Mod+Ctrl+Shift+H { move-column-to-monitor-left; }; + Mod+Ctrl+Shift+J { move-column-to-monitor-down; }; + Mod+Ctrl+Shift+K { move-column-to-monitor-up; }; + Mod+Ctrl+Shift+L { move-column-to-monitor-right; }; + + XF86MonBrightnessUp { spawn-sh "noctalia msg brightness-up"; }; + XF86MonBrightnessDown { spawn-sh "noctalia msg brightness-down"; }; + XF86AudioRaiseVolume { spawn-sh "noctalia msg volume-up"; }; + XF86AudioLowerVolume { spawn-sh "noctalia msg volume-down"; }; + XF86AudioMute { spawn-sh "noctalia msg volume-mute"; }; + Shift+XF86AudioRaiseVolume { spawn-sh "noctalia msg mic-volume-up"; }; + Shift+XF86AudioLowerVolume { spawn-sh "noctalia msg mic-volume-down"; }; + Shift+XF86AudioMute { spawn-sh "noctalia msg mic-mute"; }; + + Mod+O { toggle-overview; }; + Mod+Q { close-window; }; + Mod+F { maximize-column; }; + Mod+Shift+F { fullscreen-window; }; + Mod+Shift+P { power-off-monitors; }; + Print { screenshot; }; + Alt+Print { screenshot-window; }; + Ctrl+Print { screenshot-screen; }; +}; diff --git a/home/mods/noctalia.toml b/home/mods/noctalia.toml new file mode 100644 index 0000000..e0e74a3 --- /dev/null +++ b/home/mods/noctalia.toml @@ -0,0 +1,190 @@ +[bar] +order = [ "default" ] + + [bar.default] + center = [ "workspaces" ] + end = [ "tray", "notifications", "battery", "keyboard_layout" ] + margin_ends = 0 + start = [ "date", "clock", "sysmon" ] + widget_spacing = 12 + + [bar.default.dead_zone.actions] + right = "none" + +[control_center] +hidden_tabs = [ "media", "audio", "monitor", "notifications" ] + + [[control_center.shortcuts]] + type = "wifi" + + [[control_center.shortcuts]] + type = "bluetooth" + + [[control_center.shortcuts]] + type = "caffeine" + + [[control_center.shortcuts]] + type = "notification" + + [[control_center.shortcuts]] + type = "power_profile" + +[desktop_widgets] +enabled = false +schema_version = 2 +widget_order = [] + + [desktop_widgets.grid] + cell_size = 16 + major_interval = 4 + visible = true + + [desktop_widgets.widget] + +[idle] +behavior_order = [ "screen-off", "lock", "lock-and-suspend" ] + + [idle.behavior.lock] + action = "lock" + enabled = true + timeout = 600.0 + + [idle.behavior.lock-and-suspend] + action = "lock_and_suspend" + enabled = true + timeout = 900.0 + + [idle.behavior.screen-off] + action = "screen_off" + enabled = true + timeout = 300.0 + +[location] +address = "Chita" + +[lockscreen] +fingerprint = false + +[lockscreen_widgets] +enabled = false +schema_version = 2 +widget_order = [ "lockscreen-login-box@eDP-1" ] + + [lockscreen_widgets.grid] + cell_size = 16 + major_interval = 4 + visible = true + + [lockscreen_widgets.widget."lockscreen-login-box@eDP-1"] + box_height = 196.0 + box_width = 810.0 + cx = 960.0 + cy = 898.0 + output = "eDP-1" + placement_height = 1080.0 + placement_width = 1920.0 + rotation = 0.0 + type = "login_box" + + [lockscreen_widgets.widget."lockscreen-login-box@eDP-1".settings] + background_color = "surface_variant" + background_opacity = 0.88 + background_radius = 12.0 + center_password_text = false + input_opacity = 1.0 + input_radius = 6.0 + layout = "regular" + show_caps_lock = true + show_keyboard_layout = true + show_login_button = true + show_media = true + show_session_buttons = true + show_unlock_hint = true + show_weather = true + +[notification] +history_retention_hours = 8 +layer = "overlay" + +[osd.kinds] +bluetooth = false +caffeine = false +dnd = false +keyboard_backlight = false +keyboard_layout = false +media = false +nightlight = false +power_profile = false +wifi = false + +[shell] +clipboard_enabled = false +launch_apps_as_systemd_services = true +screen_time_enabled = true + + [shell.greeter_sync] + auto_sync = true + + [shell.screen_corners] + enabled = true + + [[shell.session.actions]] + action = "lock" + countdown_seconds = 0.0 + enabled = true + shortcut = "1" + variant = "default" + + [[shell.session.actions]] + action = "lock_and_suspend" + countdown_seconds = 0.0 + enabled = true + shortcut = "2" + variant = "default" + + [[shell.session.actions]] + action = "command" + command = "systemctl hibernate" + countdown_seconds = 0.0 + enabled = true + glyph = "hibernate" + label = "Гибернация" + shortcut = "3" + variant = "default" + + [[shell.session.actions]] + action = "reboot" + countdown_seconds = 0.0 + enabled = true + shortcut = "4" + variant = "default" + + [[shell.session.actions]] + action = "shutdown" + countdown_seconds = 0.0 + enabled = true + shortcut = "5" + variant = "default" + +[theme] +builtin = "Tokyo-Night" + + [theme.templates] + builtin_ids = [ "alacritty", "gtk3", "gtk4", "kcolorscheme", "niri", "qt" ] + enable_community_templates = false + +[wallpaper] +directory = "/home/bogale/Multimedia/Wallpapers" +transition_on_startup = true + + [wallpaper.default] + path = "/home/bogale/Multimedia/Wallpapers/main.jpg" + + [wallpaper.last] + path = "/home/bogale/Multimedia/Wallpapers/main.jpg" + + [wallpaper.monitors.eDP-1] + path = "/home/bogale/Multimedia/Wallpapers/main.jpg" + +[weather] +refresh_minutes = 10 diff --git a/home/root.nix b/home/root.nix index 76e6ac2..cab8b6f 100644 --- a/home/root.nix +++ b/home/root.nix @@ -5,4 +5,9 @@ username = "root"; homeDirectory = "/root"; }; + programs.bash.initExtra = '' + session() { + systemd-run -tGM $1@ --user --wait $SHELL + } + ''; } diff --git a/server/configuration.nix b/server/configuration.nix index 3cbc2f3..692aa35 100644 --- a/server/configuration.nix +++ b/server/configuration.nix @@ -26,6 +26,23 @@ reloadServices = [ "nginx.service" "dovecot.service" "postfix.service" ]; }; }; + networking = { + hostName = "nixos-server"; + firewall = { + allowedUDPPorts = [ 443 ]; + allowedTCPPorts = [ 25 80 443 465 993 ]; + }; + wg-quick.interfaces.awg0 = { + configFile = "/secrets/awg/1.conf"; + address = [ "10.0.0.2/32" "fc00::2/128" ]; + }; + networkmanager.ensureProfiles.profiles.wifi = { + wifi.ssid = "bogale_2.4"; + ipv6.addresses = "fc01::2/64"; + ipv4.addresses = "10.1.0.2/16"; + wifi-security.psk = "$BOGALE_2_4_PSK"; + }; + }; users = { groups = { php.gid = 1568; @@ -33,7 +50,7 @@ }; users = { nginx.extraGroups = [ "php" "acme" ]; - root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+wc+3rahpNa+OMS9gaWgMQIxXIKHy4Beku5LBDt+Ow" ]; + root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTb4c1ISQSV34GN27GgaJ08jpiRM3Wul/iSWjQ6emTq" ]; php = { uid = 1568; group = "php"; @@ -46,21 +63,4 @@ }; }; }; - networking = { - hostName = "nixos-server"; - firewall = { - allowedUDPPorts = [ 443 ]; - allowedTCPPorts = [ 25 80 443 465 993 ]; - }; - wg-quick.interfaces.awg0 = { - configFile = "/secrets/awg/1.conf"; - address = [ "fc00::2/128" "10.0.0.2/32" ]; - }; - networkmanager.ensureProfiles.profiles.wifi = { - wifi.ssid = "bogale_2.4"; - ipv6.addresses = "fc01::2/64"; - ipv4.addresses = "10.1.0.2/16"; - wifi-security.psk = "$BOGALE_2_4_PSK"; - }; - }; } diff --git a/server/mods/system.nix b/server/mods/system.nix index 9b78ca9..0e0ecda 100644 --- a/server/mods/system.nix +++ b/server/mods/system.nix @@ -6,9 +6,7 @@ exporters.node.enable = true; scrapeConfigs = [ { job_name = "node"; - static_configs = [ { targets = [ - "localhost:${toString config.services.prometheus.exporters.node.port}" - ]; } ]; + static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; } ]; } ]; }; grafana = {