From dbb0caba4b340195b15cc0db0dc637fc0e301dc8 Mon Sep 17 00:00:00 2001 From: Semere Meharena Mebrahtom Date: Mon, 20 Jul 2026 02:52:14 +0200 Subject: [PATCH] Noctalia used as the desktop shell --- flake.lock | 33 ++++++++++++++++ flake.nix | 9 ++++- modules/core.nix | 14 +++++++ modules/default.nix | 3 +- modules/desktop.nix | 55 -------------------------- modules/fnott.nix | 32 --------------- modules/niri.nix | 18 ++++----- modules/noctalia.nix | 92 ++++++++++++++++++++++++++++++++++++++++++++ modules/osd.nix | 56 --------------------------- modules/zsh.nix | 2 +- 10 files changed, 157 insertions(+), 157 deletions(-) delete mode 100644 modules/fnott.nix create mode 100644 modules/noctalia.nix delete mode 100644 modules/osd.nix diff --git a/flake.lock b/flake.lock index 694cfd4..52953a3 100644 --- a/flake.lock +++ b/flake.lock @@ -58,10 +58,43 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1784356753, + "narHash": "sha256-zupdTm41be2fY8cexroEOGjopl3F2Gqs3gk7ieqaM3s=", + "rev": "61b7c44c4073f0b827768aff0049561b5110ea5a", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1036777.61b7c44c4073/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" + } + }, + "noctalia": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1784482325, + "narHash": "sha256-u5wnbu0UBxi3uptK8lBy4vYkWtha85vtpWDeQiLdpP8=", + "owner": "noctalia-dev", + "repo": "noctalia", + "rev": "9b54388744e6f3ac2e2dd573a64eef1540c6401c", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "ref": "cachix", + "repo": "noctalia", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", + "noctalia": "noctalia", "zen-browser": "zen-browser" } }, diff --git a/flake.nix b/flake.nix index 34b913e..8cbeefb 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,10 @@ url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + + noctalia = { + url = "github:noctalia-dev/noctalia/cachix"; + }; }; outputs = @@ -23,6 +27,7 @@ nixpkgs, home-manager, zen-browser, + noctalia, ... }: let @@ -41,7 +46,7 @@ in lib.nixosSystem { system = hostConfig.system; - specialArgs = { inherit userVars self zen-browser; }; + specialArgs = { inherit userVars self zen-browser noctalia; }; modules = [ hostConfig.configModule ] @@ -51,7 +56,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { inherit userVars self zen-browser; }; + extraSpecialArgs = { inherit userVars self zen-browser noctalia; }; backupFileExtension = "backup"; sharedModules = [ zen-browser.homeModules.default diff --git a/modules/core.nix b/modules/core.nix index 8017ebd..cc0d371 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -27,6 +27,14 @@ services.power-profiles-daemon.enable = true; + services.upower = { + enable = true; + percentageLow = 15; + percentageCritical = 5; + percentageAction = 3; + criticalPowerAction = "Hibernate"; + }; + services.logind = { settings = { Login = { @@ -43,6 +51,12 @@ "flakes" ]; auto-optimise-store = true; + extra-substituters = [ + "https://noctalia.cachix.org" + ]; + extra-trusted-public-keys = [ + "noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4=" + ]; }; gc = { automatic = true; diff --git a/modules/default.nix b/modules/default.nix index d92d8f0..90d4e55 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -26,8 +26,7 @@ allModules self.nixosModules.helix self.nixosModules.zen-browser self.nixosModules.niri - self.nixosModules.osd - self.nixosModules.fnott + self.nixosModules.noctalia ]; }; diff --git a/modules/desktop.nix b/modules/desktop.nix index cb4f05d..1db2c9d 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -31,7 +31,6 @@ hardware.graphics.enable = true; security.polkit.enable = true; programs.dconf.enable = true; - security.pam.services.swaylock = { }; xdg.portal = { enable = true; @@ -55,10 +54,7 @@ pamixer brightnessctl wl-clipboard - fuzzel libnotify - fnott - wlopm ]; home-manager.users."${userVars.username}" = { @@ -91,56 +87,5 @@ }; }; - programs.swaylock = { - enable = true; - package = pkgs.swaylock-effects; - settings = { - clock = true; - indicator = true; - screenshots = true; - effect-blur = "7x5"; - effect-vignette = "0.5:0.5"; - ring-color = "b085f5"; - key-hl-color = "5e35b1"; - line-color = "00000000"; - inside-color = "00000088"; - separator-color = "00000000"; - fade-in = 0.2; - }; - }; - - services.swayidle = { - enable = true; - events = { - before-sleep = "${pkgs.swaylock-effects}/bin/swaylock -f"; - lock = "${pkgs.swaylock-effects}/bin/swaylock -f"; - }; - timeouts = [ - { - timeout = 300; - command = "${pkgs.swaylock-effects}/bin/swaylock -f"; - } - { - timeout = 600; - command = "${pkgs.wlopm}/bin/wlopm --off '*'"; - resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; - } - { - timeout = 900; - command = "${pkgs.systemd}/bin/systemctl hibernate"; - } - ]; - }; - - services.wlsunset = { - enable = true; - latitude = "52.5"; - longitude = "13.4"; - temperature = { - day = 6500; - night = 4000; - }; - }; - }; } diff --git a/modules/fnott.nix b/modules/fnott.nix deleted file mode 100644 index d819593..0000000 --- a/modules/fnott.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - lib, - pkgs, - userVars, - ... -}: - -{ - home-manager.users."${userVars.username}" = { - services.fnott = { - enable = true; - settings = { - main = { - title-font = "JetBrainsMono Nerd Font:size=11"; - summary-font = "JetBrainsMono Nerd Font:size=11"; - body-font = "JetBrainsMono Nerd Font:size=11"; - background = "1a1a24e0"; - border-color = "b085f5ff"; - border-size = 2; - min-width = 450; - progress-bar-height = 14; - progress-color = "b085f5cc"; - padding-vertical = 12; - padding-horizontal = 16; - summary-color = "ffffffff"; - body-color = "e0e0e0ff"; - }; - }; - }; - }; -} diff --git a/modules/niri.nix b/modules/niri.nix index 5a0925c..ed777b5 100644 --- a/modules/niri.nix +++ b/modules/niri.nix @@ -52,8 +52,6 @@ } } - spawn-at-startup "fnott" - binds { Mod+Shift+Slash { show-hotkey-overlay; } @@ -93,10 +91,12 @@ Mod+Space { switch-preset-column-width; } Mod+Return { spawn "foot"; } - Mod+D { spawn "fuzzel"; } + Mod+D { spawn "noctalia" "msg" "panel-toggle" "launcher"; } Mod+B { spawn "zen-beta"; } + Mod+Shift+B { spawn "noctalia" "msg" "bar-toggle"; } Mod+E { spawn "foot" "yazi"; } - Mod+Alt+L { spawn "swaylock"; } + Mod+Ctrl+L { spawn "noctalia" "msg" "session" "lock"; } + Mod+N { spawn "noctalia" "msg" "nightlight-toggle"; } Mod+Shift+Q { quit; } Mod+V { toggle-window-floating; } @@ -109,11 +109,11 @@ Mod+Comma { consume-window-into-column; } Mod+Period { expel-window-from-column; } - XF86AudioRaiseVolume { spawn "~/.config/fnott/scripts/osd.sh" "volume" "raise"; } - XF86AudioLowerVolume { spawn "~/.config/fnott/scripts/osd.sh" "volume" "lower"; } - XF86AudioMute { spawn "~/.config/fnott/scripts/osd.sh" "volume" "mute"; } - XF86MonBrightnessUp { spawn "~/.config/fnott/scripts/osd.sh" "brightness" "raise"; } - XF86MonBrightnessDown { spawn "~/.config/fnott/scripts/osd.sh" "brightness" "lower"; } + XF86AudioRaiseVolume { spawn "noctalia" "msg" "volume-up"; } + XF86AudioLowerVolume { spawn "noctalia" "msg" "volume-down"; } + XF86AudioMute { spawn "noctalia" "msg" "volume-mute-toggle"; } + XF86MonBrightnessUp { spawn "noctalia" "msg" "brightness-up"; } + XF86MonBrightnessDown { spawn "noctalia" "msg" "brightness-down"; } Print { screenshot; } Mod+Print { screenshot-screen; } diff --git a/modules/noctalia.nix b/modules/noctalia.nix new file mode 100644 index 0000000..f731151 --- /dev/null +++ b/modules/noctalia.nix @@ -0,0 +1,92 @@ +{ + config, + lib, + pkgs, + userVars, + noctalia, + ... +}: + +{ + imports = [ + noctalia.nixosModules.default + ]; + + programs.noctalia = { + enable = true; + recommendedServices.enable = true; + }; + + home-manager.users."${userVars.username}" = { + imports = [ + noctalia.homeModules.default + ]; + + programs.noctalia = { + enable = true; + systemd.enable = true; + + settings = { + global = { + launch_apps_as_systemd_services = true; + }; + + theme = { + mode = "dark"; + source = "community"; + community_palette = "Ayu"; + }; + + bar = { + order = [ "main" ]; + main = { + enabled = true; + position = "top"; + auto_hide = false; + smart_auto_hide = true; + reserve_space = false; + # margin_ends = 0; + }; + }; + + location = { + auto_locate = false; + address = "Berlin, Germany"; + latitude = 52.5200; + longitude = 13.4050; + }; + + nightlight = { + enabled = true; + schedule = "automatic"; + }; + + battery = { + warning_threshold = 15; + }; + + idle = { + pre_action_fade_seconds = 2.0; + behavior = { + lock = { + timeout = 300; + action = "lock"; + enabled = true; + }; + screen-off = { + timeout = 600; + action = "screen_off"; + enabled = true; + }; + hibernate = { + timeout = 900; + action = "command"; + command = "systemctl hibernate"; + enabled = true; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/osd.nix b/modules/osd.nix deleted file mode 100644 index 447fd31..0000000 --- a/modules/osd.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - config, - lib, - pkgs, - userVars, - ... -}: - -{ - home-manager.users."${userVars.username}" = { - xdg.configFile."fnott/scripts/osd.sh" = { - text = '' - #!/usr/bin/env bash - # usage: osd.sh [volume|brightness] [raise|lower|mute] - - ACTION=$1 - DIRECTION=$2 - - if [ "$ACTION" = "volume" ]; then - if [ "$DIRECTION" = "raise" ]; then - pamixer -i 5 - elif [ "$DIRECTION" = "lower" ]; then - pamixer -d 5 - elif [ "$DIRECTION" = "mute" ]; then - pamixer -t - fi - - # Query state - VOLUME=$(pamixer --get-volume) - MUTED=$(pamixer --get-mute-status) - - if [ "$MUTED" = "true" ]; then - notify-send -h int:value:0 -h string:x-canonical-private-synchronous:volume -i audio-volume-muted -t 1000 "Muted" - else - notify-send -h int:value:"$VOLUME" -h string:x-canonical-private-synchronous:volume -i audio-volume-high -t 1000 "Volume: $VOLUME%" - fi - - elif [ "$ACTION" = "brightness" ]; then - if [ "$DIRECTION" = "raise" ]; then - brightnessctl set 10%+ - elif [ "$DIRECTION" = "lower" ]; then - brightnessctl set 10%- - fi - - # Query state - CURR=$(brightnessctl get) - MAX=$(brightnessctl max) - PCT=$(( (CURR * 100) / MAX )) - - notify-send -h int:value:"$PCT" -h string:x-canonical-private-synchronous:brightness -i display-brightness -t 1000 "Brightness: $PCT%" - fi - ''; - executable = true; - }; - }; -} diff --git a/modules/zsh.nix b/modules/zsh.nix index a0979e4..85b39ec 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -32,7 +32,7 @@ # Automatically start niri on TTY 1 if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then - exec niri + exec niri-session fi '';