authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-28 12:06:37-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-28 12:06:37-07:00
log40840a80842b53b3f119c95d5e67e40d070259d0
tree1e8e11710313e820a028a5b6b0fe5e000acd7353
parent800f63b000bebf518dad1b6e6e85e99640e95ec6
signature Commit is signed but in an unrecognized format.

run format


15 files changed, 697 insertions(+), 650 deletions(-)

flake.lock+21
...@@ -595,6 +595,7 @@...@@ -595,6 +595,7 @@
595 "nixpkgs": "nixpkgs_2",595 "nixpkgs": "nixpkgs_2",
596 "nvf": "nvf",596 "nvf": "nvf",
597 "rust-overlay": "rust-overlay_2",597 "rust-overlay": "rust-overlay_2",
598 "zen-browser": "zen-browser",
598 "zig": "zig",599 "zig": "zig",
599 "zls": "zls"600 "zls": "zls"
600 }601 }
...@@ -845,6 +846,26 @@...@@ -845,6 +846,26 @@
845 "type": "github"846 "type": "github"
846 }847 }
847 },848 },
849 "zen-browser": {
850 "inputs": {
851 "nixpkgs": [
852 "nixpkgs"
853 ]
854 },
855 "locked": {
856 "lastModified": 1748059546,
857 "narHash": "sha256-e0jy8RU8ofOdeS5gF9Hir+M5Wn0q7D8MkpeQXsOJdu4=",
858 "owner": "youwen5",
859 "repo": "zen-browser-flake",
860 "rev": "716a5af28d686d67146d01b14112c919b6133a84",
861 "type": "github"
862 },
863 "original": {
864 "owner": "youwen5",
865 "repo": "zen-browser-flake",
866 "type": "github"
867 }
868 },
848 "zig": {869 "zig": {
849 "inputs": {870 "inputs": {
850 "flake-compat": "flake-compat",871 "flake-compat": "flake-compat",
flake.nix+117-108
...@@ -29,6 +29,10 @@...@@ -29,6 +29,10 @@
29 moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly.29 moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly.
30 moonlight.inputs.nixpkgs.follows = "nixpkgs";30 moonlight.inputs.nixpkgs.follows = "nixpkgs";
3131
32 zen-browser = {
33 url = "github:youwen5/zen-browser-flake";
34 inputs.nixpkgs.follows = "nixpkgs";
35 };
32 nh.url = "github:viperML/nh";36 nh.url = "github:viperML/nh";
33 nh.inputs.nixpkgs.follows = "nixpkgs";37 nh.inputs.nixpkgs.follows = "nixpkgs";
3438
...@@ -37,76 +41,79 @@...@@ -37,76 +41,79 @@
37 nix-index-database.url = "github:nix-community/nix-index-database";41 nix-index-database.url = "github:nix-community/nix-index-database";
38 nix-index-database.inputs.nixpkgs.follows = "nixpkgs";42 nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
39 };43 };
40 outputs = {44 outputs =
41 self,45 {
42 nixpkgs,46 self,
43 lix-module,47 nixpkgs,
44 darwin,48 lix-module,
45 ...49 darwin,
46 } @ inputs: let50 ...
47 lib = nixpkgs.lib;51 }@inputs:
48 # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.52 let
49 overlays = [53 lib = nixpkgs.lib;
50 inputs.zig.overlays.default54 # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
51 inputs.rust-overlay.overlays.default55 overlays = [
52 inputs.nh.overlays.default56 inputs.zig.overlays.default
5357 inputs.rust-overlay.overlays.default
54 # https://github.com/LnL7/nix-darwin/issues/104158 inputs.nh.overlays.default
55 (_: prev: {59
56 karabiner-elements = prev.karabiner-elements.overrideAttrs (old: {60 # https://github.com/LnL7/nix-darwin/issues/1041
57 version = "14.13.0";61 (_: prev: {
5862 karabiner-elements = prev.karabiner-elements.overrideAttrs (old: {
59 src = prev.fetchurl {63 version = "14.13.0";
60 inherit (old.src) url;64
61 hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw=";65 src = prev.fetchurl {
62 };66 inherit (old.src) url;
63 });67 hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw=";
64 })68 };
65 ];69 });
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 );
83 })70 })
84 systems71 ];
85 );
8672
87 mkSystem = import ./lib/mkSystem.nix {73 # Users of this flake currently use x86_64 Linux and Apple Silicon
88 inherit74 systems = [
89 overlays75 "x86_64-linux"
90 nixpkgs76 "aarch64-darwin"
91 lix-module77 ];
92 inputs78 forAllSystems =
93 mkNeovim79 f:
94 ;80 builtins.listToAttrs (
95 };81 builtins.map (system: {
96 mkNeovim = import ./lib/mkNeovim.nix {82 name = system;
97 inherit83 value = f (
98 self84 inputs
99 overlays85 // {
100 nixpkgs86 inherit system;
101 inputs87 pkgs = nixpkgs.legacyPackages.${system};
102 ;88 }
103 };89 );
104 in rec {90 }) systems
105 inherit self;91 );
106 # "nix fmt"92
107 formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);93 mkSystem = import ./lib/mkSystem.nix {
108 packages = forAllSystems (94 inherit
109 {system, ...}: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, ... }:
110 {117 {
111 nvim-chloe = mkNeovim "chloe" system;118 nvim-chloe = mkNeovim "chloe" system;
112 nvim-natalie = mkNeovim "natalie" system;119 nvim-natalie = mkNeovim "natalie" system;
...@@ -115,46 +122,48 @@...@@ -115,46 +122,48 @@
115 # "nix run .#darwin-rebuild"122 # "nix run .#darwin-rebuild"
116 darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;123 darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
117 }124 }
118 );125 );
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 };
134126
135 # chloe's mac studio "sandwich"127 # natalie's desktop computer
136 darwinConfigurations.sandwich = mkSystem "sandwich" {128 nixosConfigurations.nixos = mkSystem "nixos" {
137 user = "chloe";129 user = "natalie";
138 host = "sandwich";130 host = "desktop";
139 system = "aarch64-darwin";131 system = "x86_64-linux";
140 };132 extraModules = [
141 # chloe's macbook air "paperback"133 ];
142 darwinConfigurations.paperback = mkSystem "paperback" {134 };
143 user = "chloe";135 # natalie's laptop
144 host = "paperback";136 darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
145 system = "aarch64-darwin";137 user = "natalie";
138 host = "laptop";
139 system = "aarch64-darwin";
140 };
141
142 # chloe's mac studio "sandwich"
143 darwinConfigurations.sandwich = mkSystem "sandwich" {
144 user = "chloe";
145 host = "sandwich";
146 system = "aarch64-darwin";
147 };
148 # chloe's macbook air "paperback"
149 darwinConfigurations.paperback = mkSystem "paperback" {
150 user = "chloe";
151 host = "paperback";
152 system = "aarch64-darwin";
153 };
154
155 # generate checks for "nix flake check --all-systems --no-build"
156 checks.aarch64-darwin = builtins.listToAttrs (
157 builtins.map (
158 name:
159 let
160 d = darwinConfigurations.${name}.system;
161 in
162 {
163 name = "darwinConfiguration-" + d.name;
164 value = d;
165 }
166 ) (builtins.attrNames darwinConfigurations)
167 );
146 };168 };
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 };
160}169}
lib/mkNeovim.nix+15-13
...@@ -4,7 +4,9 @@...@@ -4,7 +4,9 @@
4 # TODO: apply overlays here4 # TODO: apply overlays here
5 overlays,5 overlays,
6 inputs,6 inputs,
7}: user: system: let7}:
8user: system:
9let
8 darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system;10 darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system;
911
10 host = {12 host = {
...@@ -15,15 +17,15 @@...@@ -15,15 +17,15 @@
15 userDir = ../users + "/${user}";17 userDir = ../users + "/${user}";
16 userConfig = import (userDir + "/user.nix");18 userConfig = import (userDir + "/user.nix");
17in19in
18 (inputs.nvf.lib.neovimConfiguration {20(inputs.nvf.lib.neovimConfiguration {
19 pkgs = nixpkgs.legacyPackages.${system};21 pkgs = nixpkgs.legacyPackages.${system};
20 modules = builtins.filter (f: f != null) [22 modules = builtins.filter (f: f != null) [
21 (../users + ("/" + user + "/vim.nix"))23 (../users + ("/" + user + "/vim.nix"))
22 ../modules/neovim24 ../modules/neovim
23 ];25 ];
24 extraSpecialArgs = {26 extraSpecialArgs = {
25 inherit host;27 inherit host;
26 flake = self;28 flake = self;
27 user = userConfig;29 user = userConfig;
28 };30 };
29 }).neovim31}).neovim
modules/home/default.nix+8-8
...@@ -8,14 +8,14 @@...@@ -8,14 +8,14 @@
8 host,8 host,
9 mainHomeImports,9 mainHomeImports,
10 ...10 ...
11}: let11}:
12let
12 cfg = config.programs;13 cfg = config.programs;
13in {14in
14 imports =15{
15 mainHomeImports16 imports = mainHomeImports ++ [
16 ++ [17 ./macos/sketchybar.nix
17 ./macos/sketchybar.nix18 ];
18 ];
19 programs = {19 programs = {
20 home-manager.enable = true;20 home-manager.enable = true;
21 nix-index.enable = true;21 nix-index.enable = true;
...@@ -80,7 +80,7 @@ in {...@@ -80,7 +80,7 @@ in {
80 }80 }
81 ];81 ];
82 shellAliases =82 shellAliases =
83 {}83 { }
84 // lib.optionalAttrs (!host.darwin) {84 // lib.optionalAttrs (!host.darwin) {
85 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";85 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
86 };86 };
modules/home/macos/sketchybar.nix+504-501
...@@ -4,536 +4,539 @@...@@ -4,536 +4,539 @@
4 config,4 config,
5 host,5 host,
6 ...6 ...
7}: {7}:
8{
8 home.file =9 home.file =
9 {}10 { }
10 // lib.optionalAttrs host.darwin (11 // lib.optionalAttrs host.darwin (
11 lib.attrsets.mapAttrs (file: value: (12 lib.attrsets.mapAttrs
12 lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;}13 (
13 )) {14 file: value: (lib.attrsets.overrideExisting value { enable = config.shared.darwin.tiling.enable; })
14 sketchybarrc = {15 )
15 executable = true;16 {
16 target = ".config/sketchybar/sketchybarrc";17 sketchybarrc = {
17 text = ''18 executable = true;
18 #!/usr/bin/env sh19 target = ".config/sketchybar/sketchybarrc";
1920 text = ''
20 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors21 #!/usr/bin/env sh
2122
22 ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured23 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
23 PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored24
2425 ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured
25 FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants26 PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored
26 PADDINGS=3 # All paddings use this value (icon, label, background)27
2728 FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants
2829 PADDINGS=3 # All paddings use this value (icon, label, background)
29 # Setting up the general bar appearance and default values30
30 ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \31
31 blur_radius=30 \32 # Setting up the general bar appearance and default values
32 position=top \33 ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \
33 sticky=on \34 blur_radius=30 \
34 padding_left=10 \35 position=top \
35 padding_right=1036 sticky=on \
3637 padding_left=10 \
3738 padding_right=10
38 ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \39
39 icon.color=$ITEM_COLOR \40
40 label.font="SF Pro:Semibold:12.0" \41 ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \
41 label.color=$ITEM_COLOR \42 icon.color=$ITEM_COLOR \
42 background.color=$ACCENT_COLOR \43 label.font="SF Pro:Semibold:12.0" \
43 background.corner_radius=10 \44 label.color=$ITEM_COLOR \
44 background.height=20 \45 background.color=$ACCENT_COLOR \
45 padding_left=4 \46 background.corner_radius=10 \
46 padding_right=4 \47 background.height=20 \
47 icon.padding_left=6 \48 padding_left=4 \
48 icon.padding_right=3 \49 padding_right=4 \
49 label.padding_left=3 \50 icon.padding_left=6 \
50 label.padding_right=651 icon.padding_right=3 \
5152 label.padding_left=3 \
5253 label.padding_right=6
53 # Left54
54 # source "$ITEM_DIR/apple.sh"55
55 source "$ITEM_DIR/spaces.sh"56 # Left
56 source "$ITEM_DIR/front_app.sh"57 # source "$ITEM_DIR/apple.sh"
5758 source "$ITEM_DIR/spaces.sh"
58 # Center59 source "$ITEM_DIR/front_app.sh"
59 # source "$ITEM_DIR/spotify.sh"60
60 source "$ITEM_DIR/calendar.sh"61 # Center
6162 # source "$ITEM_DIR/spotify.sh"
62 # Right63 source "$ITEM_DIR/calendar.sh"
63 source $ITEM_DIR/calendar.sh64
64 source $ITEM_DIR/wifi.sh65 # Right
65 source $ITEM_DIR/battery.sh66 source $ITEM_DIR/calendar.sh
66 source $ITEM_DIR/volume.sh67 source $ITEM_DIR/wifi.sh
6768 source $ITEM_DIR/battery.sh
68 # Forcing all item scripts to run (never do this outside of sketchybarrc)69 source $ITEM_DIR/volume.sh
69 ${pkgs.sketchybar}/bin/sketchybar --update70
7071 # Forcing all item scripts to run (never do this outside of sketchybarrc)
71 echo "sketchybar configuation loaded.."72 ${pkgs.sketchybar}/bin/sketchybar --update
72 '';73
73 };74 echo "sketchybar configuation loaded.."
74 icons = {75 '';
75 executable = true;76 };
76 target = ".config/sketchybar/plugins/icons.sh";77 icons = {
77 text = ''78 executable = true;
78 #!/usr/bin/env sh79 target = ".config/sketchybar/plugins/icons.sh";
7980 text = ''
80 # Source the icon map with all the application icons81 #!/usr/bin/env sh
81 source ${pkgs.sketchybar-app-font}/bin/icon_map.sh82
8283 # Source the icon map with all the application icons
83 # Create a cache directory if it doesn't exist84 source ${pkgs.sketchybar-app-font}/bin/icon_map.sh
84 CACHE_DIR="$HOME/.cache/sketchybar"85
85 mkdir -p "$CACHE_DIR"86 # Create a cache directory if it doesn't exist
8687 CACHE_DIR="$HOME/.cache/sketchybar"
87 # Cache file for icon mappings88 mkdir -p "$CACHE_DIR"
88 ICON_CACHE="$CACHE_DIR/icon_cache.txt"89
8990 # Cache file for icon mappings
90 # Create the cache file if it doesn't exist91 ICON_CACHE="$CACHE_DIR/icon_cache.txt"
91 if [ ! -f "$ICON_CACHE" ]; then92
92 touch "$ICON_CACHE"93 # Create the cache file if it doesn't exist
93 fi94 if [ ! -f "$ICON_CACHE" ]; then
9495 touch "$ICON_CACHE"
95 # Check if the app is already in cache96 fi
96 APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi)
97
98 CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2)
99
100 if [ -n "$CACHED_ICON" ]; then
101 # Cache hit, return the icon
102 echo "$CACHED_ICON"
103 exit 0
104 fi
105
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"
111 fi
112
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
222
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}')
24097
241 icon_strip=""98 # Check if the app is already in cache
242 if [ "''${apps}" != "" ]; then99 APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi)
243 while read -r app; do
244 icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")"
245 done <<<"''${apps}"
246 else
247 icon_strip=" —"
248 fi
249100
250 sketchybar --set space.$sid label="$icon_strip"101 CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2)
251102
252 done103 if [ -n "$CACHED_ICON" ]; then
104 # Cache hit, return the icon
105 echo "$CACHED_ICON"
106 exit 0
107 fi
253108
254 for empty_space in $(aerospace list-workspaces --monitor $m --empty); do109 # Get icon from the mapping function
255 sketchybar --set space.$empty_space display=0110 __icon_map "$APP_NAME"
256 done111
257 for focus in $(aerospace list-workspaces --focused); do112 if [ -n "$icon_result" ]; then
258 sketchybar --set space.$focus background.drawing=on \113 echo "$APP_NAME|$icon_result" >>"$ICON_CACHE"
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 fi114 fi
326 }
327115
328 update_icons() {116 echo "$icon_result"
329 m=$1117 '';
330 sid=$2118 };
119 colors = {
120 executable = true;
121 target = ".config/sketchybar/colors.sh";
122 text = ''
123
124 export TRANSPARENT=0x00ffffff
125
126 # -- Gray Scheme --
127 export ITEM_COLOR=0xff000000
128 export ACCENT_COLOR=0xffc3c6cb
129
130 # -- White Scheme --
131 # export ITEM_COLOR=0xff000000
132 # export ACCENT_COLOR=0xffffffff
133
134 # -- Teal Scheme --
135 # export ITEM_COLOR=0xff000000
136 # export ACCENT_COLOR=0xff2cf9ed
137
138 # -- Purple Scheme --
139 # export ITEM_COLOR=0xff000000
140 # export ACCENT_COLOR=0xffeb46f9
141
142 # -- Red Scheme ---
143 # export ITEM_COLOR=0xff000000
144 # export ACCENT_COLOR=0xffff2453
145
146 # -- Blue Scheme ---
147 # export ITEM_COLOR=0xff000000
148 # export ACCENT_COLOR=0xff15bdf9
149
150 # -- Green Scheme --
151 # export ITEM_COLOR=0xff000000
152 # export ACCENT_COLOR=0xff1dfca1
153
154 # -- Orange Scheme --
155 # export ITEM_COLOR=0xffffffff
156 # export ACCENT_COLOR=0xfff97716
157
158 # -- Yellow Scheme --
159 # export ITEM_COLOR=0xff000000
160 # export ACCENT_COLOR=0xfff7fc17
161 '';
162 };
163 items_wifi = {
164 executable = true;
165 target = ".config/sketchybar/items/wifi.sh";
166 text = ''
167 #!/usr/bin/env/ sh
168
169 sketchybar --add item wifi right \
170 --set wifi \
171 icon="􀙥" \
172 label="Updating..." \
173 script="$PLUGIN_DIR/wifi.sh" \
174 --subscribe wifi wifi_change
175 '';
176 };
177 items_battery = {
178 executable = true;
179 target = ".config/sketchybar/items/battery.sh";
180 text = ''
181 #!/usr/bin/env/ sh
182 sketchybar --add item battery right \
183 --set battery update_freq=180 \
184 script="$PLUGIN_DIR/battery.sh" \
185 --subscribe battery system_woke power_source_change
186 '';
187 };
188 items_calendar = {
189 executable = true;
190 target = ".config/sketchybar/items/calendar.sh";
191 text = ''
192 #!/usr/bin/env sh
193 sketchybar --add item calendar right \
194 --set calendar icon=􀧞 \
195 update_freq=15 \
196 script="$PLUGIN_DIR/calendar.sh"
197 '';
198 };
199 items_front_app = {
200 executable = true;
201 target = ".config/sketchybar/items/front_app.sh";
202 text = ''
203 #!/usr/bin/env sh
204
205 sketchybar --add item front_app left \
206 --set front_app background.color=$ACCENT_COLOR \
207 icon.color=$ITEM_COLOR \
208 label.color=$ITEM_COLOR \
209 icon.font="sketchybar-app-font:Regular:12.0" \
210 label.font="SF Pro:Semibold:12.0" \
211 script="$PLUGIN_DIR/front_app.sh" \
212 --subscribe front_app front_app_switched
213 '';
214 };
215 items_spaces = {
216 executable = true;
217 target = ".config/sketchybar/items/spaces.sh";
218 text = ''
219 sketchybar --add event aerospace_workspace_change
220
221 sketchybar --add item aerospace_dummy left \
222 --set aerospace_dummy display=0 \
223 script="$PLUGIN_DIR/spaces.sh" \
224 --subscribe aerospace_dummy aerospace_workspace_change
331225
332 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \226 for m in $(aerospace list-monitors | awk '{print $1}'); do
333 | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \227 for sid in $(aerospace list-workspaces --monitor $m); do
334 | sort)228 sketchybar --add space space.$sid left \
229 --set space.$sid space=$sid \
230 icon=$sid \
231 background.color=$TRANSPARENT \
232 label.color=$ACCENT_COLOR \
233 icon.color=$ACCENT_COLOR \
234 display=$m \
235 label.font="sketchybar-app-font:Regular:12.0" \
236 icon.font="SF Pro:Semibold:12.0" \
237 label.padding_right=10 \
238 label.y_offset=-1 \
239 click_script="$PLUGIN_DIR/space_click.sh $sid"
240
241 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" |
242 awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}')
335243
336 icon_strip=""244 icon_strip=""
337 if [ "''${apps}" != "" ]; then245 if [ "''${apps}" != "" ]; then
338 while read -r app; do246 while read -r app; do
339 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"247 icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")"
340 done <<<"''${apps}"248 done <<<"''${apps}"
341 else249 else
342 icon_strip=" —"250 icon_strip=" —"
343 fi251 fi
344252
345 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"253 sketchybar --set space.$sid label="$icon_strip"
346 }
347254
348 update_workspace_appearance "$PREV_WORKSPACE" "false"255 done
349 update_workspace_appearance "$FOCUSED_WORKSPACE" "true"
350256
351 for m in $(aerospace list-monitors | awk '{print $1}'); do257 for empty_space in $(aerospace list-workspaces --monitor $m --empty); do
352 for sid in $(aerospace list-workspaces --monitor $m --visible); do258 sketchybar --set space.$empty_space display=0
353 sketchybar --set space.$sid display=$m259 done
260 for focus in $(aerospace list-workspaces --focused); do
261 sketchybar --set space.$focus background.drawing=on \
262 background.color=$ACCENT_COLOR \
263 label.color=$ITEM_COLOR \
264 icon.color=$ITEM_COLOR
265 done
266 done
267 '';
268 };
269
270 items_volume = {
271 executable = true;
272 target = ".config/sketchybar/items/volume.sh";
273 text = ''
274 #/usr/bin/env sh
275
276 sketchybar --add item volume right \
277 --set volume script="$PLUGIN_DIR/volume.sh" \
278 --subscribe volume volume_change
279 '';
280 };
281 plugins_wifi = {
282 executable = true;
283 target = ".config/sketchybar/plugins/wifi.sh";
284 text = ''
285 #/usr/bin/env sh
286
287 SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }')
288
289 if [ "$SSID" = "" ]; then
290 sketchybar --set $NAME icon="􀙈" label="Disconnected"
291 else
292 sketchybar --set $NAME icon="􀙇" label="$SSID"
293 fi
294
295 '';
296 };
297 plugins_calendar = {
298 executable = true;
299 target = ".config/sketchybar/plugins/calendar.sh";
300
301 text = ''
302 #/usr/bin/env sh
303
304 sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')"
305 '';
306 };
307 plugins_spaces = {
308 executable = true;
309 target = ".config/sketchybar/plugins/spaces.sh";
310 text = ''
311 #!/usr/bin/env sh
312
313 source "$CONFIG_DIR/colors.sh"
314
315 update_workspace_appearance() {
316 local sid=$1
317 local is_focused=$2
318
319 if [ "$is_focused" = "true" ]; then
320 sketchybar --set space.$sid background.drawing=on \
321 background.color=$ACCENT_COLOR \
322 label.color=$ITEM_COLOR \
323 icon.color=$ITEM_COLOR
324 else
325 sketchybar --set space.$sid background.drawing=off \
326 label.color=$ACCENT_COLOR \
327 icon.color=$ACCENT_COLOR
328 fi
329 }
354330
355 update_icons "$m" "$sid"331 update_icons() {
332 m=$1
333 sid=$2
356334
357 update_icons "$m" "$PREV_WORKSPACE"335 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \
336 | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \
337 | sort)
358338
359 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l)339 icon_strip=""
360 if [ "''${apps}" -eq 0 ]; then340 if [ "''${apps}" != "" ]; then
361 sketchybar --set space.$sid display=0341 while read -r app; do
342 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
343 done <<<"''${apps}"
344 else
345 icon_strip=" —"
362 fi346 fi
363 done
364 done
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
379 else
380 aerospace workspace $1
381 fi
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
409347
410 sketchybar --set $NAME icon="$ICON" label="$VOLUME%"348 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
411 fi349 }
412 '';350
413 };351 update_workspace_appearance "$PREV_WORKSPACE" "false"
414 plugins_front_app = {352 update_workspace_appearance "$FOCUSED_WORKSPACE" "true"
415 executable = true;353
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}'); do354 for m in $(aerospace list-monitors | awk '{print $1}'); do
425 for sid in $(aerospace list-workspaces --monitor $m --visible); do355 for sid in $(aerospace list-workspaces --monitor $m --visible); do
356 sketchybar --set space.$sid display=$m
426357
427 apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \358 update_icons "$m" "$sid"
428 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \
429 | awk '!seen[$0]++' | sort)
430359
431 icon_strip=""360 update_icons "$m" "$PREV_WORKSPACE"
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
439361
440 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"362 apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l)
363 if [ "''${apps}" -eq 0 ]; then
364 sketchybar --set space.$sid display=0
365 fi
441 done366 done
442 done367 done
443 }368 '';
444369 };
445 if [ "$SENDER" = "front_app_switched" ]; then370
446371 plugins_space_click = {
447 sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")"372 executable = true;
448373 target = ".config/sketchybar/plugins/space_click.sh";
449 app_switched374 text = ''
450 fi375 #/usr/bin/env/ sh
451 '';376
452 };377 apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}')
453 plugins_battery = {378 focused=$(aerospace list-workspaces --focused)
454 executable = true;379
455 target = ".config/sketchybar/plugins/battery.sh";380 if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then
456 text = ''381 sketchybar --set space.$1 display=0
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"
483 ;;
484 *)
485 ICON="􀛪"
486 COLOR="0xFFef4444"
487 ;;
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 else382 else
512 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic383 aerospace workspace $1
513 fi384 fi
514 }385 '';
515386 };
516 illuminate_mode() {387 plugins_volume = {
517 if [[ "$mode" = "service" ]]388 executable = true;
518 then389 target = ".config/sketchybar/plugins/volume.sh";
519 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE390 text = ''
520 elif [[ "$mode" = "resize" ]]391 #!/usr/bin/env sh
521 then392
522 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN393 # The volume_change event supplies a $INFO variable in which the current volume
523 else394 # percentage is passed to the script.
524 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1395
396 if [ "$SENDER" = "volume_change" ]; then
397
398 VOLUME=$INFO
399
400 case $VOLUME in
401 [6-9][0-9] | 100)
402 ICON="􀊩"
403 ;;
404 [3-5][0-9])
405 ICON="􀊥"
406 ;;
407 [1-9] | [1-2][0-9])
408 ICON="􀊡"
409 ;;
410 *) ICON="􀊣" ;;
411 esac
412
413 sketchybar --set $NAME icon="$ICON" label="$VOLUME%"
525 fi414 fi
526 }415 '';
527 case "$SENDER" in416 };
528 "aerospace_workspace_change")417 plugins_front_app = {
529 highlight_focused_workspace $1418 executable = true;
419 target = ".config/sketchybar/plugins/front_app.sh";
420 text = ''
421 # Some events send additional information specific to the event in the $INFO
422 # variable. E.g. the front_app_switched event sends the name of the newly
423 # focused application in the $INFO variable:
424 # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting
425
426 app_switched() {
427 for m in $(aerospace list-monitors | awk '{print $1}'); do
428 for sid in $(aerospace list-workspaces --monitor $m --visible); do
429
430 apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \
431 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \
432 | awk '!seen[$0]++' | sort)
433
434 icon_strip=""
435 if [ "''${apps}" != "" ]; then
436 while read -r app; do
437 icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")"
438 done <<<"''${apps}"
439 else
440 icon_strip=" —"
441 fi
442
443 sketchybar --animate sin 10 --set space.$sid label="$icon_strip"
444 done
445 done
446 }
447
448 if [ "$SENDER" = "front_app_switched" ]; then
449
450 sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")"
451
452 app_switched
453 fi
454 '';
455 };
456 plugins_battery = {
457 executable = true;
458 target = ".config/sketchybar/plugins/battery.sh";
459 text = ''
460 #!/usr/bin/env sh
461 source "$CONFIG_DIR/colors.sh"
462
463 PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
464 CHARGING=$(pmset -g batt | grep 'AC Power')
465
466 if [ $PERCENTAGE = "" ]; then
467 exit 0
468 fi
469
470 case ''${PERCENTAGE} in
471 9[0-9] | 100)
472 ICON="􀛨"
473 COLOR=$ITEM_COLOR
474 ;;
475 [6-8][0-9])
476 ICON="􀺸"
477 COLOR=$ITEM_COLOR
478 ;;
479 [3-5][0-9])
480 ICON="􀺶"
481 COLOR="0xFFd97706"
530 ;;482 ;;
531 "aerospace_mode_change")483 [1-2][0-9])
532 illuminate_mode484 ICON="􀛩"
485 COLOR="0xFFf97316"
533 ;;486 ;;
534 esac487 *)
535 '';488 ICON="􀛪"
536 };489 COLOR="0xFFef4444"
537 }490 ;;
491 esac
492
493 if [[ $CHARGING != "" ]]; then
494 ICON="􀢋"
495 COLOR=$ITEM_COLOR
496 fi
497
498 # The item invoking this script (name $NAME) will get its icon and label
499 # updated with the current battery status
500 sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR"
501 '';
502 };
503 plugins_aerospace = {
504 executable = true;
505 target = ".config/sketchybar/plugins/aerospace.sh";
506 text = ''
507 #!/usr/bin/env bash
508 source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors
509
510 highlight_focused_workspace() {
511 if [[ "$1" = "$FOCUSED_WORKSPACE" ]]
512 then
513 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0
514 else
515 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic
516 fi
517 }
518
519 illuminate_mode() {
520 if [[ "$mode" = "service" ]]
521 then
522 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE
523 elif [[ "$mode" = "resize" ]]
524 then
525 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN
526 else
527 ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1
528 fi
529 }
530 case "$SENDER" in
531 "aerospace_workspace_change")
532 highlight_focused_workspace $1
533 ;;
534 "aerospace_mode_change")
535 illuminate_mode
536 ;;
537 esac
538 '';
539 };
540 }
538 );541 );
539}542}
modules/macos/system.nix+4-2
...@@ -4,9 +4,11 @@...@@ -4,9 +4,11 @@
4 pkgs,4 pkgs,
5 lib,5 lib,
6 ...6 ...
7}: let7}:
8let
8 tiling = config.shared.darwin.tiling.enable;9 tiling = config.shared.darwin.tiling.enable;
9in {10in
11{
10 # Use touchid or watch to activate sudo12 # Use touchid or watch to activate sudo
11 security.pam.services.sudo_local = {13 security.pam.services.sudo_local = {
12 enable = true;14 enable = true;
modules/nixos/services.nix+4-3
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{pkgs, ...}: {1{ pkgs, ... }:
2{
2 services = {3 services = {
3 avahi = {4 avahi = {
4 enable = true;5 enable = true;
...@@ -40,7 +41,7 @@...@@ -40,7 +41,7 @@
40 # Enable CUPS to print documents.41 # Enable CUPS to print documents.
41 printing = {42 printing = {
42 enable = true;43 enable = true;
43 drivers = [pkgs.brlaser]; # Brother printer driver44 drivers = [ pkgs.brlaser ]; # Brother printer driver
44 };45 };
4546
46 pipewire = {47 pipewire = {
...@@ -55,7 +56,7 @@...@@ -55,7 +56,7 @@
5556
56 openssh = {57 openssh = {
57 enable = true;58 enable = true;
58 ports = [22];59 ports = [ 22 ];
59 settings = {60 settings = {
60 PasswordAuthentication = true;61 PasswordAuthentication = true;
61 UseDns = true;62 UseDns = true;
modules/shared/nix.nix+2-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{inputs, ...}: {1{ inputs, ... }:
2{
2 nixpkgs.config = {3 nixpkgs.config = {
3 allowUnfree = true;4 allowUnfree = true;
4 };5 };
users/natalie/desktop/configuration.nix+8-7
...@@ -3,7 +3,8 @@...@@ -3,7 +3,8 @@
3 user,3 user,
4 host,4 host,
5 ...5 ...
6}: {6}:
7{
7 imports = [8 imports = [
8 # Include the results of the hardware scan.9 # Include the results of the hardware scan.
9 ./hardware-configuration.nix10 ./hardware-configuration.nix
...@@ -17,7 +18,7 @@...@@ -17,7 +18,7 @@
17 enable = true;18 enable = true;
18 # Certain features, including CLI integration and system authentication support,19 # Certain features, including CLI integration and system authentication support,
19 # require enabling PolKit integration on some desktop environments (e.g. Plasma).20 # require enabling PolKit integration on some desktop environments (e.g. Plasma).
20 polkitPolicyOwners = [user.username];21 polkitPolicyOwners = [ user.username ];
21 };22 };
2223
23 noisetorch.enable = true;24 noisetorch.enable = true;
...@@ -34,7 +35,7 @@...@@ -34,7 +35,7 @@
3435
35 steam = {36 steam = {
36 enable = true;37 enable = true;
37 package = with pkgs; steam.override {extraPkgs = pkgs: [attr];};38 package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; };
38 };39 };
3940
40 git = {41 git = {
...@@ -58,7 +59,7 @@...@@ -58,7 +59,7 @@
5859
59 xdg.portal = {60 xdg.portal = {
60 enable = true;61 enable = true;
61 extraPortals = with pkgs; [xdg-desktop-portal-gtk];62 extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
62 };63 };
63 virtualisation = {64 virtualisation = {
64 containers.enable = true;65 containers.enable = true;
...@@ -83,14 +84,14 @@...@@ -83,14 +84,14 @@
83 hybrid-sleep.enable = false;84 hybrid-sleep.enable = false;
84 };85 };
8586
86 services.monitord.wantedBy = ["multi-user.target"];87 services.monitord.wantedBy = [ "multi-user.target" ];
87 };88 };
8889
89 i18n = {90 i18n = {
90 # Select internationalisation properties.91 # Select internationalisation properties.
91 defaultLocale = "en_US.UTF-8";92 defaultLocale = "en_US.UTF-8";
9293
93 supportedLocales = ["all"];94 supportedLocales = [ "all" ];
9495
95 extraLocaleSettings = {96 extraLocaleSettings = {
96 LC_ADDRESS = "en_US.UTF-8";97 LC_ADDRESS = "en_US.UTF-8";
...@@ -170,7 +171,7 @@...@@ -170,7 +171,7 @@
170 };171 };
171 interfaces.enp11s0.wakeOnLan = {172 interfaces.enp11s0.wakeOnLan = {
172 enable = true;173 enable = true;
173 policy = ["magic"];174 policy = [ "magic" ];
174 };175 };
175 };176 };
176177
users/natalie/desktop/home.nix+3-1
...@@ -8,6 +8,7 @@...@@ -8,6 +8,7 @@
8 ...8 ...
9}:9}:
10{10{
11 programs.mangohud.enable = true;
11 home = {12 home = {
12 stateVersion = "23.05"; # Please read the comment before changing.13 stateVersion = "23.05"; # Please read the comment before changing.
1314
...@@ -29,6 +30,7 @@...@@ -29,6 +30,7 @@
29 wineWowPackages.stable30 wineWowPackages.stable
30 winetricks31 winetricks
31 (prismlauncher.override { gamemodeSupport = true; })32 (prismlauncher.override { gamemodeSupport = true; })
33 umu-launcher
3234
33 #window manager stuff35 #window manager stuff
34 wofi36 wofi
...@@ -50,8 +52,8 @@...@@ -50,8 +52,8 @@
50 signal-desktop52 signal-desktop
51 inputs.zls.packages.x86_64-linux.zls53 inputs.zls.packages.x86_64-linux.zls
52 rust-bin.stable.latest.default54 rust-bin.stable.latest.default
55 inputs.zen-browser.packages.x86_64-linux.default
53 ];56 ];
54 # programs.mangohud.enable = true;
55 };57 };
5658
57 # xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop";59 # xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop";
users/natalie/home.nix+2-1
...@@ -2,7 +2,8 @@...@@ -2,7 +2,8 @@
2 pkgs,2 pkgs,
3 lib,3 lib,
4 ...4 ...
5} @ args: {5}@args:
6{
6 programs = {7 programs = {
7 # sort-lines:start8 # sort-lines:start
8 atuin.enable = true;9 atuin.enable = true;
users/natalie/laptop/configuration.nix+3-2
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{pkgs, ...}: {1{ pkgs, ... }:
2{
2 environment.systemPackages = with pkgs; [3 environment.systemPackages = with pkgs; [
3 pinentry_mac4 pinentry_mac
4 ];5 ];
...@@ -6,7 +7,7 @@...@@ -6,7 +7,7 @@
6 # Custom configuration modules in "modules" are shared between users,7 # Custom configuration modules in "modules" are shared between users,
7 # and can be configured in this "shared" namespace8 # and can be configured in this "shared" namespace
8 shared.darwin = {9 shared.darwin = {
9 macAppStoreApps = ["wireguard"];10 macAppStoreApps = [ "wireguard" ];
10 };11 };
1112
12 # Create /etc/zshrc that loads the nix-darwin environment.13 # Create /etc/zshrc that loads the nix-darwin environment.
users/natalie/vim/default.nix+2-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{...}: {1{ ... }:
2{
2 imports = [3 imports = [
3 ./keybinds.nix4 ./keybinds.nix
4 ./languages.nix5 ./languages.nix
users/natalie/vim/lean.nix+2-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{pkgs, ...}: {1{ pkgs, ... }:
2{
2 vim = {3 vim = {
3 lazy.plugins."lean.nvim" = {4 lazy.plugins."lean.nvim" = {
4 enabled = true;5 enabled = true;
users/natalie/vim/visuals.nix+2-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{pkgs, ...}: {1{ pkgs, ... }:
2{
2 vim = {3 vim = {
3 visuals = {4 visuals = {
4 indent-blankline = {5 indent-blankline = {