authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-04-19 13:50:58-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-04-19 13:50:58-07:00
log9178ae96bef7dee6cc50bb6d62b44efbdd08f0a8
tree54684a950b208cc6e963f4fd19ce26edd67b8377
parent637042c243b76c67f5bbb8617e334a660bc5b4ef
signature Commit is signed but in an unrecognized format.

working


8 files changed, 171 insertions(+), 181 deletions(-)

hosts/desktop/configuration.nix-110
......@@ -12,12 +12,6 @@
1212 ../../modules/nixos/nvidia.nix
1313 ../../modules/nixos/boot.nix
1414 ];
15 services.avahi = {
16 enable = true;
17 nssmdns4 = true;
18 openFirewall = true;
19 };
20
2115 programs.gamemode.enable = true;
2216
2317 programs._1password.enable = true;
......@@ -28,11 +22,9 @@
2822 polkitPolicyOwners = ["nmarks"];
2923 };
3024
31 services.blueman.enable = true;
3225 hardware.bluetooth.enable = true;
3326
3427 services = {
35 ratbagd.enable = true;
3628 };
3729
3830 programs.noisetorch.enable = true;
......@@ -42,8 +34,6 @@
4234 extraPortals = with pkgs; [xdg-desktop-portal-gtk];
4335 };
4436
45 services.flatpak.enable = true;
46
4737 virtualisation.containers.enable = true;
4838 virtualisation.podman = {
4939 enable = true;
......@@ -57,21 +47,6 @@
5747
5848 programs.fish.enable = true;
5949
60 services.tailscale.enable = true;
61
62 services.keyd = {
63 enable = true;
64 keyboards = {
65 default = {
66 settings = {
67 main = {
68 capslock = "escape";
69 };
70 };
71 };
72 };
73 };
74
7550 virtualisation.libvirtd.enable = true;
7651 programs.virt-manager.enable = true;
7752
......@@ -89,52 +64,6 @@
8964 flake = "/home/nmarks/.dotfiles";
9065 };
9166
92 fonts.packages = with pkgs; [
93 # alibaba-fonts
94 nerd-fonts.fira-code
95 nerd-fonts.iosevka
96 ];
97
98 # Set your time zone.
99 time.timeZone = "America/Los_Angeles";
100
101 # Select internationalisation properties.
102 i18n.defaultLocale = "en_US.UTF-8";
103
104 i18n.supportedLocales = ["all"];
105
106 i18n.extraLocaleSettings = {
107 LC_ADDRESS = "en_US.UTF-8";
108 LC_IDENTIFICATION = "en_US.UTF-8";
109 LC_MEASUREMENT = "en_US.UTF-8";
110 LC_MONETARY = "en_US.UTF-8";
111 LC_NAME = "en_US.UTF-8";
112 LC_NUMERIC = "en_US.UTF-8";
113 LC_PAPER = "en_US.UTF-8";
114 LC_TELEPHONE = "en_US.UTF-8";
115 LC_TIME = "en_US.UTF-8";
116 };
117
118 i18n.inputMethod = {
119 type = "fcitx5";
120 enable = true;
121 fcitx5.waylandFrontend = true;
122 fcitx5.addons = with pkgs; [
123 # fcitx5-gtk
124 # kdePackages.fcitx5-qt
125 rime-data
126 fcitx5-rime
127 fcitx5-rose-pine
128 ];
129 };
130
131 # Enable the X11 windowing system.
132 # services.xserver.enable = true;
133 # services.xserver.displayManager.startx.enable = true;
134
135 # Enable the KDE Plasma Desktop Environment.
136 # services.displayManager.sddm.enable = true;
137 # services.desktopManager.plasma6.enable = true;
13867
13968 ### Cosmic stuff
14069
......@@ -144,35 +73,9 @@
14473
14574 systemd.services.monitord.wantedBy = ["multi-user.target"];
14675
147 services.desktopManager.cosmic.enable = true;
148 services.displayManager.cosmic-greeter.enable = true;
149
150 # Configure keymap in X11
151 services.xserver = {
152 xkb.layout = "us";
153 xkb.variant = "";
154 };
155
156 # Enable CUPS to print documents.
157 services.printing.enable = true;
158
15976 # Enable sound with pipewire.
16077 # services.pulseaudio.enable = true;
16178 security.rtkit.enable = true;
162 services.pipewire = {
163 enable = true;
164 audio.enable = true;
165 alsa.enable = true;
166 alsa.support32Bit = true;
167 pulse.enable = true;
168 # systemWide = true;
169 # If you want to use JACK applications, uncomment this
170 #jack.enable = true;
171
172 # use the example session manager (no others are packaged yet so this is enabled by default,
173 # no need to redefine it in your config for now)
174 #media-session.enable = true;
175 };
17679
17780 # Enable touchpad support (enabled default in most desktopManager).
17881 # services.xserver.libinput.enable = true;
......@@ -222,19 +125,6 @@
222125 pinentryPackage = pkgs.pinentry-curses;
223126 };
224127
225 # List services that you want to enable:
226
227 # Enable the OpenSSH daemon.
228 services.openssh = {
229 enable = true;
230 ports = [22];
231 settings = {
232 PasswordAuthentication = true;
233 UseDns = true;
234 X11Forwarding = true;
235 };
236 };
237
238128 programs.kdeconnect.enable = true;
239129
240130 networking = {
hosts/laptop/home.nix+2-2
......@@ -3,13 +3,13 @@
33 config,
44 pkgs,
55 lib,
6 currentSystemUser,
6 user,
77 ...
88}: {
99 programs = import ../shared/home-programs.nix {inherit inputs config pkgs lib;};
1010
1111 home = {
12 username = currentSystemUser;
12 username = user;
1313 homeDirectory = "/Users/nmarks/";
1414 # Home Manager needs a bit of information about you and the paths it should
1515 # manage.
hosts/laptop/modules/icons.nix deleted-61
......@@ -1,61 +0,0 @@
1{
2 lib,
3 config,
4 ...
5}: let
6 cfg = config.environment.customIcons;
7 inherit
8 (lib)
9 mkEnableOption
10 mkIf
11 mkMerge
12 mkOption
13 types
14 ;
15in {
16 options.environment.customIcons = {
17 enable = mkEnableOption "environment.customIcons";
18 clearCacheOnActivation = mkEnableOption "environment.customIcons.clearCacheOnActivation";
19
20 icons = mkOption {
21 type = types.listOf (
22 types.submodule {
23 options = {
24 path = mkOption {type = types.path;};
25 icon = mkOption {type = types.path;};
26 };
27 }
28 );
29 };
30 };
31
32 config = mkMerge [
33 (mkIf cfg.enable {
34 system.activationScripts.extraActivation.text = ''
35 echo -e "applying custom icons..."
36
37 ${
38 (builtins.concatStringsSep "\n\n" (
39 builtins.map (iconCfg: ''
40 osascript <<EOF >/dev/null
41 use framework "Cocoa"
42
43 set iconPath to "${iconCfg.icon}"
44 set destPath to "${iconCfg.path}"
45
46 set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:iconPath)
47 (current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2)
48 EOF
49 '')
50 cfg.icons
51 ))
52 }
53
54 ${lib.optionalString cfg.clearCacheOnActivation ''
55 sudo rm -rf /Library/Caches/com.apple.iconservices.store
56 sudo find /private/var/folders/ -name com.apple.dock.iconcache -or -name com.apple.iconservices -or -name com.apple.iconservicesagent -exec rm -rf {} \; || true
57 killall Dock
58 ''}'';
59 })
60 ];
61}
hosts/shared/home-programs.nix+2
......@@ -58,6 +58,8 @@
5858 };
5959 color_align = {
6060 mode = "horizontal";
61 # custom_colors = [];
62 # fore_back = null;
6163 };
6264 distro = "nixos";
6365 pride_month_shown = [
lib/mkSystem.nix+4-8
......@@ -10,11 +10,6 @@
1010 darwin ? false,
1111 extraModules ? [],
1212}: let
13 # mkIfElse = p: yes: no:
14 # nixpkgs.lib.mkMerge [
15 # (nixpkgs.lib.mkIf p yes)
16 # (nixpkgs.lib.mkIf (!p) no)
17 # ];
1813 nixindex =
1914 if darwin
2015 then inputs.nix-index-database.darwinModules.nix-index
......@@ -59,8 +54,7 @@ in
5954 # Enable caching for nix-index so we dont have to rebuild it
6055
6156 #shared modules
62 ../modules/shared/nix.nix
63 ../modules/shared/extras.nix
57 ../modules/shared
6458
6559 hostConfig
6660 nixindex
......@@ -71,9 +65,11 @@ in
7165 useGlobalPkgs = true;
7266 useUserPackages = true;
7367 backupFileExtension = "hm-backup";
74 extraSpecialArgs = {inherit inputs;};
68 extraSpecialArgs = {inherit inputs user;};
7569 users.${user} = homeConfig;
7670 };
71
72 users.users.${user}.home = homeDir;
7773 }
7874
7975 # We expose some extra arguments so that our modules can parameterize
modules/macos/icons.nix created+61
......@@ -0,0 +1,61 @@
1{
2 lib,
3 config,
4 ...
5}: let
6 cfg = config.environment.customIcons;
7 inherit
8 (lib)
9 mkEnableOption
10 mkIf
11 mkMerge
12 mkOption
13 types
14 ;
15in {
16 options.environment.customIcons = {
17 enable = mkEnableOption "environment.customIcons";
18 clearCacheOnActivation = mkEnableOption "environment.customIcons.clearCacheOnActivation";
19
20 icons = mkOption {
21 type = types.listOf (
22 types.submodule {
23 options = {
24 path = mkOption {type = types.path;};
25 icon = mkOption {type = types.path;};
26 };
27 }
28 );
29 };
30 };
31
32 config = mkMerge [
33 (mkIf cfg.enable {
34 system.activationScripts.extraActivation.text = ''
35 echo -e "applying custom icons..."
36
37 ${
38 (builtins.concatStringsSep "\n\n" (
39 builtins.map (iconCfg: ''
40 osascript <<EOF >/dev/null
41 use framework "Cocoa"
42
43 set iconPath to "${iconCfg.icon}"
44 set destPath to "${iconCfg.path}"
45
46 set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:iconPath)
47 (current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2)
48 EOF
49 '')
50 cfg.icons
51 ))
52 }
53
54 ${lib.optionalString cfg.clearCacheOnActivation ''
55 sudo rm -rf /Library/Caches/com.apple.iconservices.store
56 sudo find /private/var/folders/ -name com.apple.dock.iconcache -or -name com.apple.iconservices -or -name com.apple.iconservicesagent -exec rm -rf {} \; || true
57 killall Dock
58 ''}'';
59 })
60 ];
61}
modules/nixos/services.nix created+63
......@@ -0,0 +1,63 @@
1{
2 lib,
3 pkgs,
4 config,
5 ...
6}: {
7 services = {
8 avahi = {
9 enable = true;
10 nssmdns4 = true;
11 openFirewall = true;
12 };
13 blueman.enable = true;
14 ratbagd.enable = true;
15 flatpak.enable = true;
16 keyd = {
17 enable = true;
18 keyboards = {
19 default = {
20 settings = {
21 main = {
22 capslock = "escape";
23 };
24 };
25 };
26 };
27 };
28
29 desktopManager.cosmic.enable = true;
30 displayManager.cosmic-greeter.enable = true;
31
32 # Configure keymap in X11
33 xserver = {
34 xkb.layout = "us";
35 xkb.variant = "";
36 };
37
38 tailscale.enable = true;
39
40 # Enable CUPS to print documents.
41 printing.enable = true;
42
43 pipewire = {
44 enable = true;
45 audio.enable = true;
46 alsa.enable = true;
47 alsa.support32Bit = true;
48 pulse.enable = true;
49 # systemWide = true;
50 #media-session.enable = true;
51 };
52
53 openssh = {
54 enable = true;
55 ports = [22];
56 settings = {
57 PasswordAuthentication = true;
58 UseDns = true;
59 X11Forwarding = true;
60 };
61 };
62 };
63}
modules/shared/extras.nix+39
......@@ -6,4 +6,43 @@
66}: {
77 networking = {
88 };
9 fonts.packages = with pkgs; [
10 # alibaba-fonts
11 nerd-fonts.fira-code
12 nerd-fonts.iosevka
13 ];
14
15 # Set your time zone.
16 time.timeZone = "America/Los_Angeles";
17 i18n = {
18 # Select internationalisation properties.
19 defaultLocale = "en_US.UTF-8";
20
21 supportedLocales = ["all"];
22
23 extraLocaleSettings = {
24 LC_ADDRESS = "en_US.UTF-8";
25 LC_IDENTIFICATION = "en_US.UTF-8";
26 LC_MEASUREMENT = "en_US.UTF-8";
27 LC_MONETARY = "en_US.UTF-8";
28 LC_NAME = "en_US.UTF-8";
29 LC_NUMERIC = "en_US.UTF-8";
30 LC_PAPER = "en_US.UTF-8";
31 LC_TELEPHONE = "en_US.UTF-8";
32 LC_TIME = "en_US.UTF-8";
33 };
34
35 inputMethod = {
36 type = "fcitx5";
37 enable = true;
38 fcitx5.waylandFrontend = true;
39 fcitx5.addons = with pkgs; [
40 # fcitx5-gtk
41 # kdePackages.fcitx5-qt
42 rime-data
43 fcitx5-rime
44 fcitx5-rose-pine
45 ];
46 };
47 };
948}