| author | |
| committer | |
| log | 9178ae96bef7dee6cc50bb6d62b44efbdd08f0a8 |
| tree | 54684a950b208cc6e963f4fd19ce26edd67b8377 |
| parent | 637042c243b76c67f5bbb8617e334a660bc5b4ef |
| signature | Commit is signed but in an unrecognized format. |
8 files changed, 171 insertions(+), 181 deletions(-)
hosts/desktop/configuration.nix-110| ... | @@ -12,12 +12,6 @@ | ... | @@ -12,12 +12,6 @@ |
| 12 | ../../modules/nixos/nvidia.nix | 12 | ../../modules/nixos/nvidia.nix |
| 13 | ../../modules/nixos/boot.nix | 13 | ../../modules/nixos/boot.nix |
| 14 | ]; | 14 | ]; |
| 15 | services.avahi = { | ||
| 16 | enable = true; | ||
| 17 | nssmdns4 = true; | ||
| 18 | openFirewall = true; | ||
| 19 | }; | ||
| 20 | |||
| 21 | programs.gamemode.enable = true; | 15 | programs.gamemode.enable = true; |
| 22 | 16 | ||
| 23 | programs._1password.enable = true; | 17 | programs._1password.enable = true; |
| ... | @@ -28,11 +22,9 @@ | ... | @@ -28,11 +22,9 @@ |
| 28 | polkitPolicyOwners = ["nmarks"]; | 22 | polkitPolicyOwners = ["nmarks"]; |
| 29 | }; | 23 | }; |
| 30 | 24 | ||
| 31 | services.blueman.enable = true; | ||
| 32 | hardware.bluetooth.enable = true; | 25 | hardware.bluetooth.enable = true; |
| 33 | 26 | ||
| 34 | services = { | 27 | services = { |
| 35 | ratbagd.enable = true; | ||
| 36 | }; | 28 | }; |
| 37 | 29 | ||
| 38 | programs.noisetorch.enable = true; | 30 | programs.noisetorch.enable = true; |
| ... | @@ -42,8 +34,6 @@ | ... | @@ -42,8 +34,6 @@ |
| 42 | extraPortals = with pkgs; [xdg-desktop-portal-gtk]; | 34 | extraPortals = with pkgs; [xdg-desktop-portal-gtk]; |
| 43 | }; | 35 | }; |
| 44 | 36 | ||
| 45 | services.flatpak.enable = true; | ||
| 46 | |||
| 47 | virtualisation.containers.enable = true; | 37 | virtualisation.containers.enable = true; |
| 48 | virtualisation.podman = { | 38 | virtualisation.podman = { |
| 49 | enable = true; | 39 | enable = true; |
| ... | @@ -57,21 +47,6 @@ | ... | @@ -57,21 +47,6 @@ |
| 57 | 47 | ||
| 58 | programs.fish.enable = true; | 48 | programs.fish.enable = true; |
| 59 | 49 | ||
| 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 | |||
| 75 | virtualisation.libvirtd.enable = true; | 50 | virtualisation.libvirtd.enable = true; |
| 76 | programs.virt-manager.enable = true; | 51 | programs.virt-manager.enable = true; |
| 77 | 52 | ||
| ... | @@ -89,52 +64,6 @@ | ... | @@ -89,52 +64,6 @@ |
| 89 | flake = "/home/nmarks/.dotfiles"; | 64 | flake = "/home/nmarks/.dotfiles"; |
| 90 | }; | 65 | }; |
| 91 | 66 | ||
| 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; | ||
| 138 | 67 | ||
| 139 | ### Cosmic stuff | 68 | ### Cosmic stuff |
| 140 | 69 | ||
| ... | @@ -144,35 +73,9 @@ | ... | @@ -144,35 +73,9 @@ |
| 144 | 73 | ||
| 145 | systemd.services.monitord.wantedBy = ["multi-user.target"]; | 74 | systemd.services.monitord.wantedBy = ["multi-user.target"]; |
| 146 | 75 | ||
| 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 | |||
| 159 | # Enable sound with pipewire. | 76 | # Enable sound with pipewire. |
| 160 | # services.pulseaudio.enable = true; | 77 | # services.pulseaudio.enable = true; |
| 161 | security.rtkit.enable = true; | 78 | 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 | }; | ||
| 176 | 79 | ||
| 177 | # Enable touchpad support (enabled default in most desktopManager). | 80 | # Enable touchpad support (enabled default in most desktopManager). |
| 178 | # services.xserver.libinput.enable = true; | 81 | # services.xserver.libinput.enable = true; |
| ... | @@ -222,19 +125,6 @@ | ... | @@ -222,19 +125,6 @@ |
| 222 | pinentryPackage = pkgs.pinentry-curses; | 125 | pinentryPackage = pkgs.pinentry-curses; |
| 223 | }; | 126 | }; |
| 224 | 127 | ||
| 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 | |||
| 238 | programs.kdeconnect.enable = true; | 128 | programs.kdeconnect.enable = true; |
| 239 | 129 | ||
| 240 | networking = { | 130 | networking = { |
hosts/laptop/home.nix+2-2| ... | @@ -3,13 +3,13 @@ | ... | @@ -3,13 +3,13 @@ |
| 3 | config, | 3 | config, |
| 4 | pkgs, | 4 | pkgs, |
| 5 | lib, | 5 | lib, |
| 6 | currentSystemUser, | 6 | user, |
| 7 | ... | 7 | ... |
| 8 | }: { | 8 | }: { |
| 9 | programs = import ../shared/home-programs.nix {inherit inputs config pkgs lib;}; | 9 | programs = import ../shared/home-programs.nix {inherit inputs config pkgs lib;}; |
| 10 | 10 | ||
| 11 | home = { | 11 | home = { |
| 12 | username = currentSystemUser; | 12 | username = user; |
| 13 | homeDirectory = "/Users/nmarks/"; | 13 | homeDirectory = "/Users/nmarks/"; |
| 14 | # Home Manager needs a bit of information about you and the paths it should | 14 | # Home Manager needs a bit of information about you and the paths it should |
| 15 | # manage. | 15 | # 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 | ; | ||
| 15 | in { | ||
| 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 @@ | ... | @@ -58,6 +58,8 @@ |
| 58 | }; | 58 | }; |
| 59 | color_align = { | 59 | color_align = { |
| 60 | mode = "horizontal"; | 60 | mode = "horizontal"; |
| 61 | # custom_colors = []; | ||
| 62 | # fore_back = null; | ||
| 61 | }; | 63 | }; |
| 62 | distro = "nixos"; | 64 | distro = "nixos"; |
| 63 | pride_month_shown = [ | 65 | pride_month_shown = [ |
lib/mkSystem.nix+4-8| ... | @@ -10,11 +10,6 @@ | ... | @@ -10,11 +10,6 @@ |
| 10 | darwin ? false, | 10 | darwin ? false, |
| 11 | extraModules ? [], | 11 | extraModules ? [], |
| 12 | }: let | 12 | }: let |
| 13 | # mkIfElse = p: yes: no: | ||
| 14 | # nixpkgs.lib.mkMerge [ | ||
| 15 | # (nixpkgs.lib.mkIf p yes) | ||
| 16 | # (nixpkgs.lib.mkIf (!p) no) | ||
| 17 | # ]; | ||
| 18 | nixindex = | 13 | nixindex = |
| 19 | if darwin | 14 | if darwin |
| 20 | then inputs.nix-index-database.darwinModules.nix-index | 15 | then inputs.nix-index-database.darwinModules.nix-index |
| ... | @@ -59,8 +54,7 @@ in | ... | @@ -59,8 +54,7 @@ in |
| 59 | # Enable caching for nix-index so we dont have to rebuild it | 54 | # Enable caching for nix-index so we dont have to rebuild it |
| 60 | 55 | ||
| 61 | #shared modules | 56 | #shared modules |
| 62 | ../modules/shared/nix.nix | 57 | ../modules/shared |
| 63 | ../modules/shared/extras.nix | ||
| 64 | 58 | ||
| 65 | hostConfig | 59 | hostConfig |
| 66 | nixindex | 60 | nixindex |
| ... | @@ -71,9 +65,11 @@ in | ... | @@ -71,9 +65,11 @@ in |
| 71 | useGlobalPkgs = true; | 65 | useGlobalPkgs = true; |
| 72 | useUserPackages = true; | 66 | useUserPackages = true; |
| 73 | backupFileExtension = "hm-backup"; | 67 | backupFileExtension = "hm-backup"; |
| 74 | extraSpecialArgs = {inherit inputs;}; | 68 | extraSpecialArgs = {inherit inputs user;}; |
| 75 | users.${user} = homeConfig; | 69 | users.${user} = homeConfig; |
| 76 | }; | 70 | }; |
| 71 | |||
| 72 | users.users.${user}.home = homeDir; | ||
| 77 | } | 73 | } |
| 78 | 74 | ||
| 79 | # We expose some extra arguments so that our modules can parameterize | 75 | # 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 | ; | ||
| 15 | in { | ||
| 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 @@ | ... | @@ -6,4 +6,43 @@ |
| 6 | }: { | 6 | }: { |
| 7 | networking = { | 7 | networking = { |
| 8 | }; | 8 | }; |
| 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 | }; | ||
| 9 | } | 48 | } |