" "Ctrl+Backspace to delete word")
587 | ];
588 | };
589 | };
590 | }
591 |
--------------------------------------------------------------------------------
/home/rofi.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | pkgs,
4 | ...
5 | }: {
6 | stylix.targets.rofi.enable = false;
7 | programs.rofi = {
8 | enable = true;
9 | cycle = true;
10 | package = pkgs.rofi-wayland;
11 | plugins = with pkgs; [
12 | # HACK: temporary fix until ABI update
13 | (rofi-calc.override {
14 | rofi-unwrapped = rofi-wayland-unwrapped;
15 | })
16 | rofi-emoji-wayland
17 | ];
18 | extraConfig = {
19 | modi = "drun,calc,window,emoji,run";
20 | sidebar-mode = true;
21 | terminal = "footclient";
22 | show-icons = true;
23 | kb-remove-char-back = "BackSpace";
24 | kb-accept-entry = "Control+m,Return,KP_Enter";
25 | kb-mode-next = "Control+l";
26 | kb-mode-previous = "Control+h";
27 | kb-row-up = "Control+k,Up";
28 | kb-row-down = "Control+j,Down";
29 | kb-row-left = "Control+u";
30 | kb-row-right = "Control+d";
31 | kb-delete-entry = "Control+semicolon";
32 | kb-remove-char-forward = "";
33 | kb-remove-to-sol = "";
34 | kb-remove-to-eol = "";
35 | kb-mode-complete = "";
36 | display-drun = "";
37 | display-run = "";
38 | display-emoji = "";
39 | display-calc = "";
40 | display-window = "";
41 | display-filebrowser = "";
42 | drun-display-format = "{name} [({generic})]";
43 | window-format = "{w} · {c} · {t}";
44 | };
45 | theme = let
46 | inherit (config.lib.formats.rasi) mkLiteral;
47 | in {
48 | "*" = with config.lib.stylix.colors.withHashtag; {
49 | font = "${config.stylix.fonts.serif.name} ${toString config.stylix.fonts.sizes.popups}";
50 | background = with config.lib.stylix.colors; mkLiteral "rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, ${toString config.stylix.opacity.popups})";
51 | border = mkLiteral base01;
52 | background-alt = mkLiteral base01;
53 | foreground = mkLiteral base06;
54 | foreground-alt = mkLiteral base02;
55 | selected = mkLiteral base0C;
56 | active = mkLiteral base0B;
57 | urgent = mkLiteral base0D;
58 | };
59 | "window" = {
60 | transparency = "real";
61 | location = mkLiteral "center";
62 | anchor = mkLiteral "center";
63 | fullscreen = mkLiteral "false";
64 | width = mkLiteral "900px";
65 | x-offset = mkLiteral "0px";
66 | y-offset = mkLiteral "0px";
67 | enabled = mkLiteral "true";
68 | border-radius = mkLiteral "10px";
69 | border = mkLiteral "2px solid";
70 | border-color = mkLiteral "@border";
71 | cursor = "default";
72 | background-color = mkLiteral "@background";
73 | };
74 | "mainbox" = {
75 | enabled = true;
76 | spacing = mkLiteral "0px";
77 | margin = mkLiteral "0px";
78 | padding = mkLiteral "0px";
79 | border = mkLiteral "0px solid";
80 | border-radius = mkLiteral "0px 0px 0px 0px";
81 | border-color = mkLiteral "@border";
82 | background-color = mkLiteral "transparent";
83 | children = mkLiteral "[inputbar,message,listview]";
84 | };
85 | "inputbar" = {
86 | enabled = true;
87 | spacing = mkLiteral "0px";
88 | margin = mkLiteral "0px";
89 | padding = mkLiteral "0px";
90 | border = mkLiteral "0px 0px 2px 0px";
91 | border-radius = mkLiteral "0px";
92 | border-color = mkLiteral "@border";
93 | background-color = mkLiteral "transparent";
94 | text-color = mkLiteral "@foreground";
95 | children = mkLiteral "[prompt,entry]";
96 | };
97 | "prompt" = {
98 | enabled = true;
99 | padding = mkLiteral "15px";
100 | border = mkLiteral "0px 2px 0px 0px";
101 | border-radius = mkLiteral "0px";
102 | border-color = mkLiteral "@background-alt";
103 | background-color = mkLiteral "inherit";
104 | text-color = mkLiteral "inherit";
105 | };
106 | "textbox-prompt-colon" = {
107 | enabled = true;
108 | expand = false;
109 | str = "::";
110 | background-color = mkLiteral "inherit";
111 | text-color = mkLiteral "inherit";
112 | };
113 | "entry" = {
114 | enabled = true;
115 | padding = mkLiteral "15px";
116 | background-color = mkLiteral "inherit";
117 | text-color = mkLiteral "inherit";
118 | cursor = mkLiteral "text";
119 | placeholder-color = mkLiteral "inherit";
120 | };
121 | "mode-switcher" = {
122 | enabled = true;
123 | spacing = mkLiteral "10px";
124 | margin = mkLiteral "0px";
125 | padding = mkLiteral "0px";
126 | border = mkLiteral "0px solid";
127 | border-radius = mkLiteral "0px";
128 | background-color = mkLiteral "transparent";
129 | text-color = mkLiteral "@foreground";
130 | };
131 | "button" = {
132 | padding = mkLiteral "10px";
133 | border-radius = mkLiteral "0px";
134 | border = mkLiteral "0px solid";
135 | border-color = mkLiteral "@border";
136 | background-color = mkLiteral "transparent";
137 | text-color = mkLiteral "inherit";
138 | cursor = mkLiteral "pointer";
139 | };
140 | "button selected" = {
141 | background-color = mkLiteral "@selected";
142 | text-color = mkLiteral "@foreground";
143 | };
144 | "listview" = {
145 | enabled = true;
146 | columns = 1;
147 | lines = 12;
148 | cycle = true;
149 | dynamic = true;
150 | scrollbar = false;
151 | layout = mkLiteral "vertical";
152 | reverse = false;
153 | fixed-height = true;
154 | fixed-columns = true;
155 | spacing = mkLiteral "0px";
156 | margin = mkLiteral "0px";
157 | padding = mkLiteral "0px";
158 | border = mkLiteral "0px solid";
159 | border-radius = mkLiteral "0px";
160 | border-color = mkLiteral "@border";
161 | background-color = mkLiteral "transparent";
162 | text-color = mkLiteral "@foreground";
163 | cursor = mkLiteral "default";
164 | };
165 | "element" = {
166 | enabled = true;
167 | spacing = mkLiteral "10px";
168 | margin = mkLiteral "0px";
169 | padding = mkLiteral "8px 15px";
170 | border = mkLiteral "0px 0px 0px 0px";
171 | border-radius = mkLiteral "0px";
172 | border-color = mkLiteral "@border";
173 | background-color = mkLiteral "transparent";
174 | text-color = mkLiteral "@foreground";
175 | cursor = mkLiteral "pointer";
176 | };
177 | "element normal.normal" = {
178 | background-color = mkLiteral "inherit";
179 | text-color = mkLiteral "inherit";
180 | };
181 | "element normal.urgent" = {
182 | background-color = mkLiteral "@urgent";
183 | text-color = mkLiteral "@active";
184 | };
185 | "element normal.active" = {
186 | background-color = mkLiteral "@background";
187 | text-color = mkLiteral "@active";
188 | };
189 | "element selected.normal" = {
190 | background-color = mkLiteral "@selected";
191 | text-color = mkLiteral "@background";
192 | };
193 | "element selected.urgent" = {
194 | background-color = mkLiteral "@urgent";
195 | text-color = mkLiteral "@foreground";
196 | };
197 | "element selected.active" = {
198 | background-color = mkLiteral "@urgent";
199 | text-color = mkLiteral "@background-alt";
200 | };
201 | "element-icon" = {
202 | background-color = mkLiteral "transparent";
203 | text-color = mkLiteral "inherit";
204 | size = mkLiteral "32px";
205 | cursor = mkLiteral "inherit";
206 | };
207 | "element-text" = {
208 | background-color = mkLiteral "transparent";
209 | text-color = mkLiteral "inherit";
210 | cursor = mkLiteral "inherit";
211 | vertical-align = mkLiteral "0.5";
212 | horizontal-align = mkLiteral "0.0";
213 | };
214 | "message" = {
215 | enabled = true;
216 | margin = mkLiteral "0px";
217 | padding = mkLiteral "8px 15px";
218 | border = mkLiteral "0px solid";
219 | border-radius = mkLiteral "0px 0px 0px 0px";
220 | border-color = mkLiteral "@border";
221 | background-color = mkLiteral "transparent";
222 | text-color = mkLiteral "@foreground";
223 | };
224 | "textbox" = {
225 | padding = mkLiteral "10px";
226 | border = mkLiteral "0px solid";
227 | border-radius = mkLiteral "0px";
228 | border-color = mkLiteral "@border";
229 | background-color = mkLiteral "@background-alt";
230 | text-color = mkLiteral "@foreground";
231 | vertical-align = mkLiteral "0.5";
232 | horizontal-align = mkLiteral "0.0";
233 | highlight = mkLiteral "none";
234 | placeholder-color = mkLiteral "@foreground-alt";
235 | blink = true;
236 | markup = true;
237 | };
238 | "error-message" = {
239 | padding = mkLiteral "0px";
240 | border = mkLiteral "0px solid";
241 | border-color = mkLiteral "@border";
242 | border-radius = mkLiteral "0px";
243 | background-color = mkLiteral "@background";
244 | text-color = mkLiteral "@foreground";
245 | };
246 | };
247 | };
248 | xdg.dataFile."rofi/themes/preview.rasi".text = ''
249 | @theme "custom"
250 | icon-current-entry {
251 | enabled: true;
252 | size: 50%;
253 | dynamic: true;
254 | padding: 10px;
255 | background-color: inherit;
256 | }
257 | listview-split {
258 | background-color: transparent;
259 | border-radius: 0px;
260 | cycle: true;
261 | dynamic : true;
262 | orientation: horizontal;
263 | border: 0px solid;
264 | children: [listview,icon-current-entry];
265 | }
266 | listview {
267 | lines: 10;
268 | }
269 | mainbox {
270 | children: [inputbar,listview-split];
271 | }
272 | configuration {
273 | display-filebrowser: "";
274 | modi: "filebrowser";
275 | filebrowser {
276 | directories-first: false;
277 | directory: "${pkgs.my-walls}/share/wallpapers";
278 | command: "swww img -f Mitchell -t any --transition-fps 75 --transition-duration 2";
279 | }
280 | }
281 | '';
282 | }
283 |
--------------------------------------------------------------------------------
/home/spotify-player.nix:
--------------------------------------------------------------------------------
1 | {
2 | inputs,
3 | config,
4 | pkgs,
5 | ...
6 | }: {
7 | imports = [inputs.sops-nix.homeManagerModules.sops];
8 | sops = {
9 | defaultSopsFile = ../secrets/secrets.yaml;
10 | age.sshKeyPaths = ["${config.home.homeDirectory}/.ssh/id_ed25519"];
11 | secrets = {
12 | spot_username = {};
13 | spot_auth_data = {};
14 | spot_client_id = {};
15 | };
16 | templates."credentials.json" = {
17 | content = builtins.toJSON {
18 | username = config.sops.placeholder.spot_username;
19 | auth_type = 1;
20 | auth_data = config.sops.placeholder.spot_auth_data;
21 | };
22 | path = "${config.xdg.cacheHome}/spotify-player/credentials.json";
23 | };
24 | };
25 | systemd.user.services.changeCover = {
26 | Unit = {
27 | PartOf = ["graphical-session.target"];
28 | After = ["graphical-session-pre.target"];
29 | };
30 | Service = {
31 | ExecStart = pkgs.writeShellScript "changeCover" ''
32 | playerctl metadata --format '{{playerName}} {{mpris:artUrl}}' -F --ignore-player firefox | while read -r player url; do
33 | if [ "$player" = "spotify_player" ] && [ -n "$url" ]; then
34 | curl "$url" > /tmp/cover.jpg
35 | pkill -RTMIN+8 waybar
36 | magick /tmp/cover.jpg -resize 1x1\! -format "fg = #%[hex:u]\n" info: 2>/dev/null > /tmp/cover.info
37 | fi
38 | done
39 | '';
40 | Restart = "always";
41 | RestartSec = "5s";
42 | };
43 | Install = {
44 | WantedBy = ["graphical-session.target"];
45 | };
46 | };
47 | programs.spotify-player = {
48 | enable = true;
49 | settings = {
50 | client_id_command = "cat ${config.xdg.configHome}/sops-nix/secrets/spot_client_id";
51 | client_port = 8080;
52 | play_icon = " ";
53 | pause_icon = " ";
54 | enable_media_control = true;
55 | default_device = "ur-mom";
56 | theme = config.stylix.base16Scheme.slug;
57 | seek_duration_secs = 10;
58 | liked_icon = " ";
59 | border_type = "Hidden";
60 | progress_bar_type = "Rectangle";
61 | cover_img_scale = 1.9;
62 | cover_img_length = 10;
63 | layout.playback_window_position = "Bottom";
64 | device = {
65 | name = "lain";
66 | device_type = "speaker";
67 | bitrate = 320;
68 | audio_cache = false;
69 | autoplay = true;
70 | };
71 | };
72 | actions = [
73 | {
74 | action = "ToggleLiked";
75 | key_sequence = "C-l";
76 | }
77 | {
78 | action = "AddToLibrary";
79 | key_sequence = "C-a";
80 | }
81 | {
82 | action = "Follow";
83 | key_sequence = "C-f";
84 | }
85 | ];
86 | keymaps = [
87 | {
88 | command = "PreviousPage";
89 | key_sequence = "esc";
90 | }
91 | {
92 | command = "ClosePopup";
93 | key_sequence = "q";
94 | }
95 | {
96 | command = "Repeat";
97 | key_sequence = "R";
98 | }
99 | {
100 | command = "Shuffle";
101 | key_sequence = "S";
102 | }
103 | {
104 | command = "Quit";
105 | key_sequence = "C-c";
106 | }
107 | {
108 | command = "SeekForward";
109 | key_sequence = "L";
110 | }
111 | {
112 | command = "SeekBackward";
113 | key_sequence = "H";
114 | }
115 | {
116 | command = "PageSelectPreviousOrScrollUp";
117 | key_sequence = "C-u";
118 | }
119 | {
120 | command = "PageSelectNextOrScrollDown";
121 | key_sequence = "C-d";
122 | }
123 | {
124 | command = "LikedTrackPage";
125 | key_sequence = "g o";
126 | }
127 | ];
128 | themes = [
129 | {
130 | name = config.stylix.base16Scheme.slug;
131 | palette = with config.lib.stylix.colors.withHashtag; {
132 | black = base00;
133 | foreground = base03;
134 | bright_black = base01;
135 | yellow = base02;
136 | green = base03;
137 | bright_yellow = base04;
138 | white = base05;
139 | bright_white = base06;
140 | cyan = base07;
141 | bright_cyan = base08;
142 | blue = base09;
143 | bright_red = base0A;
144 | bright_blue = base0B;
145 | red = base0C;
146 | bright_green = base0D;
147 | magenta = base07;
148 | bright_magenta = base0F;
149 | };
150 | component_style = {
151 | block_title = {
152 | fg = "BrightGreen";
153 | modifiers = ["Italic" "Bold"];
154 | };
155 | like = {
156 | fg = "Red";
157 | modifiers = ["Bold"];
158 | };
159 | playback_track = {
160 | fg = "BrightMagenta";
161 | modifiers = ["Italic"];
162 | };
163 | playback_album = {
164 | fg = "BrightRed";
165 | modifiers = ["Italic"];
166 | };
167 | playback_artists = {
168 | fg = "BrightCyan";
169 | modifiers = [];
170 | };
171 | playback_metadata = {
172 | fg = "BrightBlue";
173 | modifiers = [];
174 | };
175 | playback_progress_bar = {
176 | fg = "BrightGreen";
177 | modifiers = ["Italic"];
178 | };
179 | current_playing = {
180 | fg = "Red";
181 | modifiers = ["Bold" "Italic"];
182 | };
183 | playlist_desc = {
184 | fg = "White";
185 | modifiers = ["Italic"];
186 | };
187 | page_desc = {
188 | fg = "Magenta";
189 | modifiers = ["Bold" "Italic"];
190 | };
191 | table_header = {
192 | fg = "Blue";
193 | modifiers = ["Bold"];
194 | };
195 | border = {fg = "BrightYellow";};
196 | selection = {
197 | fg = "Red";
198 | modifiers = ["Bold" "Reversed"];
199 | };
200 | secondary_row = {bg = "BrightBlack";};
201 | };
202 | }
203 | ];
204 | };
205 | }
206 |
--------------------------------------------------------------------------------
/home/waybar.nix:
--------------------------------------------------------------------------------
1 | {
2 | osConfig,
3 | config,
4 | pkgs,
5 | lib,
6 | ...
7 | }: let
8 | scripts = import ../pkgs/scripts.nix {inherit pkgs config;};
9 | in {
10 | stylix.targets.waybar = {
11 | enableLeftBackColors = false;
12 | enableRightBackColors = false;
13 | enableCenterBackColors = false;
14 | };
15 | programs.waybar = {
16 | enable = true;
17 | settings = {
18 | mainBar = {
19 | layer = "top";
20 | position = "top";
21 | modules-left = ["hyprland/workspaces" "group/win"];
22 | modules-center = ["image#cover" "group/music"];
23 | modules-right = ["network" "pulseaudio" "clock#date" "clock#time" "gamemode" "privacy" "tray"];
24 | "hyprland/workspaces" = {
25 | format = "{icon}";
26 | show-special = true;
27 | on-scroll-up = "hyprctl dispatch workspace r-1";
28 | on-scroll-down = "hyprctl dispatch workspace r+1";
29 | format-icons = {
30 | "1" = "一";
31 | "2" = "二";
32 | "3" = "三";
33 | "4" = "四";
34 | "5" = "五";
35 | "6" = "六";
36 | "7" = "七";
37 | "8" = "八";
38 | "music" = "";
39 | "mpv" = "";
40 | };
41 | persistent-workspaces = {
42 | "1" = [];
43 | "2" = [];
44 | "3" = [];
45 | "4" = [];
46 | "5" = [];
47 | "6" = [];
48 | "7" = [];
49 | "8" = [];
50 | "special:music" = [];
51 | };
52 | ignore-workspaces = ["special:hdrop"];
53 | };
54 | "group/win" = {
55 | orientation = "inherit";
56 | drawer.transition-duration = 250;
57 | modules = [
58 | "hyprland/window"
59 | "wlr/taskbar"
60 | ];
61 | };
62 | "wlr/taskbar" = {
63 | active-first = true;
64 | markup = true;
65 | on-click = "activate";
66 | on-click-middle = "close";
67 | ignore-list = ["GLava"];
68 | icon-size = 24;
69 | };
70 | "hyprland/window" = {
71 | icon = true;
72 | rewrite = {
73 | ".+" = "";
74 | };
75 | };
76 | "tray" = {spacing = 10;};
77 | "clock#time" = {
78 | format = "{:%H:%M}";
79 | tooltip-format = "{tz_list}";
80 | timezones = [
81 | osConfig.time.timeZone
82 | "Europe/Berlin"
83 | "Asia/Tokyo"
84 | ];
85 | };
86 | "clock#date" = {
87 | format = "{:%a %d %b}";
88 | tooltip-format = "{calendar}";
89 | };
90 | "network" = {
91 | format-ethernet = "{bandwidthUpBytes} {bandwidthDownBytes}";
92 | min-width = 20;
93 | fixed-width = 20;
94 | interface = "enp7s0";
95 | interval = 1;
96 | };
97 | "pulseaudio" = {
98 | format = "{volume}%";
99 | format-muted = "{volume}%";
100 | on-click = "pulsemixer --toggle-mute";
101 | on-scroll-up = "pulsemixer --change-volume +5";
102 | on-scroll-down = "pulsemixer --change-volume -5";
103 | on-click-right = "pkill pulsemixer || footclient -T quick pulsemixer";
104 | };
105 | "privacy" = {
106 | icon-size = 16;
107 | icon-spacing = 5;
108 | on-click = "pkill glava";
109 | };
110 | "group/music" = {
111 | orientation = "vertical";
112 | modules = [
113 | "mpris"
114 | "custom/progress"
115 | ];
116 | };
117 | "mpris" = with config.lib.stylix.colors.withHashtag; {
118 | format = "{dynamic}";
119 | format-paused = "{dynamic}";
120 | dynamic-order = ["title" "artist"];
121 | dynamic-separator = " • ";
122 | on-scroll-up = "playerctld shift";
123 | on-scroll-down = "playerctld unshift";
124 | max-length = 100;
125 | };
126 | "custom/progress" = {
127 | return-type = "json";
128 | exec = pkgs.writeShellScript "centWay" ''
129 | while :; do
130 | echo "{ \"text\" : \"_\" , \"class\" : \"$(playerctl --ignore-player firefox metadata --format 'cent{{ (position / 100) / (mpris:length / 100) * 100 }}' | cut -d. -f1)\" }"
131 | sleep 1
132 | done
133 | '';
134 | };
135 | "image#cover" = {
136 | on-click = "pkill nsxiv || nsxiv /tmp/cover.jpg";
137 | on-click-right = "spotify_player like";
138 | on-click-middle = scripts.glavaShow;
139 | path = "/tmp/cover.jpg";
140 | size = 31;
141 | signal = 8;
142 | };
143 | };
144 | };
145 | style =
146 | ''
147 | * { border: 0; border-radius: 0; min-height: 0; }
148 | * { font-family: ${builtins.concatStringsSep "," (map (font: ''"${font}"'') osConfig.fonts.fontconfig.defaultFonts.sansSerif)}; }
149 | #waybar { transition: background-color .1s; }
150 | #waybar.hidden { opacity: .1; }
151 |
152 |
153 | #clock, #mpris, #network, #tray, #pulseaudio, #workspaces,
154 | #image.toggle, privacy, #gamemode, #submap {
155 | color: @base05;
156 | padding: 2px 4px;
157 | background-color: alpha(@base00, 0);
158 | margin: 2px 4px;
159 | }
160 |
161 | #image.cover { margin: 4px 0; }
162 | #workspaces button {
163 | color: @base04;
164 | box-shadow: inset 0 -3px transparent;
165 | padding: 0 6px;
166 | transition: all .1s cubic-bezier(.55, -.68, .48, 1.68);
167 | }
168 | #workspaces button.empty { color: @base03; }
169 | #workspaces button.active { color: @base0B; }
170 |
171 | #mpris { margin-top: 3px; margin-bottom: 1px; color: @base09; }
172 | #pulseaudio { color: @base0D; }
173 | #pulseaudio.muted, #network.disconnected { color: @base0A; }
174 | #network { color: @base0F; }
175 | #clock.time { color: @base0E; }
176 | #clock.date { color: @base08; }
177 |
178 | tooltip { padding: 3px; background-color: alpha(@base01, .75); }
179 | #tray > .passive { -gtk-icon-effect: dim; }
180 | #tray > .needs-attention { -gtk-icon-effect: highlight; background-color: @base0A; }
181 |
182 | #taskbar button:hover { background-color: @base01; }
183 |
184 | #window { margin-bottom: 2px; margin-right: 0; padding-right: 0; }
185 | #taskbar { margin-bottom: 2px; margin-left: 0; padding-left: 0; }
186 | #taskbar button { padding: 0 7px; }
187 |
188 | #privacy, #gamemode, #image.toggle { margin: 0 2px; padding: 0 2px; }
189 |
190 | #custom-progress {
191 | font-size: 2pt;
192 | margin: 2px 7px 0;
193 | color: transparent;
194 | }''
195 | + builtins.concatStringsSep "\n" (map (p: ''
196 | #custom-progress.cent${toString p} {
197 | background: linear-gradient(to right, @base07 ${toString p}%, @base01 ${toString p}.1%);
198 | }
199 | '') (lib.range 0 100));
200 | };
201 | }
202 |
--------------------------------------------------------------------------------
/home/xdg.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | pkgs,
4 | ...
5 | }: {
6 | xdg = {
7 | enable = true;
8 |
9 | portal = {
10 | enable = true;
11 | config.common.default = ["hyprland" "gtk"];
12 | xdgOpenUsePortal = true;
13 | extraPortals = with pkgs; [xdg-desktop-portal-hyprland xdg-desktop-portal-gtk];
14 | };
15 |
16 | mime.enable = true;
17 | mimeApps = {
18 | enable = true;
19 | defaultApplications = let
20 | browser = ["firefox.desktop"];
21 | fileManager = ["org.gnome.Nautilus.desktop"];
22 | editor = ["nvim.desktop"];
23 | player = ["mpv.desktop"];
24 | viewer = ["nsxiv.desktop"];
25 | reader = ["org.pwmt.zathura.desktop"];
26 | in {
27 | "application/pdf" = reader;
28 | "application/epub" = reader;
29 |
30 | "text/html" = browser;
31 | "text/xml" = browser;
32 | "text/plain" = editor;
33 | "application/x-wine-extension-ini" = editor;
34 |
35 | "application/json" = browser;
36 | "application/xml" = browser;
37 | "application/xhtml+xml" = browser;
38 | "application/xhtml_xml" = browser;
39 | "application/rdf+xml" = browser;
40 | "application/rss+xml" = browser;
41 | "application/x-extension-htm" = browser;
42 | "application/x-extension-html" = browser;
43 | "application/x-extension-shtml" = browser;
44 | "application/x-extension-xht" = browser;
45 | "application/x-extension-xhtml" = browser;
46 |
47 | "x-scheme-handler/about" = browser;
48 | "x-scheme-handler/ftp" = browser;
49 | "x-scheme-handler/http" = browser;
50 | "x-scheme-handler/https" = browser;
51 |
52 | "inode/directory" = fileManager;
53 | "application/zip" = fileManager;
54 |
55 | "audio/mpeg" = player;
56 | "audio/aac" = player;
57 | "audio/flac" = player;
58 | "audio/wav" = player;
59 | "video/mp4" = player;
60 | "video/vnd.mpegurl" = player;
61 | "video/x-matroska" = player;
62 | "application/x-mpegURL" = player;
63 |
64 | "image/gif" = viewer;
65 | "image/jpeg" = viewer;
66 | "image/png" = viewer;
67 | "image/webp" = viewer;
68 | };
69 | };
70 |
71 | userDirs = {
72 | enable = true;
73 | createDirectories = true;
74 | download = "${config.home.homeDirectory}/dl";
75 | documents = "${config.home.homeDirectory}/dl/dox";
76 | desktop = "${config.home.homeDirectory}/dl/desk";
77 | videos = "${config.home.homeDirectory}/dl/vid";
78 | pictures = "${config.home.homeDirectory}/pix";
79 | music = "${config.home.homeDirectory}/dl/music";
80 | templates = "${config.home.homeDirectory}/.local/share/templates";
81 | publicShare = "${config.home.homeDirectory}/.local/share/public";
82 | };
83 |
84 | configFile."electron-flags.conf".text = ''
85 | --enable-features=WaylandWindowDecorations
86 | --enable-features=UseOzonePlatform
87 | --ozone-platform-hint=wayland
88 | --disable-gpu-compositing
89 | '';
90 | };
91 | }
92 |
--------------------------------------------------------------------------------
/nixos/boot.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | modulesPath,
4 | myUserName,
5 | ...
6 | }: {
7 | imports = [(modulesPath + "/installer/scan/not-detected.nix")];
8 |
9 | boot = {
10 | initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
11 | initrd.kernelModules = [];
12 | kernelModules = ["kvm-amd"];
13 | extraModulePackages = [];
14 | };
15 | fileSystems = {
16 | "/" = {
17 | device = "/dev/disk/by-uuid/a712d0ab-a784-4a07-bcfa-c538173722c2";
18 | fsType = "btrfs";
19 | options = ["subvol=@" "compress=zstd"];
20 | };
21 |
22 | "/boot" = {
23 | device = "/dev/disk/by-uuid/43BE-E69D";
24 | fsType = "vfat";
25 | };
26 |
27 | "/home/${myUserName}/mnt" = {
28 | device = "/dev/disk/by-uuid/d574db64-7098-4a82-8837-3f4f43f3b003";
29 | fsType = "ext4";
30 | options = ["noauto"];
31 | };
32 | };
33 |
34 | swapDevices = [{device = "/dev/disk/by-uuid/9ff583e8-b9bb-46f3-a68d-0883d3f71fe6";}];
35 |
36 | networking.useDHCP = lib.mkDefault true;
37 |
38 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
39 |
40 | systemd.services = {
41 | systemd-udev-settle.enable = false;
42 | NetworkManager-wait-online.enable = false;
43 | };
44 | }
45 |
--------------------------------------------------------------------------------
/nixos/config.nix:
--------------------------------------------------------------------------------
1 | {
2 | pkgs,
3 | pkgs-stable,
4 | config,
5 | inputs,
6 | lib,
7 | pcName,
8 | myUserName,
9 | mailId,
10 | ...
11 | }: let
12 | home = user: "/home/${user}";
13 | in {
14 | imports = [
15 | ./boot.nix
16 | ./hardware.nix
17 | ./packages.nix
18 | ./stylix.nix
19 | inputs.nix-gaming.nixosModules.platformOptimizations
20 | ];
21 |
22 | sops = {
23 | defaultSopsFile = ../secrets/secrets.yaml;
24 | age.sshKeyPaths = ["${home myUserName}/.ssh/id_ed25519"];
25 | secrets = {
26 | root_pass.neededForUsers = true;
27 | user_pass.neededForUsers = true;
28 | ssh_public = {};
29 | vpn_private_jp = {};
30 | vpn_private_us = {};
31 | vpn_private_nl = {};
32 | };
33 | };
34 |
35 | networking = {
36 | stevenBlackHosts.enable = true;
37 | # NOTE: VNC server
38 | firewall.allowedTCPPorts = [5900];
39 | };
40 |
41 | nix = {
42 | settings = {
43 | auto-optimise-store = true;
44 | experimental-features = ["nix-command" "flakes"];
45 | warn-dirty = false;
46 | trusted-users = ["root" "@wheel"];
47 | log-lines = 30;
48 | http-connections = 50;
49 | };
50 | nixPath = ["nixpkgs=${inputs.nixpkgs}"];
51 | registry.nixpkgs.flake = inputs.nixpkgs;
52 | gc = {
53 | automatic = true;
54 | dates = "weekly";
55 | options = "--delete-older-than 7d";
56 | };
57 | optimise = {
58 | automatic = true;
59 | dates = ["weekly"];
60 | };
61 | };
62 |
63 | boot = {
64 | loader = {
65 | systemd-boot = {
66 | enable = true;
67 | consoleMode = "max";
68 | };
69 | efi.canTouchEfiVariables = true;
70 | };
71 | kernelPackages = pkgs.linuxPackages_xanmod;
72 | };
73 |
74 | documentation = {
75 | enable = true;
76 | dev.enable = true;
77 | };
78 |
79 | services = {
80 | mysql = {
81 | enable = false;
82 | package = pkgs.mysql84;
83 | };
84 |
85 | greetd = {
86 | enable = true;
87 | settings = {
88 | default_session = {
89 | command = lib.getExe pkgs.hyprland;
90 | user = myUserName;
91 | };
92 | };
93 | };
94 |
95 | audiobookshelf = {
96 | enable = true;
97 | openFirewall = true;
98 | group = "users";
99 | };
100 |
101 | # NOTE: calibre drive detection
102 | udisks2.enable = true;
103 |
104 | # NOTE: nautilus trash support
105 | gvfs.enable = true;
106 | };
107 |
108 | systemd.coredump.extraConfig = "Storage=none";
109 |
110 | environment = {
111 | pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];
112 |
113 | # NOTE: font stem darkening
114 | variables.FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
115 | };
116 |
117 | security.sudo.wheelNeedsPassword = false;
118 |
119 | time.timeZone = "Asia/Kolkata";
120 | i18n = {
121 | defaultLocale = "ja_JP.UTF-8";
122 | extraLocaleSettings = {
123 | LC_NUMERIC = "en_US.UTF-8";
124 | LC_ADDRESS = "en_IN";
125 | LC_IDENTIFICATION = "en_IN";
126 | LC_MEASUREMENT = "en_IN";
127 | LC_MONETARY = "en_IN";
128 | LC_PAPER = "en_IN";
129 | LC_TELEPHONE = "en_IN";
130 | LC_TIME = "en_IN";
131 | };
132 | };
133 |
134 | console = {
135 | earlySetup = true;
136 | font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
137 | useXkbConfig = true;
138 | };
139 |
140 | programs = {
141 | # NOTE: completions/integration/root access
142 | fish.enable = true;
143 | foot.enable = true;
144 | hyprland.enable = true;
145 |
146 | steam = {
147 | enable = true;
148 | gamescopeSession.enable = true;
149 | protontricks.enable = true;
150 | protontricks.package = pkgs-stable.protontricks;
151 | platformOptimizations.enable = true;
152 | };
153 |
154 | gamemode.enable = true;
155 |
156 | nh = {
157 | enable = true;
158 | flake = "${home myUserName}/kiseki";
159 | };
160 |
161 | nix-ld.enable = true;
162 | };
163 |
164 | users.users = {
165 | root = {
166 | hashedPasswordFile = config.sops.secrets.root_pass.path;
167 | };
168 | ${myUserName} = {
169 | isNormalUser = true;
170 | shell = pkgs.fish;
171 | homeMode = "770";
172 | openssh.authorizedKeys.keyFiles = [config.sops.secrets.ssh_public.path];
173 | hashedPasswordFile = config.sops.secrets.user_pass.path;
174 | extraGroups = ["wheel" "libvirtd" "input"];
175 | };
176 | };
177 |
178 | home-manager = {
179 | backupFileExtension = "bak";
180 | useGlobalPkgs = true;
181 | useUserPackages = true;
182 | extraSpecialArgs = {
183 | inherit inputs pkgs-stable;
184 | inherit pcName myUserName mailId;
185 | };
186 | users.${myUserName} = import ../home;
187 | };
188 |
189 | nixpkgs.config = import ../home/nixpkgs.nix;
190 |
191 | # NOTE: virt-manager setup
192 | # virtualisation.libvirtd.enable = true;
193 | # programs.virt-manager.enable = true;
194 |
195 | system.stateVersion = "25.05";
196 | }
197 |
--------------------------------------------------------------------------------
/nixos/hardware.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | inputs,
4 | pcName,
5 | ...
6 | }: {
7 | imports = [
8 | inputs.nix-gaming.nixosModules.pipewireLowLatency
9 | ];
10 | services = {
11 | xserver = {
12 | xkb = {
13 | layout = "us";
14 | variant = "";
15 | options = "caps:escape,altwin:swap_lalt_lwin";
16 | };
17 | videoDrivers = ["nvidia"];
18 | };
19 |
20 | blueman.enable = true;
21 |
22 | pipewire = {
23 | enable = true;
24 | alsa.enable = true;
25 | alsa.support32Bit = true;
26 | jack.enable = true;
27 | pulse.enable = true;
28 | lowLatency.enable = true;
29 | };
30 | };
31 |
32 | hardware = {
33 | bluetooth = {
34 | enable = true;
35 | powerOnBoot = true;
36 | };
37 |
38 | graphics = {
39 | enable = true;
40 | enable32Bit = true;
41 | };
42 |
43 | nvidia = {
44 | modesetting.enable = true;
45 | open = true;
46 | powerManagement.enable = true;
47 | forceFullCompositionPipeline = true;
48 | nvidiaSettings = true;
49 | package = config.boot.kernelPackages.nvidiaPackages.beta;
50 | };
51 |
52 | cpu.amd.updateMicrocode = true;
53 |
54 | # NOTE: wacom fix
55 | # opentabletdriver.enable = true;
56 | };
57 |
58 | networking = {
59 | hostName = pcName;
60 | wireless.enable = false;
61 | useNetworkd = true;
62 |
63 | wg-quick.interfaces = {
64 | jp = {
65 | autostart = false;
66 | address = ["10.2.0.2/32"];
67 | dns = ["10.2.0.1"];
68 | privateKeyFile = config.sops.secrets.vpn_private_jp.path;
69 | peers = [
70 | {
71 | publicKey = "5fFhuzIQPu8C4tySJuCJYg/13g75APFtMnqn3oeCpxk=";
72 | allowedIPs = ["0.0.0.0/0"];
73 | endpoint = "193.148.16.2:51820";
74 | persistentKeepalive = 25;
75 | }
76 | ];
77 | };
78 | us = {
79 | autostart = false;
80 | address = ["10.2.0.2/32"];
81 | dns = ["10.2.0.1"];
82 | privateKeyFile = config.sops.secrets.vpn_private_us.path;
83 | peers = [
84 | {
85 | publicKey = "ksK3faRBQlFLul2FcKPphBR9LYR+6/FbP1etg0T2liA=";
86 | allowedIPs = ["0.0.0.0/0"];
87 | endpoint = "37.19.221.198:51820";
88 | persistentKeepalive = 25;
89 | }
90 | ];
91 | };
92 | nl = {
93 | autostart = false;
94 | address = ["10.2.0.2/32"];
95 | dns = ["10.2.0.1"];
96 | privateKeyFile = config.sops.secrets.vpn_private_nl.path;
97 | peers = [
98 | {
99 | publicKey = "jA3Pf5MWpHk8STrLXVPyM28aV3yAZgw9nEGoIFAyxiI=";
100 | allowedIPs = ["0.0.0.0/0"];
101 | endpoint = "185.177.124.190:51820";
102 | persistentKeepalive = 25;
103 | }
104 | ];
105 | };
106 | };
107 | };
108 |
109 | boot.kernelModules = ["nvidia_uvm"];
110 |
111 | boot.kernel.sysctl = {
112 | "kernel.sysrq" = 0;
113 | "net.ipv4.icmp_ignore_bogus_error_responses" = 1;
114 | "net.ipv4.conf.default.rp_filter" = 1;
115 | "net.ipv4.conf.all.rp_filter" = 1;
116 | "net.ipv4.conf.all.accept_source_route" = 0;
117 | "net.ipv6.conf.all.accept_source_route" = 0;
118 | "net.ipv4.conf.all.send_redirects" = 0;
119 | "net.ipv4.conf.default.send_redirects" = 0;
120 | "net.ipv4.conf.all.accept_redirects" = 0;
121 | "net.ipv4.conf.default.accept_redirects" = 0;
122 | "net.ipv4.conf.all.secure_redirects" = 0;
123 | "net.ipv4.conf.default.secure_redirects" = 0;
124 | "net.ipv6.conf.all.accept_redirects" = 0;
125 | "net.ipv6.conf.default.accept_redirects" = 0;
126 | "net.ipv4.tcp_syncookies" = 1;
127 | "net.ipv4.tcp_rfc1337" = 1;
128 | "net.ipv4.tcp_fastopen" = 3;
129 | "net.ipv4.tcp_congestion_control" = "bbr";
130 | "net.core.default_qdisc" = "cake";
131 | };
132 | }
133 |
--------------------------------------------------------------------------------
/nixos/packages.nix:
--------------------------------------------------------------------------------
1 | {
2 | pkgs,
3 | inputs,
4 | pkgs-stable,
5 | ...
6 | }: {
7 | environment.systemPackages = with pkgs; [
8 | # CLI
9 | ## internet
10 | aria2
11 | curl
12 | wget
13 | yt-dlp
14 | rsync
15 | rclone
16 | (ani-cli.override {mpv = null;})
17 |
18 | ## rusty unix
19 | dust
20 | xcp
21 | duf
22 | fd
23 | file
24 | sd
25 | ripgrep
26 | jaq
27 |
28 | ## helpful
29 | gcc
30 | xdg-utils
31 | ffmpeg
32 | nvtopPackages.nvidia
33 | sqlite
34 | timg
35 | imagemagick
36 | playerctl
37 | translate-shell
38 | pulsemixer
39 |
40 | ## wayland
41 | grimblast
42 | cliphist
43 | swww
44 | wl-clipboard
45 | eww
46 | wayvnc
47 |
48 | ## nix
49 | microfetch
50 | nix-output-monitor
51 | nurl
52 | nix-tree
53 | nix-init
54 | nvd
55 | sops
56 |
57 | ## compression
58 | zip
59 | unzip
60 | rar
61 | unrar
62 | _7zz
63 |
64 | # GUI
65 | pkgs-stable.calibre
66 | pkgs-stable.vesktop
67 | pkgs-stable.qbittorrent
68 | nautilus
69 | qalculate-qt
70 | glava
71 | pkgs-stable.nsxiv
72 | gimp
73 |
74 | ## games
75 | heroic
76 | (prismlauncher.override {jdks = with pkgs; [jdk23 jdk21 jdk17];})
77 | protonup-qt
78 | # shipwright
79 | yuzu
80 |
81 | ### VNs
82 | pkgs-stable.onscripter-en
83 |
84 | ### emulators
85 | pkgs-stable.desmume
86 | pkgs-stable.mgba
87 | snes9x-gtk
88 | inputs.zen-browser.packages."${system}".default
89 |
90 | pkgs-stable.pcsx2
91 |
92 | # DEV
93 |
94 | ## libs
95 | libnotify
96 | gtk3
97 | libsixel
98 | openssl
99 | xwayland
100 |
101 | ## docs
102 | man-pages
103 | man-pages-posix
104 |
105 | ## langs
106 | python3
107 | python312Packages.ipython
108 | zig
109 | zls
110 | leiningen
111 |
112 | ## editors
113 | neovim
114 | emacs30-pgtk
115 | emacs-lsp-booster
116 | ];
117 | }
118 |
--------------------------------------------------------------------------------
/nixos/stylix.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}: {
2 | stylix = {
3 | enable = true;
4 | polarity = "dark";
5 | image = "${pkgs.my-misc}/share/passive/oxocarbon.png";
6 | base16Scheme = {
7 | slug = "oxocarbon-dark";
8 | name = "Oxocarbon Dark";
9 | author = "shaunsingh/IBM";
10 | palette = {
11 | base00 = "161616";
12 | base01 = "262626";
13 | base02 = "393939";
14 | base03 = "525252";
15 | base04 = "dde1e6";
16 | base05 = "f2f4f8";
17 | base06 = "ffffff";
18 | base07 = "08bdba";
19 | base08 = "3ddbd9";
20 | base09 = "78a9ff";
21 | base0A = "ee5396";
22 | base0B = "33b1ff";
23 | base0C = "ff7eb6";
24 | base0D = "42be65";
25 | base0E = "be95ff";
26 | base0F = "82cfff";
27 | };
28 | };
29 | fonts = rec {
30 | serif = {
31 | package = pkgs.my-fonts;
32 | name = "Kollektif";
33 | };
34 | sansSerif = serif;
35 | monospace = {
36 | package = pkgs.my-fonts;
37 | name = "Zenbones Proto";
38 | };
39 | emoji = {
40 | package = pkgs.noto-fonts-emoji;
41 | name = "Noto Color Emoji";
42 | };
43 | sizes = {
44 | applications = 13;
45 | desktop = 13;
46 | popups = 14;
47 | terminal = 15;
48 | };
49 | };
50 | opacity = {
51 | terminal = 0.90;
52 | popups = 0.85;
53 | desktop = 0.80;
54 | };
55 | cursor = {
56 | package = pkgs.phinger-cursors;
57 | name = "phinger-cursors-light";
58 | size = 32;
59 | };
60 | };
61 | fonts = {
62 | fontconfig.defaultFonts = rec {
63 | sansSerif = ["Yutapon coding Regular"];
64 | serif = sansSerif;
65 | monospace = ["Symbols Nerd Font Mono" "Yutapon coding Regular"];
66 | };
67 | packages = with pkgs; [
68 | my-fonts
69 | nerd-fonts.symbols-only
70 | ];
71 | };
72 | }
73 |
--------------------------------------------------------------------------------
/pkgs/default.nix:
--------------------------------------------------------------------------------
1 | self: super: {
2 | fcitx5-fluent = self.callPackage ./fcitx5-fluent.nix {};
3 | yuzu = self.callPackage ./yuzu.nix {};
4 | mpv-youtube-search = self.mpvScripts.callPackage ./mpv-youtube-search.nix {};
5 |
6 | librewolf = super.librewolf.override {
7 | extraPrefs = ''
8 | pref("devtools.source-map.client-service.enabled", false);
9 | pref("librewolf.console.logging_disabled", true)
10 | pref("devtools.toolbox.host", "window");
11 | pref("privacy.resistFingerprinting", false);
12 | pref("webgl.disabled", false);
13 | pref("librewolf.debugger.force_detach", true);
14 | '';
15 | };
16 |
17 | onscripter-en = super.onscripter-en.overrideAttrs (oldAttrs: {
18 | version = "unstable-2024-07-21";
19 | src = super.fetchFromGitHub {
20 | owner = "Galladite27";
21 | repo = oldAttrs.pname;
22 | rev = "398b0328efe1e060301e7f8bfd2623c202646dd3";
23 | hash = "sha256-AqvKiqRzA5ICu1BT3PW7PCSwsgzFsg1DunNErKi4SoI=";
24 | };
25 | });
26 |
27 | sptlrx = super.sptlrx.overrideAttrs (oldAttrs: {
28 | version = "unstable-2024-10-27";
29 | src = super.fetchFromGitHub {
30 | owner = "raitonoberu";
31 | repo = oldAttrs.pname;
32 | rev = "be71eb5defec847b467f5d69d10f0037e71fdfbe";
33 | hash = "sha256-8dq7cxihrjSrJeOga7Jgzv5k4lbhavYJRi4uv60GkGc=";
34 | };
35 | vendorHash = "sha256-N02+B8btheskAAhWnPpFN/E/aarCxmCi07sYnfsYDmY=";
36 | checkPhase = null;
37 | });
38 |
39 | # NOTE: fuck glava; version below has --pipe and **actually** builds (fuck meson too)
40 | glava = super.glava.overrideAttrs (oldAttrs: {
41 | version = "unstable-no-meson";
42 | src = super.fetchFromGitHub {
43 | owner = "wacossusca34";
44 | repo = oldAttrs.pname;
45 | rev = "c766c574a6e952aff96920f66892d0503281f8aa";
46 | sha256 = "sha256-Ay9p75z/bc2/2p6GkPiVGag0iMj/7w4loyr34iX98Z4=";
47 | };
48 | postPatch = ''
49 | substituteInPlace shaders/bars.glsl \
50 | --replace-fail "#define BAR_WIDTH 5" "#define BAR_WIDTH 8" \
51 | --replace-fail "#define BAR_GAP 1" "#define BAR_GAP 2"
52 | '';
53 | });
54 |
55 | nix-output-monitor = let
56 | icons = {
57 | "↑" = "f062";
58 | "↓" = "f063";
59 | "⏱" = "f520";
60 | "⏵" = "f04b";
61 | "✔" = "f00c";
62 | "⏸" = "f04c";
63 | "⚠" = "f071";
64 | "∅" = "f1da";
65 | "∑" = "f04a0";
66 | };
67 | in
68 | super.nix-output-monitor.overrideAttrs {
69 | postPatch = ''
70 | substituteInPlace lib/NOM/Print.hs \
71 | ${super.lib.concatLines (super.lib.mapAttrsToList (old: new: "--replace-fail '${old}' '\\x${new}' \\") icons)}
72 | '';
73 | };
74 | }
75 |
--------------------------------------------------------------------------------
/pkgs/fcitx5-fluent.nix:
--------------------------------------------------------------------------------
1 | {
2 | stdenvNoCC,
3 | fetchFromGitHub,
4 | lib,
5 | }:
6 | stdenvNoCC.mkDerivation (finalAttrs: {
7 | pname = "fcitx5-fluentdark";
8 | version = "v0.4.0";
9 |
10 | src = fetchFromGitHub {
11 | owner = "Reverier-Xu";
12 | repo = "FluentDark-fcitx5";
13 | rev = finalAttrs.version;
14 | hash = "sha256-wefleY3dMM3rk1/cZn36n2WWLuRF9dTi3aeDDNiR6NU=";
15 | };
16 |
17 | installPhase = ''
18 | mkdir -p $out/share/fcitx5/themes/FluentDark/
19 | cp -r FluentDark/* $out/share/fcitx5/themes/FluentDark/
20 |
21 | mkdir -p $out/share/fcitx5/themes/FluentDark-solid/
22 | cp -r FluentDark-solid/* $out/share/fcitx5/themes/FluentDark-solid/
23 | '';
24 |
25 | meta = {
26 | description = "Fcitx5 theme based on Fluent Dark Colors";
27 | homepage = "https://github.com/Reverier-Xu/FluentDark-fcitx5";
28 | maintainers = [lib.maintainers._71zenith];
29 | platforms = lib.platforms.all;
30 | };
31 | })
32 |
--------------------------------------------------------------------------------
/pkgs/mpv-youtube-search.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | fetchFromGitHub,
4 | unstableGitUpdater,
5 | buildLua,
6 | }:
7 | buildLua (finalAttrs: {
8 | pname = "mpv-youtube-search";
9 |
10 | version = "v1.0.0";
11 | src = fetchFromGitHub {
12 | owner = "willswats";
13 | repo = finalAttrs.pname;
14 | rev = "51dc4e5ef1f2b6953755427122cf4706b8f98a80";
15 | hash = "sha256-LD3uhE0uELlOZlSbWe2+sqozqOmfRY4m75Cxu3LgUaw=";
16 | };
17 | passthru.updateScript = unstableGitUpdater {};
18 | meta = {
19 | description = "Search youtube from MPV";
20 | homepage = "https://github.com/willswats/mpv-youtube-search";
21 | license = lib.licenses.mit;
22 | maintainers = [lib.maintainers._71zenith];
23 | };
24 | })
25 |
--------------------------------------------------------------------------------
/pkgs/plugins-nvim.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}: let
2 | inherit (pkgs) fetchFromGitHub;
3 | inherit (pkgs.vimUtils) buildVimPlugin;
4 | in {
5 | lualine-so-fancy = buildVimPlugin {
6 | name = "lualine-so-fancy";
7 | doCheck = false;
8 | src = fetchFromGitHub {
9 | owner = "meuter";
10 | repo = "lualine-so-fancy.nvim";
11 | rev = "45197358e5274d301d98638bf079f3437d6eacf8";
12 | hash = "sha256-j6XI4cw1ouYEvSiKdam8RAqxefDqeLwe37Qir/UO+8g=";
13 | };
14 | };
15 | buffer-manager = buildVimPlugin {
16 | name = "buffer-manager";
17 | doCheck = false;
18 | src = fetchFromGitHub {
19 | owner = "j-morano";
20 | repo = "buffer_manager.nvim";
21 | rev = "fd36131b2b3e0f03fd6353ae2ffc88cf920b3bbb";
22 | hash = "sha256-abe9ZGmL7U9rC+LxC3LO5/bOn8lHke1FCKO0V3TZGs0=";
23 | };
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/pkgs/scripts.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | pkgs,
4 | }: let
5 | inherit (pkgs) writeShellScriptBin writeShellScript wtype tesseract5 socat;
6 | _ = pkgs.lib.getExe;
7 | in {
8 | wlOcr = writeShellScript "wlOcr" ''
9 | grimblast save area - | ${_ tesseract5} -l eng+jpn+jpn_vert+kor+kor_vert+deu+rus - - | wl-copy
10 | echo "$(wl-paste)"
11 | notify-send -- "$(wl-paste)"
12 | '';
13 | transLiner = writeShellScript "transLiner" ''
14 | wl-paste | trans -no-warn -no-autocorrect -b -t en | wl-copy
15 | echo "$(wl-paste)"
16 | notify-send -- "$(wl-paste)"
17 | '';
18 | openMedia = writeShellScript "openMedia" ''
19 | trap 'rm -rf /tmp/mpvsocket' EXIT TERM KILL
20 | case "$(wl-paste --list-types)" in
21 | *text*)
22 | notify-send 'Opening URL'
23 | if [ -e "$(wl-paste)" ]; then
24 | wl-paste | xargs -0 xdg-open || notify-send 'Clipboard content is not media'
25 | else
26 | if [ -e /tmp/mpvsocket ]; then
27 | echo "loadfile $(wl-paste)" | ${_ socat} - /tmp/mpvsocket
28 | else
29 | mpv "$(wl-paste)" --title="mpvplay" --no-resume-playback --input-ipc-server="/tmp/mpvsocket" || notify-send "Not a valid URL !!"
30 | fi
31 | fi
32 | ;;
33 | *image*)
34 | notify-send 'Opening image'
35 | wl-paste | mpv -
36 | ;;
37 | *)
38 | wl-paste | xargs -0 xdg-open || notify-send 'Clipboard content is not media'
39 | exit 1
40 | ;;
41 | esac
42 | '';
43 | copyVid = writeShellScript "copyVid" ''
44 | url=$(wl-paste | sed 's/x.com/twitter.com/g')
45 | notify-send "Downloading..."
46 | ! yt-dlp -f "best[ext=mp4]" --embed-thumbnail --force-overwrites "$url" --paths "/tmp" --output send.mp4 && notify-send "Not a valid URL !!" && exit 1
47 | wl-copy -t text/uri-list "file:///tmp/send.mp4" && notify-send "Copied to clipboard"
48 | '';
49 | rofiGuard = writeShellScript "rofiGuard" ''
50 | build_rofi() {
51 | gv="$(systemctl list-unit-files --type=service --all | sed -nE 's/^(wg-quick.+).service.*/\1/p')"
52 | echo "$gv" | rofi -theme-str 'window { width: 300px; }' -dmenu -p "" -mesg "$1" -l "$(echo "$gv" | wc -l) -filter"
53 | }
54 | act_on_rofi() {
55 | [ -z "$1" ] && exit 1
56 | [ "$1" = "$2" ] && sudo systemctl stop "$1" && notify-send "Switched OFF" "$1" && exit 0
57 | [ -n "$2" ] && sudo systemctl stop "$2" && notify-send "Switched OFF" "$2"
58 | sudo systemctl start "$1" && notify "ON" "$1" && exit 0
59 | }
60 | if [ -z "$(sudo wg)" ]; then
61 | act_on_rofi "$(build_rofi "STATUS: OFF")"
62 | else
63 | ga=$(systemctl list-units --type=service | sed -nE 's/(wg-quick.+).service.*/\1/p' | tr -d ' ')
64 | act_on_rofi "$(build_rofi "STATUS: ON $ga")" "$ga"
65 | fi
66 | '';
67 | _4khd = writeShellScriptBin "4khd" ''
68 | player=debug
69 | while [ $# -gt 0 ]; do
70 | case "$1" in
71 | -d | --download ) player=download ;;
72 | -p | --player )
73 | [ "$#" -lt 2 ] && printf "\033[2K\r\033[1;31m%s\033[0m\n" "missing argument!" && exit 1
74 | player=$2
75 | shift
76 | ;;
77 | -h | --help)
78 | printf "%s\n" "''${0##*/} -d | --download | -p | --player | -h | --help"
79 | exit 0
80 | ;;
81 | *) query="''${query} ''${1}";;
82 | esac
83 | shift
84 | done
85 | [ -z "$query" ] && printf "%s\n" "''${0##*/} -d | --download | -p | --player | -h | --help" && exit 1
86 | for i in $query; do
87 | html=$(curl -Ls "$i" | tr -d '\0')
88 | links=$(printf "%s" "$html" | sed -nE 's|^()?
([^<]*).*/\1/p')
91 |
92 | for j in $pages; do
93 | extra_links=$(curl -Ls "''${i}/''${j}" | sed -nE 's|^()?
&1 >/dev/null
111 | while [ -z $input ]; do
112 | ${_ wtype} -M ctrl -M shift f -m ctrl -m shift
113 | input="$(tr ' ' '\n' < /tmp/console | tr -d \' | tr -d \" | tr -d \[ | tr -d \] | tr -d \{ | tr -d \} | tr -d \( | tr -d \) | sed 's|=|\n|' | tr -s '\n')"
114 | done
115 | IFS="
116 | "
117 | for i in $input; do
118 | [ -e "$i" ] && echo "$i"
119 | done
120 | '';
121 | epubOpen = writeShellScript "epubOpen" ''
122 | epubs=$(fd -e=epub . ~/kindle/)
123 | IFS="
124 | "
125 | open() {
126 | file=$(cat -)
127 | [ -n "$file" ] && zathura "$file.epub"
128 | }
129 | for i in $epubs; do
130 | image="$(dirname "$i")/cover.jpg"
131 | echo -en "''${i%.epub}\0icon\x1f$image\n"
132 | done | rofi -i -dmenu -display-column-separator "/" -display-columns 7 -theme preview -p "" -theme-str 'icon-current-entry { size: 35%;}' | open
133 | '';
134 | glavaShow = writeShellScript "glavaShow" ''
135 | id=$(pulsemixer -l | grep glava | sed -nE 's/.*ID: (.+?), Name.*/\1/p')
136 | ([ -n "$id" ] && pulsemixer --id $id --toggle-mute) || (tail -f /tmp/cover.info 2>/dev/null | glava --pipe=fg)
137 | '';
138 | openVNC = writeShellScript "openVNC" ''
139 | set -e
140 | wayvnc 0.0.0.0 &
141 | notify-send "Starting VNC session"
142 | wait
143 | trap 'notify-send "Ending VNC session"' EXIT
144 | '';
145 | copyPalette = let
146 | colorsWithNames = builtins.concatStringsSep "\n" (
147 | map
148 | (colorName: let
149 | colorValue = config.stylix.base16Scheme.palette.${colorName};
150 | in "#${toString colorValue} (${builtins.substring 4 2 colorName})")
151 | (builtins.attrNames config.stylix.base16Scheme.palette)
152 | );
153 | in
154 | writeShellScript "copyPalette" ''
155 | echo "${colorsWithNames}" | rofi -i -dmenu -theme-str 'listview { columns: 2; lines: 8; } window { width: 500px; }' -markup-rows -p "🎨" -mesg "Choose a color" | cut -d\' -f2 | wl-copy && ([ "$1" = "glava" ] && echo "fg = $(wl-paste)" > /tmp/cover.info || eww update col="$(wl-paste)")
156 | '';
157 | }
158 |
--------------------------------------------------------------------------------
/pkgs/yuzu.nix:
--------------------------------------------------------------------------------
1 | {
2 | fetchurl,
3 | appimageTools,
4 | ...
5 | }: let
6 | pname = "yuzu";
7 | version = "EA-4176";
8 |
9 | src = fetchurl {
10 | url = "https://archive.org/download/citra-qt-and-yuzu-EA/Linux-Yuzu-EA-4176.AppImage";
11 | sha256 = "sha256-bUTVL8br2POy5HB1FszlNQNChdRWcwIlG6/RCceXIlg=";
12 | };
13 |
14 | appimage-contents = appimageTools.extract {
15 | inherit pname version src;
16 | };
17 |
18 | desktop-file-name = "org.yuzu_emu.yuzu";
19 | in
20 | appimageTools.wrapAppImage {
21 | inherit pname version;
22 | src = appimage-contents;
23 | extraInstallCommands = ''
24 | install -m 444 -D ${appimage-contents}/${desktop-file-name}.desktop -t $out/share/applications
25 | cp -r ${appimage-contents}/usr/share/icons $out/share
26 | '';
27 | }
28 |
--------------------------------------------------------------------------------
/secrets/secrets.yaml:
--------------------------------------------------------------------------------
1 | welcome: ENC[AES256_GCM,data:XReKAcBqiU6lweF+StFNyg==,iv:Wz8KzUYEXljGn92c0YEVw93HnGhUT2xsQvvgSas4Wk8=,tag:jL/lA9VJwY+vLjdQgYCeqw==,type:str]
2 | root_pass: ENC[AES256_GCM,data:EEca6h1NWe59sQZVdEJpB5KwsbOY+DWlSsdBhjyrTavc4MaaJVWcSoj55guCXiZN1LVLsNMo5B8h2GQp46Gp6vl8L1rfccwreg==,iv:2aStFBRO3Z78IfYb+S8gmE89ZRzeHNLYrLLBMoIkiHI=,tag:BUalKIjX63e8oeD3Af0PvQ==,type:str]
3 | user_pass: ENC[AES256_GCM,data:ADG/Rv1u++5set3woTBR4689x+RYJZslJPbHTmLipc3jt/OG2ZWWBkZPykx7CsQD1hQMbR2U1K6c8vndTf4t6FLKoMNUVuOoAA==,iv:FRmeM0v9AiPNsVzPEmAT0AizQK1USxAkHKBebDymns0=,tag:uIW0J6GE9O/ypA409LvqaQ==,type:str]
4 | spot_username: ENC[AES256_GCM,data:/ezCbbpNVvhMfk56oFzOMbqZ8uxSNb1TG+k7Mg==,iv:bnoH5+dprMuAyAVgeAnEYVNgDYoDa+U/qEhbZkmnPYg=,tag:yOq5qAd6fkvYD4A801G92Q==,type:str]
5 | spot_auth_data: ENC[AES256_GCM,data:aBPRzukvxBz7MsVnmcRVdYxgjtRgOVJ84Oqdr9ViE7WzhU8zHMb1xEcCJ3b4hxj49y85Npvxcb8Ejcekn/5TG61RhmDXuXH/RG4EjHbhMG234HC4uLqxjB+ryMIxw2BVv7icmpXGY45pCny7NPUJgYT8SeCWGk/7PXEPnhnNmfgqA+QYoHreDnqkoGP4u3WMo0NiTiBwX/qHy724VUWpV2zm3XyH3vcIPORRCXBJhUsF3QyekKenJj9+5kjn48x2Qtv78ZrX53/vCLyJlRFvY42ucTr7L30eC81qAQiNapIvUFF9wFKCualuGoAhF3avQSTUVB2CGnwL4mbbLQdsIhzagqEoz9hKNeuGhmQRY3CjY16edtEeNcWdzJy5s8fFqsVAAO7p8qRhLDJ4,iv:ZOrkSkLt7DFjIEwZ0zpuvmcNdPRrtwbPBkSua18bvpc=,tag:XsLhez13RVH76HGQgv1Ylg==,type:str]
6 | spot_client_id: ENC[AES256_GCM,data:H3AZab1oIXQlLlutylbZxHD4z7o7hKGMflLXb8SHUw0=,iv:Eeq2OVEVnc/t1MVG2ZeGo5oD5GyChCqlNsR/4slLhWo=,tag:Glt7dkrG2nOydicYIQM8kg==,type:str]
7 | vpn_private_jp: ENC[AES256_GCM,data:QRLB9FNbkIXIBIie+hR/2rfdcM57se0IIJ9DvvAqkgYWOflzEOkLhqcdRmI=,iv:s1n0Fq7/Kub9vPkro1wFQDBu7zD+4Iy6zDfn3QeF5VI=,tag:uhbsTVZegInS1pWXqykpUQ==,type:str]
8 | vpn_private_nl: ENC[AES256_GCM,data:88COOiqNV4YjrmRdrSOVW9wflEgCtjF8iw3CWLVdHvvTAgcNp6XnKwiEIj4=,iv:+Sviyh+8ih4o2gwtCggyF8m4QvQxZEduqWOpTCbybyE=,tag:+t886I56ULbhleT8oLvruw==,type:str]
9 | vpn_private_us: ENC[AES256_GCM,data:1kkRfRfK1WL9Royezl6le/HFipLu1nnKLUGcvHcn7xLIW1WgguMtMw6QQM4=,iv:AQ5Rt+jZPLOvbYSdBNtMVbhvfpVnOLPafzLRIKxx608=,tag:BB8NC0yGtQ24vH8B+ShbHw==,type:str]
10 | ssh_public: ENC[AES256_GCM,data:BJtDekq1KCiQATObplh56avD0Egn8vr9/s9+bwCOz5D9UpdRVCCvmeOMUPLhTFuRZWG0AhcM6Tdhd9T24ZK2RB4w/IhjoOhdw3GDaluHLcg=,iv:HVze1C0zk7oDErx4cjEsbjX8fKieyDjZsa6Ga/pfw4Y=,tag:K+8qwRbgYvn9efIIUiIB+Q==,type:str]
11 | sops:
12 | kms: []
13 | gcp_kms: []
14 | azure_kv: []
15 | hc_vault: []
16 | age:
17 | - recipient: age15s6yzdcqkknkele2lw77utgze3cul8vzt9jmtvquu26mckcutslsdpm6x4
18 | enc: |
19 | -----BEGIN AGE ENCRYPTED FILE-----
20 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBuQ0svUDMzMU1FcnRiRzdX
21 | VkJqQVZERCt3T09pYUJhLzdCOVVSR0JmYkdFCkpYZGltdE5kYnArVEYzdnZnUEFT
22 | UmpEbWZuN1pGM2wzUnY4cTNmUEpHRFUKLS0tIE94QjRBdDNvSnYwQ0J3dGJoTjh2
23 | YXJ6dlkrMENtZGlQK1p6TEd0MnZ3c28KURTvKmzkWX07KY7xF/+OUtpAq+UQkSuk
24 | VRnnExRp49ZNuGmz/DjzfTx4nywfXih4NjMagRmhDGv5iIL7rIuFPg==
25 | -----END AGE ENCRYPTED FILE-----
26 | lastmodified: "2025-01-01T05:55:09Z"
27 | mac: ENC[AES256_GCM,data:uMef0ezkGo7XvJjDz3Ympr7797rIWmkca2yDnBmu0CN2b24tdJkdqjMMopHW2P6Q6iA8ddvAMvw9izuvWbJD3vLy32ozTVGFT0C1RnTYKC96e2NDsnQT1uHagITj+IsayKmTFbcUDhnhbSeWPafSIBmaaD9q9V/5xl/EFjE+GM4=,iv:ECQ6jhEyKAhnvOJ4cUM13vhgkUoGtHheenPfuVHd1oc=,tag:ZQQWJG8y9kk1eSAeH2lfTQ==,type:str]
28 | pgp: []
29 | unencrypted_suffix: _unencrypted
30 | version: 3.9.2
31 |
--------------------------------------------------------------------------------