From dcaa733d4e9e8b9e94942f75df81d3dc0a29da11 Mon Sep 17 00:00:00 2001 From: Matthew Ess Date: Fri, 29 Jul 2022 22:15:19 -0400 Subject: [PATCH] Add work configuration --- darwin/bootstrap.nix | 5 ++-- darwin/homebrew.nix | 13 +++++++--- flake.lock | 17 +++++++++++++ flake.nix | 53 ++++++++++++++++++++++++++-------------- home/git.nix | 5 +--- home/kitty.nix | 2 +- modules/darwin/games.nix | 11 +++++++++ 7 files changed, 76 insertions(+), 30 deletions(-) create mode 100644 modules/darwin/games.nix diff --git a/darwin/bootstrap.nix b/darwin/bootstrap.nix index 540cb50..40be192 100644 --- a/darwin/bootstrap.nix +++ b/darwin/bootstrap.nix @@ -7,20 +7,19 @@ "https://hydra.iohk.io" "https://cache.iog.io" "https://nix-community.cachix.org" + "https://mat.cachix.org" ]; nix.binaryCachePublicKeys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno=" ]; nix.trustedUsers = [ "@admin" ]; users.nix.configureBuildUsers = true; - nix.buildCores = 2; - nix.maxJobs = 4; - # Enable experimental nix command and flakes nix.extraOptions = '' auto-optimise-store = true diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 1be11cc..2ce4142 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -4,6 +4,7 @@ let inherit (lib) mkIf; mkIfCaskPresent = cask: mkIf (lib.any (x: x == cask) config.homebrew.casks); brewEnabled = config.homebrew.enable; + gamesEnabled = config.games.enable; in { @@ -16,7 +17,8 @@ in # https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish # For some reason if the Fish completions are added at the end of `fish_complete_path` they don't # seem to work, but they do work if added at the start. - programs.fish.interactiveShellInit = mkIf brewEnabled '' + # programs.fish.interactiveShellInit = mkIf brewEnabled '' + programs.fish.interactiveShellInit = '' if test -d (brew --prefix)"/share/fish/completions" set -p fish_complete_path (brew --prefix)/share/fish/completions end @@ -58,21 +60,24 @@ in "alfred" "bartender" "firefox" - "gog-galaxy" "jitsi-meet" "knockknock" "lulu" + "mimestream" # "mullvadvpn" - "origin" "rectangle" "seaglass" "secretive" "signal" - "steam" "transmission" # "twitch" # "utm" # "zoom" + ] ++ lib.optionals gamesEnabled [ + # games + "gog-galaxy" + "origin" + "steam" ]; # Configuration related to casks diff --git a/flake.lock b/flake.lock index 4b8b1f0..17c4c66 100644 --- a/flake.lock +++ b/flake.lock @@ -136,6 +136,22 @@ "type": "github" } }, + "kitty-icon": { + "flake": false, + "locked": { + "lastModified": 1640552536, + "narHash": "sha256-3Jri8/y/s6/QkOBb03R9nd1gyZPGZlekhli9ShTzOxg=", + "owner": "DinkDonk", + "repo": "kitty-icon", + "rev": "b19b3969d3bdc870beeff332355f92e38dc5a704", + "type": "github" + }, + "original": { + "owner": "DinkDonk", + "repo": "kitty-icon", + "type": "github" + } + }, "luar-src": { "flake": false, "locked": { @@ -210,6 +226,7 @@ "home-manager": "home-manager", "homebrew-enabled": "homebrew-enabled", "kakoune-sudo-write-src": "kakoune-sudo-write-src", + "kitty-icon": "kitty-icon", "luar-src": "luar-src", "nixpkgs": "nixpkgs", "nixpkgs-master": "nixpkgs-master", diff --git a/flake.nix b/flake.nix index ac7090c..3702898 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,10 @@ url = github:occivink/kakoune-sudo-write; flake = false; }; + kitty-icon = { + url = github:DinkDonk/kitty-icon; + flake = false; + }; }; outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs: @@ -130,6 +134,34 @@ networking.knownNetworkServices = [ "Wi-Fi" ]; + nix.buildCores = 2; + nix.maxJobs = 4; + + games.enable = true; + home-manager.sharedModules = [{ + programs.git.userEmail = "mat@mat.services"; + programs.git.userName = "mat ess"; + }]; + } + ]; + }; + + yelpbook-m1 = darwinSystem { + system = "aarch64-darwin"; + modules = nixDarwinCommonModules ++ [ + { + users.primaryUser = "mess"; + networking.knownNetworkServices = [ + "Wi-Fi" + ]; + nix.buildCores = 2; + nix.maxJobs = 5; + + games.enable = false; + home-manager.sharedModules = [{ + programs.git.userEmail = "mess@yelp.com"; + programs.git.userName = "Matthew Ess"; + }]; } ]; }; @@ -156,21 +188,6 @@ nixpkgs = nixpkgsConfig; }; }; - - # attrValues self.darwinModules ++ [ - # # Main `nix-darwin` config - # ./configuration.nix - # # `home-manager` module - # home-manager.darwinModules.home-manager - # { - # nixpkgs = nixpkgsConfig; - # # `home-manager` config - # home-manager.useGlobalPkgs = true; - # home-manager.useUserPackages = true; - # home-manager.users.mat = import ./home.nix; - # } - # ]; - # }; }; # Overlays --------------------------------------------------------------- {{{ @@ -210,9 +227,8 @@ }; patched = final: prev: optionalAttrs prev.stdenv.isDarwin { - lib = prev.lib // { - homebrew-enabled = inputs.homebrew-enabled.value; - }; + inherit (inputs) kitty-icon; + lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; }; kakounePlugins = prev.kakounePlugins // { auto-pairs-kak = prev.kakounePlugins.auto-pairs-kak.overrideAttrs (attrs: { src = inputs.auto-pairs-kak-src; @@ -223,6 +239,7 @@ # `nix-darwin` modules (some are pending upstream acceptance) darwinModules = { + games = import ./modules/darwin/games.nix; programs-nix-index = import ./modules/darwin/programs/nix-index.nix; security-pam = import ./modules/darwin/security/pam.nix; users = import ./modules/darwin/users.nix; diff --git a/home/git.nix b/home/git.nix index e2dee13..01e7554 100644 --- a/home/git.nix +++ b/home/git.nix @@ -7,7 +7,7 @@ programs.git.enable = true; programs.git.extraConfig = { - core.editor = "${pkgs.neovim-remote}/bin/nvr --remote-wait-silent -cc split"; + # core.editor = "${pkgs.neovim-remote}/bin/nvr --remote-wait-silent -cc split"; diff.colorMoved = "default"; pull.rebase = true; init.defaultBranch = "main"; @@ -17,9 +17,6 @@ ".DS_Store" ]; - programs.git.userEmail = "mat@mat.services"; - programs.git.userName = "mat ess"; - # Enhanced diffs programs.git.delta.enable = true; diff --git a/home/kitty.nix b/home/kitty.nix index 5688e46..fbcacc8 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -114,6 +114,6 @@ in programs.kitty.extras.fixIcon = { enable = true; appPath = "~/Applications/Home\\ Manager\\ Apps/kitty.app"; - iconPath = "~/Development/kitty-icon/kitty-dark.icns"; + iconPath = "${pkgs.kitty-icon}/kitty-dark.icns"; }; } diff --git a/modules/darwin/games.nix b/modules/darwin/games.nix new file mode 100644 index 0000000..d3e27b1 --- /dev/null +++ b/modules/darwin/games.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + +let + inherit (lib) mkEnableOption; +in + +{ + options = { + games.enable = mkEnableOption "Enable games (managed by homebrew)"; + }; +}