From 66098ab891b531b9463793bf1b811529c0871cdb Mon Sep 17 00:00:00 2001 From: EdenQwQ Date: Wed, 15 Oct 2025 08:43:13 +0800 Subject: [PATCH] add noctalia-shell --- flake.lock | 101 ++++++++++------ flake.nix | 18 ++- home/default.nix | 3 + home/programs/desktop/default.nix | 1 + home/programs/desktop/niri/autostart.nix | 2 + home/programs/desktop/noctalia.nix | 139 +++++++++++++++++++++++ home/programs/desktop/swhkd.nix | 9 +- home/tweaks/default.nix | 2 +- hosts/default.nix | 1 + modules/home-manager/desktop-shell.nix | 4 + 10 files changed, 244 insertions(+), 36 deletions(-) create mode 100644 home/programs/desktop/noctalia.nix diff --git a/flake.lock b/flake.lock index fb8dc97..642272f 100644 --- a/flake.lock +++ b/flake.lock @@ -161,7 +161,9 @@ "dgop": "dgop", "dms-cli": "dms-cli", "nixpkgs": "nixpkgs_3", - "quickshell": "quickshell_2" + "quickshell": [ + "quickshell" + ] }, "locked": { "lastModified": 1759884507, @@ -778,7 +780,9 @@ "inputs": { "caelestia-cli": "caelestia-cli_2", "nixpkgs": "nixpkgs_9", - "quickshell": "quickshell_3" + "quickshell": [ + "quickshell" + ] }, "locked": { "lastModified": 1759628091, @@ -1094,6 +1098,22 @@ } }, "nixpkgs_14": { + "locked": { + "lastModified": 1756125398, + "narHash": "sha256-XexyKZpf46cMiO5Vbj+dWSAXOnr285GHsMch8FBoHbc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3b9f00d7a7bf68acd4c4abb9d43695afb04e03a5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_15": { "locked": { "lastModified": 1759381078, "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", @@ -1109,7 +1129,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_16": { "locked": { "lastModified": 1754340878, "narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=", @@ -1268,10 +1288,32 @@ "type": "github" } }, + "noctalia-shell": { + "inputs": { + "nixpkgs": "nixpkgs_14", + "quickshell": [ + "quickshell" + ], + "systems": "systems_7" + }, + "locked": { + "lastModified": 1760300686, + "narHash": "sha256-Aplw2da+lu9kplOCLaTBERTYnTlxX0YiwqT2lMl0vq8=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "f0f95343f32894072abf5f5c39b4f5c3c3754015", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": "flake-parts_6", - "nixpkgs": "nixpkgs_14" + "nixpkgs": "nixpkgs_15" }, "locked": { "lastModified": 1759643458, @@ -1360,16 +1402,15 @@ "quickshell_2": { "inputs": { "nixpkgs": [ - "dankMaterialShell", "nixpkgs" ] }, "locked": { - "lastModified": 1756981260, - "narHash": "sha256-GhuD9QVimjynHI0OOyZsqJsnlXr2orowh9H+HYz4YMs=", + "lastModified": 1760315601, + "narHash": "sha256-cvguRikKX0yXZ7jaK4Gt3qB1I33T5TzYZQf0Ampx8ko=", "ref": "refs/heads/master", - "rev": "6eb12551baf924f8fdecdd04113863a754259c34", - "revCount": 672, + "rev": "00858812f25b748d08b075a0d284093685fa3ffd", + "revCount": 696, "type": "git", "url": "https://git.outfoxxed.me/quickshell/quickshell" }, @@ -1378,27 +1419,6 @@ "url": "https://git.outfoxxed.me/quickshell/quickshell" } }, - "quickshell_3": { - "inputs": { - "nixpkgs": [ - "niri-caelestia-shell", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1759610621, - "narHash": "sha256-P3UPFd95mS/3aNgy40nCXAmyfR2bEEBd+tX6xfkYFb0=", - "ref": "refs/heads/master", - "rev": "c5c438f1cd1a76660a8658ef929a3d19e968e2ce", - "revCount": 689, - "type": "git", - "url": "https://git.outfoxxed.me/outfoxxed/quickshell" - }, - "original": { - "type": "git", - "url": "https://git.outfoxxed.me/outfoxxed/quickshell" - } - }, "root": { "inputs": { "agenix": "agenix", @@ -1419,7 +1439,9 @@ "nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-wayland": "nixpkgs-wayland", "nixvim": "nixvim", + "noctalia-shell": "noctalia-shell", "nur": "nur", + "quickshell": "quickshell_2", "stylix": "stylix", "treefmt-nix": "treefmt-nix_2" } @@ -1458,7 +1480,7 @@ "nixpkgs" ], "nur": "nur_2", - "systems": "systems_7", + "systems": "systems_8", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1584,6 +1606,21 @@ "type": "github" } }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -1688,7 +1725,7 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_15" + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1758728421, diff --git a/flake.nix b/flake.nix index 770879c..c857fa6 100644 --- a/flake.nix +++ b/flake.nix @@ -87,8 +87,22 @@ }; ghostty.url = "github:ghostty-org/ghostty"; nixGL.url = "github:nix-community/nixGL"; - dankMaterialShell.url = "github:AvengeMedia/DankMaterialShell"; - niri-caelestia-shell.url = "github:jutraim/niri-caelestia-shell"; + quickshell = { + url = "git+https://git.outfoxxed.me/quickshell/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + dankMaterialShell = { + url = "github:AvengeMedia/DankMaterialShell"; + inputs.quickshell.follows = "quickshell"; + }; + niri-caelestia-shell = { + url = "github:jutraim/niri-caelestia-shell"; + inputs.quickshell.follows = "quickshell"; + }; caelestia-cli.url = "github:caelestia-dots/cli"; + noctalia-shell = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.quickshell.follows = "quickshell"; + }; }; } diff --git a/home/default.nix b/home/default.nix index f8fdbef..a74ca0f 100644 --- a/home/default.nix +++ b/home/default.nix @@ -57,6 +57,9 @@ if ${pkgs.systemd}/bin/systemctl --user is-active caelestia.service; then run --silence ${pkgs.systemd}/bin/systemctl --user stop caelestia.service fi + if ${pkgs.systemd}/bin/systemctl --user is-active noctalia-shell.service; then + run --silence ${pkgs.systemd}/bin/systemctl --user stop noctalia-shell.service + fi run --silence ${pkgs.systemd}/bin/systemctl --user start ${ if config.desktopShell == "dms" then "quickshell" else config.desktopShell }.service diff --git a/home/programs/desktop/default.nix b/home/programs/desktop/default.nix index 6ffa5ff..113e18f 100644 --- a/home/programs/desktop/default.nix +++ b/home/programs/desktop/default.nix @@ -8,6 +8,7 @@ ./swhkd.nix ./dms.nix ./caelestia.nix + ./noctalia.nix # ./scroll # ./mango ]; diff --git a/home/programs/desktop/niri/autostart.nix b/home/programs/desktop/niri/autostart.nix index b96c0eb..331dad8 100644 --- a/home/programs/desktop/niri/autostart.nix +++ b/home/programs/desktop/niri/autostart.nix @@ -38,7 +38,9 @@ let builtins.attrNames config.monitors |> map (monitor: [ "swww img --namespace background -o ${monitor} \"/home/${user}/Pictures/Wallpapers/generated/$(cat ~/.cache/swww/${monitor}-file)\"" + "sleep 0.2" "swww img --namespace backdrop -o ${monitor} \"/home/${user}/Pictures/Wallpapers/generated/$(cat ~/.cache/swww/${monitor}-blurred-file)\"" + "sleep 0.2" ]) |> builtins.concatLists |> builtins.concatStringsSep "\n" diff --git a/home/programs/desktop/noctalia.nix b/home/programs/desktop/noctalia.nix new file mode 100644 index 0000000..b41aa06 --- /dev/null +++ b/home/programs/desktop/noctalia.nix @@ -0,0 +1,139 @@ +{ + config, + user, + inputs, + pkgs, + lib, + ... +}: +{ + programs.noctalia-shell = { + colors = with config.lib.stylix.colors.withHashtag; { + mError = base08; + mOnError = base00; + mOnPrimary = base00; + mOnSecondary = base01; + mOnSurface = base05; + mOnSurfaceVariant = base07; + mOnTeritiary = base00; + mOutline = base02; + mPrimary = base0B; + mSecondary = base0A; + mShadow = "#000000"; + mSurface = base01; + mSurfaceVariant = base01; + mTeritiary = base0C; + }; + settings = { + bar = { + backgroundOpacity = 0.6; + density = "comfortable"; + floating = true; + showCapsule = true; + widgets = { + center = [ + { + id = "SystemMonitor"; + showCpuTemp = true; + showCpuUsage = true; + showDiskUsage = false; + showMemoryAsPercent = false; + showMemoryUsage = true; + showNetworkoStats = false; + } + ]; + left = [ + { + id = "Workspace"; + labelMode = "none"; + hideUnoccupied = false; + } + { + id = "MediaMini"; + autoHide = true; + scrollingMode = "hover"; + showAlbumArt = true; + showVisualizer = true; + visualizerType = "wave"; + } + ]; + right = [ + { + id = "Tray"; + colorizeIcons = true; + blacklist = [ ]; + } + { + id = "Battery"; + displayMode = "alwaysShow"; + warningThreshold = 30; + } + { + id = "Clock"; + customFont = "Monofur Nerd Font Mono"; + formatHorizontal = "HH:mm ddd, MMM dd"; + formatVertical = "HH mm - dd MM"; + useCustomFont = true; + usePrimaryColor = true; + } + { + id = "ControlCenter"; + customIconPath = ""; + icon = ""; + useDistroLogo = false; + } + ]; + }; + }; + colorSchemes = { + generateTemplatesForPredefined = false; + useWallpaperColors = false; + }; + general = { + avatarImage = "/home/${user}/.face"; + dimDesktop = true; + forceBlackScreenCorners = true; + showScreenCorners = true; + }; + location = { + name = "西湖"; + }; + ui = { + fontDefault = "Hug Me Tight"; + fontFixed = "Maple Mono"; + }; + wallpaper.enabled = false; + }; + }; + + systemd.user.services = lib.mkIf (config.desktopShell == "noctalia-shell") { + noctalia-shell = + let + noctaliaPackage = inputs.noctalia-shell.packages.${pkgs.system}.default; + noctaliaConfig = "/home/${user}/.config/noctalia/gui-settings.json"; + in + { + Unit = { + After = [ "graphical-session.target" ]; + PartOf = [ "graphical-session.target" ]; + StartLimitIntervalSec = 60; + StartLimitBurst = 3; + X-Restart-Triggers = [ + noctaliaPackage + noctaliaConfig + ]; + }; + Install.WantedBy = [ "graphical-session.target" ]; + Service = { + ExecStart = "${noctaliaPackage}/bin/noctalia-shell"; + Restart = "on-failure"; + RestartSec = 3; + TimeoutStartSec = 10; + TimeoutStopSec = 5; + Environment = [ + "NOCTALIA_SETTINGS_FALLBACK=${noctaliaConfig}" + ]; + }; + }; + }; +} diff --git a/home/programs/desktop/swhkd.nix b/home/programs/desktop/swhkd.nix index b847035..f743a14 100644 --- a/home/programs/desktop/swhkd.nix +++ b/home/programs/desktop/swhkd.nix @@ -12,7 +12,14 @@ } { key = "super + b"; - command = "pkill -USR1 .waybar-wrapped"; + command = + { + waybar = "pkill -USR1 .waybar-wrapped"; + dms = "dms ipc call bar toggle"; + caelestia = "echo pass"; + noctalia-shell = "noctalia-shell ipc call bar toggle"; + } + .${config.desktopShell}; } { key = "XF86AudioMute"; diff --git a/home/tweaks/default.nix b/home/tweaks/default.nix index 363df64..1afb122 100644 --- a/home/tweaks/default.nix +++ b/home/tweaks/default.nix @@ -7,5 +7,5 @@ ./wallpaper.nix ./colorscheme.nix ]; - desktopShell = "caelestia"; + desktopShell = "noctalia-shell"; } diff --git a/hosts/default.nix b/hosts/default.nix index 128d9e6..7ebf70d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -24,6 +24,7 @@ let # inputs.mangowc.hmModules.mango inputs.dankMaterialShell.homeModules.dankMaterialShell.default inputs.niri-caelestia-shell.homeManagerModules.default + inputs.noctalia-shell.homeModules.default ] ++ (builtins.attrValues self.homeManagerModules); diff --git a/modules/home-manager/desktop-shell.nix b/modules/home-manager/desktop-shell.nix index c05b272..eee0989 100644 --- a/modules/home-manager/desktop-shell.nix +++ b/modules/home-manager/desktop-shell.nix @@ -26,5 +26,9 @@ enable = config.desktopShell == "caelestia"; systemd.enable = config.desktopShell == "caelestia"; }; + programs.noctalia-shell.enable = config.desktopShell == "noctalia-shell"; + home.packages = lib.mkIf (config.desktopShell == "noctalia-shell") [ + inputs.noctalia-shell.packages.${pkgs.system}.default + ]; }; }