diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index e124c9e..c27dccf 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -64,7 +64,37 @@ flake = "/home/nmarks/.dotfiles"; }; + i18n = { + # Select internationalisation properties. + defaultLocale = "en_US.UTF-8"; + supportedLocales = ["all"]; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.waylandFrontend = true; + fcitx5.addons = with pkgs; [ + # fcitx5-gtk + # kdePackages.fcitx5-qt + rime-data + fcitx5-rime + fcitx5-rose-pine + ]; + }; + }; ### Cosmic stuff environment.sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1; diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index c3153c9..add1619 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -6,7 +6,8 @@ ... }: { imports = [ - ./modules/icons.nix + # ../../modules/macos/icons.nix + ../../modules/macos/homebrew.nix ]; environment.systemPackages = with pkgs; [ @@ -14,15 +15,15 @@ pinentry_mac ]; - environment.customIcons = { - enable = true; - icons = [ - { - path = "/Applications/Zen.app"; - icon = "/Users/nmarks/.dotfiles/icons/Zen_icons/firefox.icns"; - } - ]; - }; + # environment.customIcons = { + # enable = true; + # icons = [ + # { + # path = "/Applications/Zen.app"; + # icon = "/Users/nmarks/.dotfiles/icons/Zen_icons/firefox.icns"; + # } + # ]; + # }; # Use a custom configuration.nix location. #environment.darwinConfig = "$HOME/.dotfiles/hosts/laptop"; @@ -43,52 +44,6 @@ ''; }; - # Used for backwards compatibility, please read the changelog before changing. - # $ darwin-rebuild changelog - system.stateVersion = 6; - - # Install fonts - fonts.packages = [ - pkgs.iosevka - pkgs.nerd-fonts.symbols-only - pkgs.nerd-fonts.iosevka - ]; - - services.tailscale.enable = true; - - # Use homebrew to install casks and Mac App Store apps - homebrew = { - enable = true; - - onActivation = { - autoUpdate = true; - cleanup = "none"; - upgrade = true; - }; - - # taps = [ - # "legcord/legcord" - # ]; - - brews = [ - "imagemagick" - "opam" - ]; - - casks = [ - "battle-net" - "stremio" - "alt-tab" - "legcord" - "zulip" - "zen-browser" - ]; - - masApps = { - "wireguard" = 1451685025; - }; - }; - security.pam.services.sudo_local = { enable = true; reattach = true; @@ -96,39 +51,73 @@ }; # set some OSX preferences that I always end up hunting down and changing. - system.defaults = { - # minimal dock - dock = { - autohide = false; - show-process-indicators = true; - show-recents = true; - static-only = true; - }; - # a finder that tells me what I want to know and lets me work - finder = { - AppleShowAllExtensions = true; - ShowPathbar = true; - FXEnableExtensionChangeWarning = false; - }; + system = { + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + stateVersion = 6; - CustomUserPreferences = { - launchd.user.agents.UserKeyMapping.serviceConfig = { - ProgramArguments = [ - "/usr/bin/hidutil" - "property" - "--match" - "{"ProductID":0x0,"VendorID":0x0,"Product":"Apple Internal Keyboard / Trackpad"}" - "--set" - ( - let - # https://developer.apple.com/library/archive/technotes/tn2450/_index.html - caps_lock = "0x700000039"; - escape = "0x700000029"; - in "{"UserKeyMapping":[{"HIDKeyboardModifierMappingDst":${escape},"HIDKeyboardModifierMappingSrc":${caps_lock}},{"HIDKeyboardModifierMappingDst":${caps_lock},"HIDKeyboardModifierMappingSrc":${escape}}]}" - ) - ]; - RunAtLoad = true; + defaults = { + LaunchServices = { + LSQuarantine = false; }; + + NSGlobalDomain = { + AppleShowAllExtensions = true; + ApplePressAndHoldEnabled = false; + + # 120, 90, 60, 30, 12, 6, 2 + KeyRepeat = 2; + + # 120, 94, 68, 35, 25, 15 + InitialKeyRepeat = 15; + + "com.apple.mouse.tapBehavior" = 1; + "com.apple.sound.beep.volume" = 0.0; + "com.apple.sound.beep.feedback" = 0; + + #Ew. + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticInlinePredictionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = false; + NSAutomaticSpellingCorrectionEnabled = false; + NSDisableAutomaticTermination = true; + NSDocumentSaveNewDocumentsToCloud = false; + AppleICUForce24HourTime = true; + }; + # minimal dock + dock = { + autohide = true; + autohide-time-modifier = 0; + show-process-indicators = true; + + expose-group-apps = true; + + show-recents = true; + static-only = true; + + mineffect = "scale"; + + orientation = "bottom"; + }; + # a finder that tells me what I want to know and lets me work + finder = { + _FXShowPosixPathInTitle = true; + FXDefaultSearchScope = "SCcf"; + AppleShowAllExtensions = true; + ShowPathbar = true; + FXEnableExtensionChangeWarning = false; + }; + CustomSystemPreferences = { + "com.apple.universalaccess" = { + closeViewTrackpadGestureZoomEnabled = 1; + }; + }; + }; + keyboard = { + enableKeyMapping = true; + remapCapsLockToEscape = true; }; }; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 40d5904..ae685f0 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -11,6 +11,7 @@ home = { username = user; homeDirectory = "/Users/nmarks/"; + shell = pkgs.fish; # Home Manager needs a bit of information about you and the paths it should # manage. # This value determines the Home Manager release that your configuration is diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 9ec6f70..d6c7fd6 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -54,7 +54,8 @@ in # Enable caching for nix-index so we dont have to rebuild it #shared modules - ../modules/shared + ../modules/shared/extras.nix + ../modules/shared/nix.nix hostConfig nixindex diff --git a/modules/macos/homebrew.nix b/modules/macos/homebrew.nix new file mode 100644 index 0000000..41ec9e1 --- /dev/null +++ b/modules/macos/homebrew.nix @@ -0,0 +1,40 @@ +{ + inputs, + config, + lib, + pkgs, + ... +}: { + # Use homebrew to install casks and Mac App Store apps + homebrew = { + enable = true; + + onActivation = { + autoUpdate = true; + cleanup = "none"; + upgrade = true; + }; + + # taps = [ + # "legcord/legcord" + # ]; + + brews = [ + "imagemagick" + "opam" + ]; + + casks = [ + "battle-net" + "stremio" + "alt-tab" + "legcord" + "zulip" + "zen-browser" + ]; + + masApps = { + "wireguard" = 1451685025; + }; + }; +} diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix index 6446139..c980d52 100644 --- a/modules/nixos/services.nix +++ b/modules/nixos/services.nix @@ -26,6 +26,7 @@ }; }; + desktopManager.cosmic.enable = true; displayManager.cosmic-greeter.enable = true; diff --git a/modules/shared/extras.nix b/modules/shared/extras.nix index 26a85af..619559a 100644 --- a/modules/shared/extras.nix +++ b/modules/shared/extras.nix @@ -4,45 +4,19 @@ inputs, ... }: { + services.tailscale.enable = true; + networking = { }; fonts.packages = with pkgs; [ # alibaba-fonts nerd-fonts.fira-code nerd-fonts.iosevka + iosevka + nerd-fonts.symbols-only + nerd-fonts.iosevka ]; # Set your time zone. time.timeZone = "America/Los_Angeles"; - i18n = { - # Select internationalisation properties. - defaultLocale = "en_US.UTF-8"; - - supportedLocales = ["all"]; - - extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - inputMethod = { - type = "fcitx5"; - enable = true; - fcitx5.waylandFrontend = true; - fcitx5.addons = with pkgs; [ - # fcitx5-gtk - # kdePackages.fcitx5-qt - rime-data - fcitx5-rime - fcitx5-rose-pine - ]; - }; - }; }