authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-28 08:31:42-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-28 08:31:42-07:00
log800f63b000bebf518dad1b6e6e85e99640e95ec6
tree67db8e01a8434907287f7f2503103b286688c198
parentb9e231d72f6a18b719440657b0048dcd9699c442
signature Commit is signed but in an unrecognized format.

made config work on nixos


7 files changed, 640 insertions(+), 725 deletions(-)

flake.lock+6-83
......@@ -50,22 +50,6 @@
5050 }
5151 },
5252 "flake-compat": {
53 "flake": false,
54 "locked": {
55 "lastModified": 1746162366,
56 "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
57 "owner": "nix-community",
58 "repo": "flake-compat",
59 "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
60 "type": "github"
61 },
62 "original": {
63 "owner": "nix-community",
64 "repo": "flake-compat",
65 "type": "github"
66 }
67 },
68 "flake-compat_2": {
6953 "flake": false,
7054 "locked": {
7155 "lastModified": 1696426674,
......@@ -81,7 +65,7 @@
8165 "type": "github"
8266 }
8367 },
84 "flake-compat_3": {
68 "flake-compat_2": {
8569 "flake": false,
8670 "locked": {
8771 "lastModified": 1696426674,
......@@ -427,7 +411,7 @@
427411 "nvf",
428412 "nixpkgs"
429413 ],
430 "rust-overlay": "rust-overlay_2"
414 "rust-overlay": "rust-overlay"
431415 },
432416 "locked": {
433417 "lastModified": 1741118843,
......@@ -483,29 +467,6 @@
483467 "type": "github"
484468 }
485469 },
486 "nixos-cosmic": {
487 "inputs": {
488 "flake-compat": "flake-compat",
489 "nixpkgs": [
490 "nixpkgs"
491 ],
492 "nixpkgs-stable": "nixpkgs-stable",
493 "rust-overlay": "rust-overlay"
494 },
495 "locked": {
496 "lastModified": 1747826251,
497 "narHash": "sha256-Fe4AXmnnAKnh/wIe1ao4Pv/8m6WGA1ujwp6VApgos30=",
498 "owner": "lilyinstarlight",
499 "repo": "nixos-cosmic",
500 "rev": "9a67b4a289cd8994080398d40b57cfde8e8cfb0a",
501 "type": "github"
502 },
503 "original": {
504 "owner": "lilyinstarlight",
505 "repo": "nixos-cosmic",
506 "type": "github"
507 }
508 },
509470 "nixpkgs": {
510471 "locked": {
511472 "lastModified": 1736012469,
......@@ -537,22 +498,6 @@
537498 "type": "github"
538499 }
539500 },
540 "nixpkgs-stable": {
541 "locked": {
542 "lastModified": 1747676747,
543 "narHash": "sha256-LXkWBVqilgx7Pohwqu/ABxDVw+Cmi5/Mj2S2mpUH0Fw=",
544 "owner": "NixOS",
545 "repo": "nixpkgs",
546 "rev": "72841a4a8761d1aed92ef6169a636872c986c76d",
547 "type": "github"
548 },
549 "original": {
550 "owner": "NixOS",
551 "ref": "nixos-24.11",
552 "repo": "nixpkgs",
553 "type": "github"
554 }
555 },
556501 "nixpkgs_2": {
557502 "locked": {
558503 "lastModified": 1747744144,
......@@ -647,36 +592,14 @@
647592 "nh": "nh",
648593 "nix-index-database": "nix-index-database",
649594 "nix-options-search": "nix-options-search",
650 "nixos-cosmic": "nixos-cosmic",
651595 "nixpkgs": "nixpkgs_2",
652596 "nvf": "nvf",
653 "rust-overlay": "rust-overlay_3",
597 "rust-overlay": "rust-overlay_2",
654598 "zig": "zig",
655599 "zls": "zls"
656600 }
657601 },
658602 "rust-overlay": {
659 "inputs": {
660 "nixpkgs": [
661 "nixos-cosmic",
662 "nixpkgs"
663 ]
664 },
665 "locked": {
666 "lastModified": 1747795013,
667 "narHash": "sha256-c7i0xJ+xFhgjO9SWHYu5dF/7lq63RPDvwKAdjc6VCE4=",
668 "owner": "oxalica",
669 "repo": "rust-overlay",
670 "rev": "6b1cf12374361859242a562e1933a7930649131a",
671 "type": "github"
672 },
673 "original": {
674 "owner": "oxalica",
675 "repo": "rust-overlay",
676 "type": "github"
677 }
678 },
679 "rust-overlay_2": {
680603 "inputs": {
681604 "nixpkgs": [
682605 "nvf",
......@@ -698,7 +621,7 @@
698621 "type": "github"
699622 }
700623 },
701 "rust-overlay_3": {
624 "rust-overlay_2": {
702625 "inputs": {
703626 "nixpkgs": [
704627 "nixpkgs"
......@@ -924,7 +847,7 @@
924847 },
925848 "zig": {
926849 "inputs": {
927 "flake-compat": "flake-compat_2",
850 "flake-compat": "flake-compat",
928851 "flake-utils": "flake-utils_5",
929852 "nixpkgs": "nixpkgs_3"
930853 },
......@@ -944,7 +867,7 @@
944867 },
945868 "zig-overlay": {
946869 "inputs": {
947 "flake-compat": "flake-compat_3",
870 "flake-compat": "flake-compat_2",
948871 "flake-utils": "flake-utils_7",
949872 "nixpkgs": [
950873 "zls",
flake.nix+108-118
......@@ -29,9 +29,6 @@
2929 moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly.
3030 moonlight.inputs.nixpkgs.follows = "nixpkgs";
3131
32 nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
33 nixos-cosmic.inputs.nixpkgs.follows = "nixpkgs";
34
3532 nh.url = "github:viperML/nh";
3633 nh.inputs.nixpkgs.follows = "nixpkgs";
3734
......@@ -40,80 +37,76 @@
4037 nix-index-database.url = "github:nix-community/nix-index-database";
4138 nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
4239 };
43 outputs =
44 {
45 self,
46 nixpkgs,
47 lix-module,
48 nixos-cosmic,
49 darwin,
50 ...
51 }@inputs:
52 let
53 lib = nixpkgs.lib;
54 # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
55 overlays = [
56 inputs.zig.overlays.default
57 inputs.rust-overlay.overlays.default
58 inputs.nh.overlays.default
59
60 # https://github.com/LnL7/nix-darwin/issues/1041
61 (_: prev: {
62 karabiner-elements = prev.karabiner-elements.overrideAttrs (old: {
63 version = "14.13.0";
64
65 src = prev.fetchurl {
66 inherit (old.src) url;
67 hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw=";
68 };
69 });
40 outputs = {
41 self,
42 nixpkgs,
43 lix-module,
44 darwin,
45 ...
46 } @ inputs: let
47 lib = nixpkgs.lib;
48 # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
49 overlays = [
50 inputs.zig.overlays.default
51 inputs.rust-overlay.overlays.default
52 inputs.nh.overlays.default
53
54 # https://github.com/LnL7/nix-darwin/issues/1041
55 (_: prev: {
56 karabiner-elements = prev.karabiner-elements.overrideAttrs (old: {
57 version = "14.13.0";
58
59 src = prev.fetchurl {
60 inherit (old.src) url;
61 hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw=";
62 };
63 });
64 })
65 ];
66
67 # Users of this flake currently use x86_64 Linux and Apple Silicon
68 systems = [
69 "x86_64-linux"
70 "aarch64-darwin"
71 ];
72 forAllSystems = f:
73 builtins.listToAttrs (
74 builtins.map (system: {
75 name = system;
76 value = f (
77 inputs
78 // {
79 inherit system;
80 pkgs = nixpkgs.legacyPackages.${system};
81 }
82 );
7083 })
71 ];
84 systems
85 );
7286
73 # Users of this flake currently use x86_64 Linux and Apple Silicon
74 systems = [
75 "x86_64-linux"
76 "aarch64-darwin"
77 ];
78 forAllSystems =
79 f:
80 builtins.listToAttrs (
81 builtins.map (system: {
82 name = system;
83 value = f (
84 inputs
85 // {
86 inherit system;
87 pkgs = nixpkgs.legacyPackages.${system};
88 }
89 );
90 }) systems
91 );
92
93 mkSystem = import ./lib/mkSystem.nix {
94 inherit
95 overlays
96 nixpkgs
97 lix-module
98 inputs
99 mkNeovim
100 ;
101 };
102 mkNeovim = import ./lib/mkNeovim.nix {
103 inherit
104 self
105 overlays
106 nixpkgs
107 inputs
108 ;
109 };
110 in
111 rec {
112 inherit self;
113 # "nix fmt"
114 formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);
115 packages = forAllSystems (
116 { system, ... }:
87 mkSystem = import ./lib/mkSystem.nix {
88 inherit
89 overlays
90 nixpkgs
91 lix-module
92 inputs
93 mkNeovim
94 ;
95 };
96 mkNeovim = import ./lib/mkNeovim.nix {
97 inherit
98 self
99 overlays
100 nixpkgs
101 inputs
102 ;
103 };
104 in rec {
105 inherit self;
106 # "nix fmt"
107 formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);
108 packages = forAllSystems (
109 {system, ...}:
117110 {
118111 nvim-chloe = mkNeovim "chloe" system;
119112 nvim-natalie = mkNeovim "natalie" system;
......@@ -122,49 +115,46 @@
122115 # "nix run .#darwin-rebuild"
123116 darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
124117 }
125 );
118 );
119
120 # natalie's desktop computer
121 nixosConfigurations.nixos = mkSystem "nixos" {
122 user = "natalie";
123 host = "desktop";
124 system = "x86_64-linux";
125 extraModules = [
126 ];
127 };
128 # natalie's laptop
129 darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
130 user = "natalie";
131 host = "laptop";
132 system = "aarch64-darwin";
133 };
126134
127 # natalie's desktop computer
128 nixosConfigurations.nixos = mkSystem "nixos" {
129 user = "natalie";
130 host = "desktop";
131 system = "x86_64-linux";
132 extraModules = [
133 nixos-cosmic.nixosModules.default
134 ];
135 };
136 # natalie's laptop
137 darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
138 user = "natalie";
139 host = "laptop";
140 system = "aarch64-darwin";
141 };
142
143 # chloe's mac studio "sandwich"
144 darwinConfigurations.sandwich = mkSystem "sandwich" {
145 user = "chloe";
146 host = "sandwich";
147 system = "aarch64-darwin";
148 };
149 # chloe's macbook air "paperback"
150 darwinConfigurations.paperback = mkSystem "paperback" {
151 user = "chloe";
152 host = "paperback";
153 system = "aarch64-darwin";
154 };
155
156 # generate checks for "nix flake check --all-systems --no-build"
157 checks.aarch64-darwin = builtins.listToAttrs (
158 builtins.map (
159 name:
160 let
161 d = darwinConfigurations.${name}.system;
162 in
163 {
164 name = "darwinConfiguration-" + d.name;
165 value = d;
166 }
167 ) (builtins.attrNames darwinConfigurations)
168 );
135 # chloe's mac studio "sandwich"
136 darwinConfigurations.sandwich = mkSystem "sandwich" {
137 user = "chloe";
138 host = "sandwich";
139 system = "aarch64-darwin";
140 };
141 # chloe's macbook air "paperback"
142 darwinConfigurations.paperback = mkSystem "paperback" {
143 user = "chloe";
144 host = "paperback";
145 system = "aarch64-darwin";
169146 };
147
148 # generate checks for "nix flake check --all-systems --no-build"
149 checks.aarch64-darwin = builtins.listToAttrs (
150 builtins.map (
151 name: let
152 d = darwinConfigurations.${name}.system;
153 in {
154 name = "darwinConfiguration-" + d.name;
155 value = d;
156 }
157 ) (builtins.attrNames darwinConfigurations)
158 );
159 };
170160}
modules/home/default.nix+8-8
......@@ -8,14 +8,14 @@
88 host,
99 mainHomeImports,
1010 ...
11}:
12let
11}: let
1312 cfg = config.programs;
14in
15{
16 imports = mainHomeImports ++ [
17 ./macos/sketchybar.nix
18 ];
13in {
14 imports =
15 mainHomeImports
16 ++ [
17 ./macos/sketchybar.nix
18 ];
1919 programs = {
2020 home-manager.enable = true;
2121 nix-index.enable = true;
......@@ -80,7 +80,7 @@ in
8080 }
8181 ];
8282 shellAliases =
83 { }
83 {}
8484 // lib.optionalAttrs (!host.darwin) {
8585 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
8686 };
modules/home/macos/sketchybar.nix+503-499
......@@ -2,534 +2,538 @@
22 pkgs,
33 lib,
44 config,
5 host,
56 ...
67}: {
78 home.file =
8 lib.attrsets.mapAttrs (file: value: (
9 lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;}
10 )) {
11 sketchybarrc = {
12 executable = true;
13 target = ".config/sketchybar/sketchybarrc";
14 text = ''
15 #!/usr/bin/env sh
16
17 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
18
19 ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured
20 PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored
21
22 FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants
23 PADDINGS=3 # All paddings use this value (icon, label, background)
24
25
26 # Setting up the general bar appearance and default values
27 ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \
28 blur_radius=30 \
29 position=top \
30 sticky=on \
31 padding_left=10 \
32 padding_right=10
33
34
35 ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \
36 icon.color=$ITEM_COLOR \
37 label.font="SF Pro:Semibold:12.0" \
38 label.color=$ITEM_COLOR \
39 background.color=$ACCENT_COLOR \
40 background.corner_radius=10 \
41 background.height=20 \
42 padding_left=4 \
43 padding_right=4 \
44 icon.padding_left=6 \
45 icon.padding_right=3 \
46 label.padding_left=3 \
47 label.padding_right=6
48
49
50 # Left
51 # source "$ITEM_DIR/apple.sh"
52 source "$ITEM_DIR/spaces.sh"
53 source "$ITEM_DIR/front_app.sh"
54
55 # Center
56 # source "$ITEM_DIR/spotify.sh"
57 source "$ITEM_DIR/calendar.sh"
58
59 # Right
60 source $ITEM_DIR/calendar.sh
61 source $ITEM_DIR/wifi.sh
62 source $ITEM_DIR/battery.sh
63 source $ITEM_DIR/volume.sh
64
65 # Forcing all item scripts to run (never do this outside of sketchybarrc)
66 ${pkgs.sketchybar}/bin/sketchybar --update
67
68 echo "sketchybar configuation loaded.."
69 '';
70 };
71 icons = {
72 executable = true;
73 target = ".config/sketchybar/plugins/icons.sh";
74 text = ''
75 #!/usr/bin/env sh
76
77 # Source the icon map with all the application icons
78 source ${pkgs.sketchybar-app-font}/bin/icon_map.sh
79
80 # Create a cache directory if it doesn't exist
81 CACHE_DIR="$HOME/.cache/sketchybar"
82 mkdir -p "$CACHE_DIR"
83
84 # Cache file for icon mappings
85 ICON_CACHE="$CACHE_DIR/icon_cache.txt"
86
87 # Create the cache file if it doesn't exist
88 if [ ! -f "$ICON_CACHE" ]; then
89 touch "$ICON_CACHE"
90 fi
91
92 # Check if the app is already in cache
93 APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi)
94
95 CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2)
96
97 if [ -n "$CACHED_ICON" ]; then
98 # Cache hit, return the icon
99 echo "$CACHED_ICON"
100 exit 0
101 fi
102
103 # Get icon from the mapping function
104 __icon_map "$APP_NAME"
105
106 if [ -n "$icon_result" ]; then
107 echo "$APP_NAME|$icon_result" >>"$ICON_CACHE"
108 fi
109
110 echo "$icon_result"
111 '';
112 };
113 colors = {
114 executable = true;
115 target = ".config/sketchybar/colors.sh";
116 text = ''
117
118 export TRANSPARENT=0x00ffffff
119
120 # -- Gray Scheme --
121 export ITEM_COLOR=0xff000000
122 export ACCENT_COLOR=0xffc3c6cb
123
124 # -- White Scheme --
125 # export ITEM_COLOR=0xff000000
126 # export ACCENT_COLOR=0xffffffff
127
128 # -- Teal Scheme --
129 # export ITEM_COLOR=0xff000000
130 # export ACCENT_COLOR=0xff2cf9ed
131
132 # -- Purple Scheme --
133 # export ITEM_COLOR=0xff000000
134 # export ACCENT_COLOR=0xffeb46f9
135
136 # -- Red Scheme ---
137 # export ITEM_COLOR=0xff000000
138 # export ACCENT_COLOR=0xffff2453
139
140 # -- Blue Scheme ---
141 # export ITEM_COLOR=0xff000000
142 # export ACCENT_COLOR=0xff15bdf9
143
144 # -- Green Scheme --
145 # export ITEM_COLOR=0xff000000
146 # export ACCENT_COLOR=0xff1dfca1
147
148 # -- Orange Scheme --
149 # export ITEM_COLOR=0xffffffff
150 # export ACCENT_COLOR=0xfff97716
151
152 # -- Yellow Scheme --
153 # export ITEM_COLOR=0xff000000
154 # export ACCENT_COLOR=0xfff7fc17
155 '';
156 };
157 items_wifi = {
158 executable = true;
159 target = ".config/sketchybar/items/wifi.sh";
160 text = ''
161 #!/usr/bin/env/ sh
162
163 sketchybar --add item wifi right \
164 --set wifi \
165 icon="􀙥" \
166 label="Updating..." \
167 script="$PLUGIN_DIR/wifi.sh" \
168 --subscribe wifi wifi_change
169 '';
170 };
171 items_battery = {
172 executable = true;
173 target = ".config/sketchybar/items/battery.sh";
174 text = ''
175 #!/usr/bin/env/ sh
176 sketchybar --add item battery right \
177 --set battery update_freq=180 \
178 script="$PLUGIN_DIR/battery.sh" \
179 --subscribe battery system_woke power_source_change
180 '';
181 };
182 items_calendar = {
183 executable = true;
184 target = ".config/sketchybar/items/calendar.sh";
185 text = ''
186 #!/usr/bin/env sh
187 sketchybar --add item calendar right \
188 --set calendar icon=􀧞 \
189 update_freq=15 \
190 script="$PLUGIN_DIR/calendar.sh"
191 '';
192 };
193 items_front_app = {
194 executable = true;
195 target = ".config/sketchybar/items/front_app.sh";
196 text = ''
197 #!/usr/bin/env sh
198
199 sketchybar --add item front_app left \
200 --set front_app background.color=$ACCENT_COLOR \
201 icon.color=$ITEM_COLOR \
202 label.color=$ITEM_COLOR \
203 icon.font="sketchybar-app-font:Regular:12.0" \
204 label.font="SF Pro:Semibold:12.0" \
205 script="$PLUGIN_DIR/front_app.sh" \
206 --subscribe front_app front_app_switched
207 '';
208 };
209 items_spaces = {
210 executable = true;
211 target = ".config/sketchybar/items/spaces.sh";
212 text = ''
213 sketchybar --add event aerospace_workspace_change
214
215 sketchybar --add item aerospace_dummy left \
216 --set aerospace_dummy display=0 \
217 script="$PLUGIN_DIR/spaces.sh" \
218 --subscribe aerospace_dummy aerospace_workspace_change
219
220 for m in $(aerospace list-monitors | awk '{print $1}'); do
221 for sid in $(aerospace list-workspaces --monitor $m); do
222 sketchybar --add space space.$sid left \
223 --set space.$sid space=$sid \
224 icon=$sid \
225 background.color=$TRANSPARENT \
226 label.color=$ACCENT_COLOR \
227 icon.color=$ACCENT_COLOR \
228 display=$m \
229 label.font="sketchybar-app-font:Regular:12.0" \
230 icon.font="SF Pro:Semibold:12.0" \
231 label.padding_right=10 \
232 label.y_offset=-1 \
233 click_script="$PLUGIN_DIR/space_click.sh $sid"
234
235 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" |
236 awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}')
9 {}
10 // lib.optionalAttrs host.darwin (
11 lib.attrsets.mapAttrs (file: value: (
12 lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;}
13 )) {
14 sketchybarrc = {
15 executable = true;
16 target = ".config/sketchybar/sketchybarrc";
17 text = ''
18 #!/usr/bin/env sh
19
20 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
21
22 ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured
23 PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored
24
25 FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants
26 PADDINGS=3 # All paddings use this value (icon, label, background)
27
28
29 # Setting up the general bar appearance and default values
30 ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \
31 blur_radius=30 \
32 position=top \
33 sticky=on \
34 padding_left=10 \
35 padding_right=10
36
37
38 ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \
39 icon.color=$ITEM_COLOR \
40 label.font="SF Pro:Semibold:12.0" \
41 label.color=$ITEM_COLOR \
42 background.color=$ACCENT_COLOR \
43 background.corner_radius=10 \
44 background.height=20 \
45 padding_left=4 \
46 padding_right=4 \
47 icon.padding_left=6 \
48 icon.padding_right=3 \
49 label.padding_left=3 \
50 label.padding_right=6
51
52
53 # Left
54 # source "$ITEM_DIR/apple.sh"
55 source "$ITEM_DIR/spaces.sh"
56 source "$ITEM_DIR/front_app.sh"
57
58 # Center
59 # source "$ITEM_DIR/spotify.sh"
60 source "$ITEM_DIR/calendar.sh"
61
62 # Right
63 source $ITEM_DIR/calendar.sh
64 source $ITEM_DIR/wifi.sh
65 source $ITEM_DIR/battery.sh
66 source $ITEM_DIR/volume.sh
67
68 # Forcing all item scripts to run (never do this outside of sketchybarrc)
69 ${pkgs.sketchybar}/bin/sketchybar --update
70
71 echo "sketchybar configuation loaded.."
72 '';
73 };
74 icons = {
75 executable = true;
76 target = ".config/sketchybar/plugins/icons.sh";
77 text = ''
78 #!/usr/bin/env sh
79
80 # Source the icon map with all the application icons
81 source ${pkgs.sketchybar-app-font}/bin/icon_map.sh
82
83 # Create a cache directory if it doesn't exist
84 CACHE_DIR="$HOME/.cache/sketchybar"
85 mkdir -p "$CACHE_DIR"
86
87 # Cache file for icon mappings
88 ICON_CACHE="$CACHE_DIR/icon_cache.txt"
89
90 # Create the cache file if it doesn't exist
91 if [ ! -f "$ICON_CACHE" ]; then
92 touch "$ICON_CACHE"
93 fi
23794
238 icon_strip=""
239 if [ "''${apps}" != "" ]; then
240 while read -r app; do
241 icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")"
242 done <<<"''${apps}"
243 else
244 icon_strip=" —"
245 fi
95 # Check if the app is already in cache
96 APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi)
24697
247 sketchybar --set space.$sid label="$icon_strip"
98 CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2)
24899
249 done
100 if [ -n "$CACHED_ICON" ]; then
101 # Cache hit, return the icon
102 echo "$CACHED_ICON"
103 exit 0
104 fi
250105
251 for empty_space in $(aerospace list-workspaces --monitor $m --empty); do
252 sketchybar --set space.$empty_space display=0
253 done
254 for focus in $(aerospace list-workspaces --focused); do
255 sketchybar --set space.$focus background.drawing=on \
256 background.color=$ACCENT_COLOR \
257 label.color=$ITEM_COLOR \
258 icon.color=$ITEM_COLOR
259 done
260 done
261 '';
262 };
263
264 items_volume = {
265 executable = true;
266 target = ".config/sketchybar/items/volume.sh";
267 text = ''
268 #/usr/bin/env sh
269
270 sketchybar --add item volume right \
271 --set volume script="$PLUGIN_DIR/volume.sh" \
272 --subscribe volume volume_change
273 '';
274 };
275 plugins_wifi = {
276 executable = true;
277 target = ".config/sketchybar/plugins/wifi.sh";
278 text = ''
279 #/usr/bin/env sh
280
281 SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')
282
283 if [ "$SSID" = "" ]; then
284 sketchybar --set $NAME icon="􀙈" label="Disconnected"
285 else
286 sketchybar --set $NAME icon="􀙇" label="$SSID"
287 fi
288
289 '';
290 };
291 plugins_calendar = {
292 executable = true;
293 target = ".config/sketchybar/plugins/calendar.sh";
294
295 text = ''
296 #/usr/bin/env sh
297
298 sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')"
299 '';
300 };
301 plugins_spaces = {
302 executable = true;
303 target = ".config/sketchybar/plugins/spaces.sh";
304 text = ''
305 #!/usr/bin/env sh
306
307 source "$CONFIG_DIR/colors.sh"
308
309 update_workspace_appearance() {
310 local sid=$1
311 local is_focused=$2
312
313 if [ "$is_focused" = "true" ]; then
314 sketchybar --set space.$sid background.drawing=on \
315 background.color=$ACCENT_COLOR \
316 label.color=$ITEM_COLOR \
317 icon.color=$ITEM_COLOR
318 else
319 sketchybar --set space.$sid background.drawing=off \
320 label.color=$ACCENT_COLOR \
321 icon.color=$ACCENT_COLOR
106 # Get icon from the mapping function
107 __icon_map "$APP_NAME"
108
109 if [ -n "$icon_result" ]; then
110 echo "$APP_NAME|$icon_result" >>"$ICON_CACHE"
322111 fi
323 }
324112
325 update_icons() {
326 m=$1
327 sid=$2
113 echo "$icon_result"
114 '';
115 };
116 colors = {
117 executable = true;
118 target = ".config/sketchybar/colors.sh";
119 text = ''
120
121 export TRANSPARENT=0x00ffffff
122
123 # -- Gray Scheme --
124 export ITEM_COLOR=0xff000000
125 export ACCENT_COLOR=0xffc3c6cb
126
127 # -- White Scheme --
128 # export ITEM_COLOR=0xff000000
129 # export ACCENT_COLOR=0xffffffff
130
131 # -- Teal Scheme --
132 # export ITEM_COLOR=0xff000000
133 # export ACCENT_COLOR=0xff2cf9ed
134
135 # -- Purple Scheme --
136 # export ITEM_COLOR=0xff000000
137 # export ACCENT_COLOR=0xffeb46f9
138
139 # -- Red Scheme ---
140 # export ITEM_COLOR=0xff000000
141 # export ACCENT_COLOR=0xffff2453
142
143 # -- Blue Scheme ---
144 # export ITEM_COLOR=0xff000000
145 # export ACCENT_COLOR=0xff15bdf9
146
147 # -- Green Scheme --
148 # export ITEM_COLOR=0xff000000
149 # export ACCENT_COLOR=0xff1dfca1
150
151 # -- Orange Scheme --
152 # export ITEM_COLOR=0xffffffff
153 # export ACCENT_COLOR=0xfff97716
154
155 # -- Yellow Scheme --
156 # export ITEM_COLOR=0xff000000
157 # export ACCENT_COLOR=0xfff7fc17
158 '';
159 };
160 items_wifi = {
161 executable = true;
162 target = ".config/sketchybar/items/wifi.sh";
163 text = ''
164 #!/usr/bin/env/ sh
165
166 sketchybar --add item wifi right \
167 --set wifi \
168 icon="􀙥" \
169 label="Updating..." \
170 script="$PLUGIN_DIR/wifi.sh" \
171 --subscribe wifi wifi_change
172 '';
173 };
174 items_battery = {
175 executable = true;
176 target = ".config/sketchybar/items/battery.sh";
177 text = ''
178 #!/usr/bin/env/ sh
179 sketchybar --add item battery right \
180 --set battery update_freq=180 \
181 script="$PLUGIN_DIR/battery.sh" \
182 --subscribe battery system_woke power_source_change
183 '';
184 };
185 items_calendar = {
186 executable = true;
187 target = ".config/sketchybar/items/calendar.sh";
188 text = ''
189 #!/usr/bin/env sh
190 sketchybar --add item calendar right \
191 --set calendar icon=􀧞 \
192 update_freq=15 \
193 script="$PLUGIN_DIR/calendar.sh"
194 '';
195 };
196 items_front_app = {
197 executable = true;
198 target = ".config/sketchybar/items/front_app.sh";
199 text = ''
200 #!/usr/bin/env sh
201
202 sketchybar --add item front_app left \
203 --set front_app background.color=$ACCENT_COLOR \
204 icon.color=$ITEM_COLOR \
205 label.color=$ITEM_COLOR \
206 icon.font="sketchybar-app-font:Regular:12.0" \
207 label.font="SF Pro:Semibold:12.0" \
208 script="$PLUGIN_DIR/front_app.sh" \
209 --subscribe front_app front_app_switched
210 '';
211 };
212 items_spaces = {
213 executable = true;
214 target = ".config/sketchybar/items/spaces.sh";
215 text = ''
216 sketchybar --add event aerospace_workspace_change
217
218 sketchybar --add item aerospace_dummy left \
219 --set aerospace_dummy display=0 \
220 script="$PLUGIN_DIR/spaces.sh" \
221 --subscribe aerospace_dummy aerospace_workspace_change
328222
329 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \
330 | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \
331 | sort)
223 for m in $(aerospace list-monitors | awk '{print $1}'); do
224 for sid in $(aerospace list-workspaces --monitor $m); do
225 sketchybar --add space space.$sid left \
226 --set space.$sid space=$sid \
227 icon=$sid \
228 background.color=$TRANSPARENT \
229 label.color=$ACCENT_COLOR \
230 icon.color=$ACCENT_COLOR \
231 display=$m \
232 label.font="sketchybar-app-font:Regular:12.0" \
233 icon.font="SF Pro:Semibold:12.0" \
234 label.padding_right=10 \
235 label.y_offset=-1 \
236 click_script="$PLUGIN_DIR/space_click.sh $sid"
237
238 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" |
239 awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}')
332240
333 icon_strip=""
334 if [ "''${apps}" != "" ]; then
335 while read -r app; do
336 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
337 done <<<"''${apps}"
338 else
339 icon_strip=" —"
340 fi
241 icon_strip=""
242 if [ "''${apps}" != "" ]; then
243 while read -r app; do
244 icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")"
245 done <<<"''${apps}"
246 else
247 icon_strip=" —"
248 fi
341249
342 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
343 }
250 sketchybar --set space.$sid label="$icon_strip"
344251
345 update_workspace_appearance "$PREV_WORKSPACE" "false"
346 update_workspace_appearance "$FOCUSED_WORKSPACE" "true"
252 done
347253
348 for m in $(aerospace list-monitors | awk '{print $1}'); do
349 for sid in $(aerospace list-workspaces --monitor $m --visible); do
350 sketchybar --set space.$sid display=$m
254 for empty_space in $(aerospace list-workspaces --monitor $m --empty); do
255 sketchybar --set space.$empty_space display=0
256 done
257 for focus in $(aerospace list-workspaces --focused); do
258 sketchybar --set space.$focus background.drawing=on \
259 background.color=$ACCENT_COLOR \
260 label.color=$ITEM_COLOR \
261 icon.color=$ITEM_COLOR
262 done
263 done
264 '';
265 };
266
267 items_volume = {
268 executable = true;
269 target = ".config/sketchybar/items/volume.sh";
270 text = ''
271 #/usr/bin/env sh
272
273 sketchybar --add item volume right \
274 --set volume script="$PLUGIN_DIR/volume.sh" \
275 --subscribe volume volume_change
276 '';
277 };
278 plugins_wifi = {
279 executable = true;
280 target = ".config/sketchybar/plugins/wifi.sh";
281 text = ''
282 #/usr/bin/env sh
283
284 SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')
285
286 if [ "$SSID" = "" ]; then
287 sketchybar --set $NAME icon="􀙈" label="Disconnected"
288 else
289 sketchybar --set $NAME icon="􀙇" label="$SSID"
290 fi
291
292 '';
293 };
294 plugins_calendar = {
295 executable = true;
296 target = ".config/sketchybar/plugins/calendar.sh";
297
298 text = ''
299 #/usr/bin/env sh
300
301 sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')"
302 '';
303 };
304 plugins_spaces = {
305 executable = true;
306 target = ".config/sketchybar/plugins/spaces.sh";
307 text = ''
308 #!/usr/bin/env sh
309
310 source "$CONFIG_DIR/colors.sh"
311
312 update_workspace_appearance() {
313 local sid=$1
314 local is_focused=$2
315
316 if [ "$is_focused" = "true" ]; then
317 sketchybar --set space.$sid background.drawing=on \
318 background.color=$ACCENT_COLOR \
319 label.color=$ITEM_COLOR \
320 icon.color=$ITEM_COLOR
321 else
322 sketchybar --set space.$sid background.drawing=off \
323 label.color=$ACCENT_COLOR \
324 icon.color=$ACCENT_COLOR
325 fi
326 }
351327
352 update_icons "$m" "$sid"
328 update_icons() {
329 m=$1
330 sid=$2
353331
354 update_icons "$m" "$PREV_WORKSPACE"
332 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \
333 | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \
334 | sort)
355335
356 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l)
357 if [ "''${apps}" -eq 0 ]; then
358 sketchybar --set space.$sid display=0
336 icon_strip=""
337 if [ "''${apps}" != "" ]; then
338 while read -r app; do
339 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
340 done <<<"''${apps}"
341 else
342 icon_strip=" —"
359343 fi
360 done
361 done
362 '';
363 };
364
365 plugins_space_click = {
366 executable = true;
367 target = ".config/sketchybar/plugins/space_click.sh";
368 text = ''
369 #/usr/bin/env/ sh
370
371 apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}')
372 focused=$(aerospace list-workspaces --focused)
373
374 if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then
375 sketchybar --set space.$1 display=0
376 else
377 aerospace workspace $1
378 fi
379 '';
380 };
381 plugins_volume = {
382 executable = true;
383 target = ".config/sketchybar/plugins/volume.sh";
384 text = ''
385 #!/usr/bin/env sh
386
387 # The volume_change event supplies a $INFO variable in which the current volume
388 # percentage is passed to the script.
389
390 if [ "$SENDER" = "volume_change" ]; then
391
392 VOLUME=$INFO
393
394 case $VOLUME in
395 [6-9][0-9] | 100)
396 ICON="􀊩"
397 ;;
398 [3-5][0-9])
399 ICON="􀊥"
400 ;;
401 [1-9] | [1-2][0-9])
402 ICON="􀊡"
403 ;;
404 *) ICON="􀊣" ;;
405 esac
406344
407 sketchybar --set $NAME icon="$ICON" label="$VOLUME%"
408 fi
409 '';
410 };
411 plugins_front_app = {
412 executable = true;
413 target = ".config/sketchybar/plugins/front_app.sh";
414 text = ''
415 # Some events send additional information specific to the event in the $INFO
416 # variable. E.g. the front_app_switched event sends the name of the newly
417 # focused application in the $INFO variable:
418 # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
419
420 app_switched() {
345 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
346 }
347
348 update_workspace_appearance "$PREV_WORKSPACE" "false"
349 update_workspace_appearance "$FOCUSED_WORKSPACE" "true"
350
421351 for m in $(aerospace list-monitors | awk '{print $1}'); do
422352 for sid in $(aerospace list-workspaces --monitor $m --visible); do
353 sketchybar --set space.$sid display=$m
423354
424 apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \
425 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \
426 | awk '!seen[$0]++' | sort)
355 update_icons "$m" "$sid"
427356
428 icon_strip=""
429 if [ "''${apps}" != "" ]; then
430 while read -r app; do
431 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
432 done <<<"''${apps}"
433 else
434 icon_strip=" —"
435 fi
357 update_icons "$m" "$PREV_WORKSPACE"
436358
437 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
359 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l)
360 if [ "''${apps}" -eq 0 ]; then
361 sketchybar --set space.$sid display=0
362 fi
438363 done
439364 done
440 }
441
442 if [ "$SENDER" = "front_app_switched" ]; then
443
444 sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")"
445
446 app_switched
447 fi
448 '';
449 };
450 plugins_battery = {
451 executable = true;
452 target = ".config/sketchybar/plugins/battery.sh";
453 text = ''
454 #!/usr/bin/env sh
455 source "$CONFIG_DIR/colors.sh"
456
457 PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
458 CHARGING=$(pmset -g batt | grep 'AC Power')
459
460 if [ $PERCENTAGE = "" ]; then
461 exit 0
462 fi
463
464 case ''${PERCENTAGE} in
465 9[0-9] | 100)
466 ICON="􀛨"
467 COLOR=$ITEM_COLOR
468 ;;
469 [6-8][0-9])
470 ICON="􀺸"
471 COLOR=$ITEM_COLOR
472 ;;
473 [3-5][0-9])
474 ICON="􀺶"
475 COLOR="0xFFd97706"
476 ;;
477 [1-2][0-9])
478 ICON="􀛩"
479 COLOR="0xFFf97316"
480 ;;
481 *)
482 ICON="􀛪"
483 COLOR="0xFFef4444"
484 ;;
485 esac
486
487 if [[ $CHARGING != "" ]]; then
488 ICON="􀢋"
489 COLOR=$ITEM_COLOR
490 fi
491
492 # The item invoking this script (name $NAME) will get its icon and label
493 # updated with the current battery status
494 sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR"
495 '';
496 };
497 plugins_aerospace = {
498 executable = true;
499 target = ".config/sketchybar/plugins/aerospace.sh";
500 text = ''
501 #!/usr/bin/env bash
502 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
503
504 highlight_focused_workspace() {
505 if [[ "$1" = "$FOCUSED_WORKSPACE" ]]
506 then
507 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0
365 '';
366 };
367
368 plugins_space_click = {
369 executable = true;
370 target = ".config/sketchybar/plugins/space_click.sh";
371 text = ''
372 #/usr/bin/env/ sh
373
374 apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}')
375 focused=$(aerospace list-workspaces --focused)
376
377 if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then
378 sketchybar --set space.$1 display=0
508379 else
509 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic
380 aerospace workspace $1
510381 fi
511 }
512
513 illuminate_mode() {
514 if [[ "$mode" = "service" ]]
515 then
516 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE
517 elif [[ "$mode" = "resize" ]]
518 then
519 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN
520 else
521 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1
382 '';
383 };
384 plugins_volume = {
385 executable = true;
386 target = ".config/sketchybar/plugins/volume.sh";
387 text = ''
388 #!/usr/bin/env sh
389
390 # The volume_change event supplies a $INFO variable in which the current volume
391 # percentage is passed to the script.
392
393 if [ "$SENDER" = "volume_change" ]; then
394
395 VOLUME=$INFO
396
397 case $VOLUME in
398 [6-9][0-9] | 100)
399 ICON="􀊩"
400 ;;
401 [3-5][0-9])
402 ICON="􀊥"
403 ;;
404 [1-9] | [1-2][0-9])
405 ICON="􀊡"
406 ;;
407 *) ICON="􀊣" ;;
408 esac
409
410 sketchybar --set $NAME icon="$ICON" label="$VOLUME%"
522411 fi
523 }
524 case "$SENDER" in
525 "aerospace_workspace_change")
526 highlight_focused_workspace $1
412 '';
413 };
414 plugins_front_app = {
415 executable = true;
416 target = ".config/sketchybar/plugins/front_app.sh";
417 text = ''
418 # Some events send additional information specific to the event in the $INFO
419 # variable. E.g. the front_app_switched event sends the name of the newly
420 # focused application in the $INFO variable:
421 # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
422
423 app_switched() {
424 for m in $(aerospace list-monitors | awk '{print $1}'); do
425 for sid in $(aerospace list-workspaces --monitor $m --visible); do
426
427 apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \
428 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \
429 | awk '!seen[$0]++' | sort)
430
431 icon_strip=""
432 if [ "''${apps}" != "" ]; then
433 while read -r app; do
434 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
435 done <<<"''${apps}"
436 else
437 icon_strip=" —"
438 fi
439
440 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
441 done
442 done
443 }
444
445 if [ "$SENDER" = "front_app_switched" ]; then
446
447 sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")"
448
449 app_switched
450 fi
451 '';
452 };
453 plugins_battery = {
454 executable = true;
455 target = ".config/sketchybar/plugins/battery.sh";
456 text = ''
457 #!/usr/bin/env sh
458 source "$CONFIG_DIR/colors.sh"
459
460 PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
461 CHARGING=$(pmset -g batt | grep 'AC Power')
462
463 if [ $PERCENTAGE = "" ]; then
464 exit 0
465 fi
466
467 case ''${PERCENTAGE} in
468 9[0-9] | 100)
469 ICON="􀛨"
470 COLOR=$ITEM_COLOR
471 ;;
472 [6-8][0-9])
473 ICON="􀺸"
474 COLOR=$ITEM_COLOR
475 ;;
476 [3-5][0-9])
477 ICON="􀺶"
478 COLOR="0xFFd97706"
479 ;;
480 [1-2][0-9])
481 ICON="􀛩"
482 COLOR="0xFFf97316"
527483 ;;
528 "aerospace_mode_change")
529 illuminate_mode
484 *)
485 ICON="􀛪"
486 COLOR="0xFFef4444"
530487 ;;
531 esac
532 '';
533 };
534 };
488 esac
489
490 if [[ $CHARGING != "" ]]; then
491 ICON="􀢋"
492 COLOR=$ITEM_COLOR
493 fi
494
495 # The item invoking this script (name $NAME) will get its icon and label
496 # updated with the current battery status
497 sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR"
498 '';
499 };
500 plugins_aerospace = {
501 executable = true;
502 target = ".config/sketchybar/plugins/aerospace.sh";
503 text = ''
504 #!/usr/bin/env bash
505 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
506
507 highlight_focused_workspace() {
508 if [[ "$1" = "$FOCUSED_WORKSPACE" ]]
509 then
510 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0
511 else
512 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic
513 fi
514 }
515
516 illuminate_mode() {
517 if [[ "$mode" = "service" ]]
518 then
519 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE
520 elif [[ "$mode" = "resize" ]]
521 then
522 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN
523 else
524 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1
525 fi
526 }
527 case "$SENDER" in
528 "aerospace_workspace_change")
529 highlight_focused_workspace $1
530 ;;
531 "aerospace_mode_change")
532 illuminate_mode
533 ;;
534 esac
535 '';
536 };
537 }
538 );
535539}
modules/nixos/services.nix+4-4
......@@ -1,5 +1,4 @@
1{ pkgs, ... }:
2{
1{pkgs, ...}: {
32 services = {
43 avahi = {
54 enable = true;
......@@ -24,6 +23,7 @@
2423
2524 desktopManager.cosmic.enable = true;
2625 displayManager.cosmic-greeter.enable = true;
26 desktopManager.cosmic.xwayland.enable = true;
2727
2828 # Auto mount devices
2929 udisks2 = {
......@@ -40,7 +40,7 @@
4040 # Enable CUPS to print documents.
4141 printing = {
4242 enable = true;
43 drivers = [ pkgs.brlaser ]; # Brother printer driver
43 drivers = [pkgs.brlaser]; # Brother printer driver
4444 };
4545
4646 pipewire = {
......@@ -55,7 +55,7 @@
5555
5656 openssh = {
5757 enable = true;
58 ports = [ 22 ];
58 ports = [22];
5959 settings = {
6060 PasswordAuthentication = true;
6161 UseDns = true;
modules/shared/nix.nix-2
......@@ -24,13 +24,11 @@
2424 "https://cache.nixos.org/?priority=10"
2525
2626 "https://nix-community.cachix.org"
27 "https://cosmic.cachix.org/"
2827 # For haskell
2928 "https://cache.iog.io"
3029 ];
3130 trusted-public-keys = [
3231 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
33 "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
3432 # For haskell
3533 "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
3634 ];
users/natalie/desktop/configuration.nix+11-11
......@@ -3,8 +3,7 @@
33 user,
44 host,
55 ...
6}:
7{
6}: {
87 imports = [
98 # Include the results of the hardware scan.
109 ./hardware-configuration.nix
......@@ -18,7 +17,7 @@
1817 enable = true;
1918 # Certain features, including CLI integration and system authentication support,
2019 # require enabling PolKit integration on some desktop environments (e.g. Plasma).
21 polkitPolicyOwners = [ user.username ];
20 polkitPolicyOwners = [user.username];
2221 };
2322
2423 noisetorch.enable = true;
......@@ -35,7 +34,7 @@
3534
3635 steam = {
3736 enable = true;
38 package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; };
37 package = with pkgs; steam.override {extraPkgs = pkgs: [attr];};
3938 };
4039
4140 git = {
......@@ -59,7 +58,7 @@
5958
6059 xdg.portal = {
6160 enable = true;
62 extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
61 extraPortals = with pkgs; [xdg-desktop-portal-gtk];
6362 };
6463 virtualisation = {
6564 containers.enable = true;
......@@ -84,16 +83,14 @@
8483 hybrid-sleep.enable = false;
8584 };
8685
87 packages = [ pkgs.observatory ];
88
89 services.monitord.wantedBy = [ "multi-user.target" ];
86 services.monitord.wantedBy = ["multi-user.target"];
9087 };
9188
9289 i18n = {
9390 # Select internationalisation properties.
9491 defaultLocale = "en_US.UTF-8";
9592
96 supportedLocales = [ "all" ];
93 supportedLocales = ["all"];
9794
9895 extraLocaleSettings = {
9996 LC_ADDRESS = "en_US.UTF-8";
......@@ -148,7 +145,10 @@
148145 ];
149146 };
150147 environment = {
151 sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1;
148 sessionVariables = {
149 COSMIC_DATA_CONTROL_ENABLED = 1;
150 NIXOS_OZONE_WL = "1";
151 };
152152 variables.EDITOR = "nvim";
153153
154154 systemPackages = with pkgs; [
......@@ -170,7 +170,7 @@
170170 };
171171 interfaces.enp11s0.wakeOnLan = {
172172 enable = true;
173 policy = [ "magic" ];
173 policy = ["magic"];
174174 };
175175 };
176176