From b48c9aef123b633e0aed86c950bc83fc87ee31c3 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 13 Jun 2022 23:43:49 -0400 Subject: [PATCH] add macos applications --- hosts/common.nix | 11 +--- hosts/desktop/default.nix | 5 ++ hosts/macbook/default.nix | 8 ++- modules/applications/1password.nix | 1 + modules/applications/default.nix | 1 + modules/applications/obsidian.nix | 10 ++++ modules/darwin/utilities.nix | 94 ++++++++++++++++++++++++++++++ 7 files changed, 118 insertions(+), 12 deletions(-) create mode 100644 modules/applications/obsidian.nix create mode 100644 modules/darwin/utilities.nix diff --git a/hosts/common.nix b/hosts/common.nix index 44b8e57..ac70515 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,15 +1,6 @@ { config, lib, pkgs, ... }: { - imports = [ - ../modules/hardware - ../modules/system - ../modules/graphical - ../modules/shell - ../modules/gaming - ../modules/applications - ../modules/editor - ../modules/mail/himalaya.nix - ]; + imports = [ ../modules/shell ../modules/editor ../modules/mail/himalaya.nix ]; options = with lib; { dotfilesPath = mkOption { diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index a836c4b..8e5072a 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -18,6 +18,11 @@ nixpkgs.lib.nixosSystem { } ./hardware-configuration.nix ../common.nix + ../../modules/hardware + ../../modules/system + ../../modules/graphical + ../../modules/gaming + ../../modules/applications ../../modules/services/keybase.nix ../../modules/services/gnupg.nix ../../modules/services/mullvad.nix diff --git a/hosts/macbook/default.nix b/hosts/macbook/default.nix index 2dbe287..0c48124 100644 --- a/hosts/macbook/default.nix +++ b/hosts/macbook/default.nix @@ -8,11 +8,15 @@ darwin.lib.darwinSystem { globals home-manager.darwinModules.home-manager { - networking.hostName = "desktop"; gui.enable = true; - gui.compositor.enable = true; 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/1password.nix b/modules/applications/1password.nix index 51e533a..e57f90b 100644 --- a/modules/applications/1password.nix +++ b/modules/applications/1password.nix @@ -6,4 +6,5 @@ home.packages = with pkgs; [ _1password-gui ]; }; }; + } diff --git a/modules/applications/default.nix b/modules/applications/default.nix index fd83017..6d0ca0a 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -7,6 +7,7 @@ ./discord.nix ./firefox.nix ./media.nix + ./obsidian.nix ./qbittorrent.nix ./nautilus.nix ]; diff --git a/modules/applications/obsidian.nix b/modules/applications/obsidian.nix new file mode 100644 index 0000000..7f18e12 --- /dev/null +++ b/modules/applications/obsidian.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: { + + config = lib.mkIf config.gui.enable { + unfreePackages = [ "obsidian" ]; + home-manager.users.${config.user} = { + home.packages = with pkgs; [ obsidian ]; + }; + }; + +} diff --git a/modules/darwin/utilities.nix b/modules/darwin/utilities.nix new file mode 100644 index 0000000..b915431 --- /dev/null +++ b/modules/darwin/utilities.nix @@ -0,0 +1,94 @@ +{ pkgs, ... }: { + + home-manager.users.${config.user} = { + + programs.tmux = { + enable = true; + baseIndex = 1; # Start windows and panes at 1 + escapeTime = 0; # Wait time after escape is input + historyLimit = 100000; + keyMode = "vi"; + newSession = true; # Automatically spawn new session + plugins = [ ]; + resizeAmount = 10; + shell = "${pkgs.fish}/bin/fish"; + terminal = "screen-256color"; + extraConfig = '' + # Horizontal and vertical splits + bind \\ split-window -h -c '#{pane_current_path}' + bind - split-window -v -c '#{pane_current_path}' + + # Move between panes with vi keys + bind h select-pane -L + bind j select-pane -D + bind K select-pane -U + bind l select-pane -R + + # Split out pane + bind b break-pane + + # Synchronize panes + bind S set-window-option synchronize-panes + + # Copy mode works as Vim + bind Escape copy-mode + bind k copy-mode + bind C-[ copy-mode + + # Use v to trigger selection + bind-key -T copy-mode-vi v send-keys -X begin-selection + + # Use y to yank current selection + bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + + # Enable mouse mode + set -g mouse on + + # Status bar + set -g status-interval 60 # Seconds between refreshes + set -g renumber-windows on + set-option -g status-position bottom + ''; + }; + + home.packages = [ + visidata # CSV inspector + dos2unix # Convert Windows text files + inetutils # Includes telnet + youtube-dl # Convert web videos + pandoc # Convert text documents + mpd # TUI slideshows + awscli2 + awslogs + kubectl + k9s + noti # Create notifications programmatically + ]; + + fonts.fonts = with pkgs; + [ (nerdfonts.override { fonts = [ "fira-mono" ]; }) ]; + + }; + + homebrew = { + enable = true; + autoUpdate = false; # Don't update during rebuild + cleanup = "zap"; # Uninstall all programs not declared + taps = [ + "homebrew/cask-drivers" # Used for Logitech G-Hub + ]; + brews = [ + "trash" # Delete to trash instead of rm + ]; + casks = [ + "scroll-reverser" # Different scroll style for mouse vs. trackpad + "meetingbar" # Show meetings in menu bar + "gitify" # Git notifications in menu bar + "hammerspoon" # MacOS custom automation scripting + "logitech-g-hub" # Mouse and keyboard management + ]; + global.brewfile = true; + global.nolock = true; + }; + +}