Noctalia used as the desktop shell

This commit is contained in:
Semere Meharena Mebrahtom 2026-07-20 02:52:14 +02:00
parent fa60f8c87e
commit dbb0caba4b
Signed by: semere
GPG key ID: 7FC937214DF30488
10 changed files with 157 additions and 157 deletions

33
flake.lock generated
View file

@ -58,10 +58,43 @@
"type": "github" "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": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"noctalia": "noctalia",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
} }
}, },

View file

@ -15,6 +15,10 @@
url = "github:0xc000022070/zen-browser-flake"; url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
noctalia = {
url = "github:noctalia-dev/noctalia/cachix";
};
}; };
outputs = outputs =
@ -23,6 +27,7 @@
nixpkgs, nixpkgs,
home-manager, home-manager,
zen-browser, zen-browser,
noctalia,
... ...
}: }:
let let
@ -41,7 +46,7 @@
in in
lib.nixosSystem { lib.nixosSystem {
system = hostConfig.system; system = hostConfig.system;
specialArgs = { inherit userVars self zen-browser; }; specialArgs = { inherit userVars self zen-browser noctalia; };
modules = [ modules = [
hostConfig.configModule hostConfig.configModule
] ]
@ -51,7 +56,7 @@
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit userVars self zen-browser; }; extraSpecialArgs = { inherit userVars self zen-browser noctalia; };
backupFileExtension = "backup"; backupFileExtension = "backup";
sharedModules = [ sharedModules = [
zen-browser.homeModules.default zen-browser.homeModules.default

View file

@ -27,6 +27,14 @@
services.power-profiles-daemon.enable = true; services.power-profiles-daemon.enable = true;
services.upower = {
enable = true;
percentageLow = 15;
percentageCritical = 5;
percentageAction = 3;
criticalPowerAction = "Hibernate";
};
services.logind = { services.logind = {
settings = { settings = {
Login = { Login = {
@ -43,6 +51,12 @@
"flakes" "flakes"
]; ];
auto-optimise-store = true; auto-optimise-store = true;
extra-substituters = [
"https://noctalia.cachix.org"
];
extra-trusted-public-keys = [
"noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4="
];
}; };
gc = { gc = {
automatic = true; automatic = true;

View file

@ -26,8 +26,7 @@ allModules
self.nixosModules.helix self.nixosModules.helix
self.nixosModules.zen-browser self.nixosModules.zen-browser
self.nixosModules.niri self.nixosModules.niri
self.nixosModules.osd self.nixosModules.noctalia
self.nixosModules.fnott
]; ];
}; };

View file

@ -31,7 +31,6 @@
hardware.graphics.enable = true; hardware.graphics.enable = true;
security.polkit.enable = true; security.polkit.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
security.pam.services.swaylock = { };
xdg.portal = { xdg.portal = {
enable = true; enable = true;
@ -55,10 +54,7 @@
pamixer pamixer
brightnessctl brightnessctl
wl-clipboard wl-clipboard
fuzzel
libnotify libnotify
fnott
wlopm
]; ];
home-manager.users."${userVars.username}" = { 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;
};
};
}; };
} }

View file

@ -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";
};
};
};
};
}

View file

@ -52,8 +52,6 @@
} }
} }
spawn-at-startup "fnott"
binds { binds {
Mod+Shift+Slash { show-hotkey-overlay; } Mod+Shift+Slash { show-hotkey-overlay; }
@ -93,10 +91,12 @@
Mod+Space { switch-preset-column-width; } Mod+Space { switch-preset-column-width; }
Mod+Return { spawn "foot"; } Mod+Return { spawn "foot"; }
Mod+D { spawn "fuzzel"; } Mod+D { spawn "noctalia" "msg" "panel-toggle" "launcher"; }
Mod+B { spawn "zen-beta"; } Mod+B { spawn "zen-beta"; }
Mod+Shift+B { spawn "noctalia" "msg" "bar-toggle"; }
Mod+E { spawn "foot" "yazi"; } 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+Shift+Q { quit; }
Mod+V { toggle-window-floating; } Mod+V { toggle-window-floating; }
@ -109,11 +109,11 @@
Mod+Comma { consume-window-into-column; } Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; } Mod+Period { expel-window-from-column; }
XF86AudioRaiseVolume { spawn "~/.config/fnott/scripts/osd.sh" "volume" "raise"; } XF86AudioRaiseVolume { spawn "noctalia" "msg" "volume-up"; }
XF86AudioLowerVolume { spawn "~/.config/fnott/scripts/osd.sh" "volume" "lower"; } XF86AudioLowerVolume { spawn "noctalia" "msg" "volume-down"; }
XF86AudioMute { spawn "~/.config/fnott/scripts/osd.sh" "volume" "mute"; } XF86AudioMute { spawn "noctalia" "msg" "volume-mute-toggle"; }
XF86MonBrightnessUp { spawn "~/.config/fnott/scripts/osd.sh" "brightness" "raise"; } XF86MonBrightnessUp { spawn "noctalia" "msg" "brightness-up"; }
XF86MonBrightnessDown { spawn "~/.config/fnott/scripts/osd.sh" "brightness" "lower"; } XF86MonBrightnessDown { spawn "noctalia" "msg" "brightness-down"; }
Print { screenshot; } Print { screenshot; }
Mod+Print { screenshot-screen; } Mod+Print { screenshot-screen; }

92
modules/noctalia.nix Normal file
View file

@ -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;
};
};
};
};
};
};
}

View file

@ -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;
};
};
}

View file

@ -32,7 +32,7 @@
# Automatically start niri on TTY 1 # Automatically start niri on TTY 1
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
exec niri exec niri-session
fi fi
''; '';