From e2189397fc6daf3f2260acec1401db5a45165006 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 18 Jun 2022 13:17:11 -0400 Subject: [PATCH] fixes to get darwin to build --- hosts/common.nix | 2 +- hosts/macbook/default.nix | 13 +++++++++---- modules/applications/alacritty.nix | 2 +- modules/darwin/default.nix | 24 +++++++++++++++++++++++- modules/darwin/homebrew.nix | 2 ++ modules/darwin/system.nix | 2 +- modules/darwin/utilities.nix | 10 ++++++---- modules/mail/himalaya.nix | 4 ++-- 8 files changed, 45 insertions(+), 14 deletions(-) diff --git a/hosts/common.nix b/hosts/common.nix index ac70515..2c4e2c9 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -25,7 +25,7 @@ nix.extraOptions = "experimental-features = nix-command flakes"; # Pin a state version to prevent warnings - system.stateVersion = "22.11"; + # system.stateVersion = "22.11"; # Basic common system packages for all devices environment.systemPackages = with pkgs; [ git vim wget curl ]; diff --git a/hosts/macbook/default.nix b/hosts/macbook/default.nix index 576ca48..7a31ed5 100644 --- a/hosts/macbook/default.nix +++ b/hosts/macbook/default.nix @@ -5,18 +5,23 @@ darwin.lib.darwinSystem { system = "x86_64-darwin"; specialArgs = { }; modules = [ - globals // { user = "Noah.Masur" } home-manager.darwinModules.home-manager { - gui.enable = true; + user = "Noah.Masur"; + fullName = globals.fullName; + gitEmail = globals.gitEmail; + mailServer = globals.mailServer; + dotfilesRepo = globals.dotfilesRepo; + gui = { + enable = true; + colorscheme = globals.gui.colorscheme; + }; nixpkgs.overlays = [ nur.overlay ]; } ../common.nix ../../modules/darwin - ../../modules/applications/1password.nix ../../modules/applications/alacritty.nix ../../modules/applications/discord.nix - ../../modules/applications/firefox.nix ../../modules/applications/obsidian.nix ]; } diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix index 2b99484..93d4f9c 100644 --- a/modules/applications/alacritty.nix +++ b/modules/applications/alacritty.nix @@ -23,7 +23,7 @@ size = 14.0; normal = { family = - builtins.head config.fonts.fontconfig.defaultFonts.monospace; + builtins.head (if pkgs.stdenv.isDarwin then config.fonts.fonts else config.fonts.fontconfig.defaultFonts.monospace); }; }; key_bindings = [ diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 636bc24..cb9a56b 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -1,5 +1,27 @@ -{ ... }: { +{ lib, ... }: { imports = [ ./system.nix ./tmux.nix ./utilities.nix ./hammerspoon.nix ]; + + options = with lib; { + + user = mkOption { + type = types.str; + description = "Primary user of the system"; + }; + + gui = { + enable = mkEnableOption { + description = "Enable graphics"; + default = false; + }; + + colorscheme = mkOption { + type = types.attrs; + description = "Base16 color scheme"; + }; + + }; + }; + } diff --git a/modules/darwin/homebrew.nix b/modules/darwin/homebrew.nix index af99db8..45871d4 100644 --- a/modules/darwin/homebrew.nix +++ b/modules/darwin/homebrew.nix @@ -11,6 +11,8 @@ "trash" # Delete files and folders to trash instead of rm ]; casks = [ + "firefox" # Firefox packaging on Nix is broken for MacOS + "1password" # 1Password packaging on Nix is broken for MacOS "scroll-reverser" # Different scroll style for mouse vs. trackpad "meetingbar" # Show meetings in menu bar "gitify" # Git notifications in menu bar diff --git a/modules/darwin/system.nix b/modules/darwin/system.nix index 2fc3f42..c34a69e 100644 --- a/modules/darwin/system.nix +++ b/modules/darwin/system.nix @@ -14,7 +14,7 @@ AppleInterfaceStyle = "Dark"; # Don't change from dark to light automatically - AppleInterfaceSwitchesAutomatically = false; + # AppleInterfaceSwitchesAutomatically = false; # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) AppleKeyboardUIMode = 3; diff --git a/modules/darwin/utilities.nix b/modules/darwin/utilities.nix index 9b3c9eb..85770c7 100644 --- a/modules/darwin/utilities.nix +++ b/modules/darwin/utilities.nix @@ -2,7 +2,7 @@ home-manager.users.${config.user} = { - home.packages = [ + home.packages = with pkgs; [ visidata # CSV inspector dos2unix # Convert Windows text files inetutils # Includes telnet @@ -32,9 +32,11 @@ ]; }; - fonts.fonts = with pkgs; - [ (nerdfonts.override { fonts = [ "fira-mono" ]; }) ]; - }; + + fonts.fonts = with pkgs; + [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) ]; + + } diff --git a/modules/mail/himalaya.nix b/modules/mail/himalaya.nix index f8f91a7..80497d4 100644 --- a/modules/mail/himalaya.nix +++ b/modules/mail/himalaya.nix @@ -13,7 +13,7 @@ programs.himalaya = { enable = true; }; programs.mbsync = { enable = true; }; - services.mbsync = { + services.mbsync = lib.mkIf pkgs.stdenv.isLinux { enable = true; frequency = "*:0/5"; }; @@ -39,7 +39,7 @@ himalaya = { enable = true; settings = { - downloads-dir = config.userDirs.download; + downloads-dir = if pkgs.stdenv.isDarwin then "$HOME/Downloads" else config.userDirs.download; smtp-insecure = true; }; };