-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathflake.nix
More file actions
184 lines (151 loc) · 5.67 KB
/
Copy pathflake.nix
File metadata and controls
184 lines (151 loc) · 5.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{
description = "Brain Shell — Modular Quickshell/QML desktop shell for Hyprland";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# ── Runtime dependencies (required at launch) ──────────────────────
runtimeDeps = with pkgs; [
# Core shell runtime
quickshell
hyprland
qt6.full
qt6ct
# Audio
pipewire
pipewire-pulse
wireplumber
playerctl
mpv-mpris
mpd-mpris
# Network / Bluetooth
networkmanager
bluez
bluez-utils
# Display / input utilities
brightnessctl
wl-clipboard
slurp
xdg-user-dirs
xdg-desktop-portal-hyprland
# System info
upower
libnotify
polkit
lm_sensors
rfkill
# Media & visualiser
cava
python3
# Screen recording
wf-recorder
# Wallpaper & theming
imagemagick
awww
matugen
# Clipboard integration
wtype
cliphist
# Power & hardware management
envycontrol
auto-cpufreq
# Hyprland ecosystem
hyprsunset
hyprlock
hypridle
];
# ── Development extras (not needed at runtime) ─────────────────────
devDeps = with pkgs; [
git
bash
shellcheck
python3Packages.python-lsp-server
];
# ── Fonts ──────────────────────────────────────────────────────────
fonts = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
# ── The Brain Shell package ────────────────────────────────────────
brain-shell = pkgs.stdenv.mkDerivation {
pname = "brain-shell";
version = "0.1.0";
src = ./.;
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = runtimeDeps ++ fonts;
installPhase = ''
runHook preInstall
mkdir -p $out/share/brain-shell
cp -r . $out/share/brain-shell/
mkdir -p $out/bin
makeWrapper ${pkgs.quickshell}/bin/quickshell $out/bin/brain-shell \
--add-flags "-c $out/share/brain-shell" \
--set QT_QPA_PLATFORMTHEME qt6ct \
--prefix PATH : ${pkgs.lib.makeBinPath runtimeDeps}
runHook postInstall
'';
meta = with pkgs.lib; {
description = "A modular Quickshell/QML desktop shell for Hyprland";
homepage = "https://github.com/Brainitech/Brain_Shell";
license = licenses.mit;
platforms = platforms.linux;
mainProgram = "brain-shell";
};
};
in
{
# ── Packages ───────────────────────────────────────────────────────
packages = {
default = brain-shell;
brain-shell = brain-shell;
};
# ── Dev shell (nix develop) ────────────────────────────────────────
devShells.default = pkgs.mkShell {
name = "brain-shell-dev";
buildInputs = runtimeDeps ++ devDeps ++ fonts;
shellHook = ''
export QT_QPA_PLATFORMTHEME=qt6ct
export BRAIN_SHELL_ROOT="$(pwd)"
echo ""
echo " Brain Shell dev environment"
echo " Run: quickshell -c \$BRAIN_SHELL_ROOT"
echo " Lint: shellcheck install.sh dots-extra/install-arch.sh"
echo ""
'';
};
# ── NixOS module ───────────────────────────────────────────────────
nixosModules.default = { config, lib, pkgs, ... }:
let cfg = config.programs.brain-shell;
in {
options.programs.brain-shell = {
enable = lib.mkEnableOption "Brain Shell desktop shell";
autostart = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Add brain-shell to Hyprland exec-once.";
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ brain-shell ];
wayland.windowManager.hyprland.settings = lib.mkIf cfg.autostart {
exec-once = [
"brain-shell"
"hypridle"
"awww-daemon"
"systemctl --user start hyprpolkitagent"
"wl-paste --type text --watch cliphist store"
"wl-paste --type image --watch cliphist store"
];
};
};
};
# ── Checks (run by `nix flake check`) ─────────────────────────────
checks = {
build = brain-shell;
};
}
);
}