From 7ce0b53808b21e9e27ee7e1468f50fe8c1939c24 Mon Sep 17 00:00:00 2001 From: mat ess Date: Sun, 24 Jul 2022 15:55:26 -0400 Subject: [PATCH] Add flag to control homebrew, get rid of kakoune.cr --- darwin/homebrew.nix | 2 +- flake.lock | 50 +++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++------ home/kakoune.nix | 10 +++++++-- 4 files changed, 75 insertions(+), 9 deletions(-) diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 4d81f83..140352b 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -23,7 +23,7 @@ in end ''; - homebrew.enable = true; + homebrew.enable = pkgs.lib.homebrew-enabled; homebrew.autoUpdate = true; homebrew.cleanup = "zap"; homebrew.global.brewfile = true; diff --git a/flake.lock b/flake.lock index 50de1ed..747b911 100644 --- a/flake.lock +++ b/flake.lock @@ -89,6 +89,53 @@ "type": "github" } }, + "homebrew-enabled": { + "locked": { + "lastModified": 1657739253, + "narHash": "sha256-L9eyTL7njtPBUYmZRYFKCzQFDgua9U9oE7UwCzjZfl8=", + "owner": "boolean-option", + "repo": "true", + "rev": "6ecb49143ca31b140a5273f1575746ba93c3f698", + "type": "github" + }, + "original": { + "owner": "boolean-option", + "repo": "true", + "type": "github" + } + }, + "kakoune-cr-src": { + "flake": false, + "locked": { + "lastModified": 1651502437, + "narHash": "sha256-9sYqDWWnvoNpSYDBsMU6mV8AKLOwgolhzskD2sL7X+Q=", + "owner": "alexherbo2", + "repo": "kakoune.cr", + "rev": "d2b59774382328343cb4e6336f371e15d2a84b96", + "type": "github" + }, + "original": { + "owner": "alexherbo2", + "repo": "kakoune.cr", + "type": "github" + } + }, + "kitty-themes-src": { + "flake": false, + "locked": { + "lastModified": 1654224633, + "narHash": "sha256-SM7ExyD6cCYXZwxb4Rs1U2P2N9vzhmaUHJJRz/gO3IQ=", + "owner": "kovidgoyal", + "repo": "kitty-themes", + "rev": "f6c2f4e5617ef946b17db8bc18dadc9fad38d32e", + "type": "github" + }, + "original": { + "owner": "kovidgoyal", + "repo": "kitty-themes", + "type": "github" + } + }, "luar-src": { "flake": false, "locked": { @@ -160,6 +207,9 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils", "home-manager": "home-manager", + "homebrew-enabled": "homebrew-enabled", + "kakoune-cr-src": "kakoune-cr-src", + "kitty-themes-src": "kitty-themes-src", "luar-src": "luar-src", "nixpkgs": "nixpkgs", "nixpkgs-master": "nixpkgs-master", diff --git a/flake.nix b/flake.nix index 79c7c11..e9e9322 100644 --- a/flake.nix +++ b/flake.nix @@ -13,27 +13,31 @@ home-manager.url = github:nix-community/home-manager; home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable"; + # Config "flag" for disabling homebrew + homebrew-enabled.url = github:boolean-option/true; + # Other sources flake-utils.url = github:numtide/flake-utils; flake-compat = { url = github:edolstra/flake-compat; flake = false; }; - dark-mode-notify-src = { url = github:bouk/dark-mode-notify; flake = false; }; - luar-src = { url = github:gustavo-hms/luar; flake = false; }; - smarttab-kak-src = { url = github:andreyorst/smarttab.kak; flake = false; }; + kitty-themes-src = { + url = github:kovidgoyal/kitty-themes; + flake = false; + }; }; outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs: @@ -59,8 +63,7 @@ inherit (final) callPackage; }; in - pkgs // optionalAttrs - (prev.stdenv.system == "aarch64-darwin") + pkgs // optionalAttrs (prev.stdenv.system == "aarch64-darwin") { # Sub in x86 version of packages that don't build on Apple Silicon yet inherit (final.pkgs-x86); @@ -201,6 +204,12 @@ inherit (nixpkgsConfig) config; }; }; + + patched = final: prev: optionalAttrs prev.stdenv.isDarwin { + lib = prev.lib // { + homebrew-enabled = inputs.homebrew-enabled.value; + }; + }; }; # `nix-darwin` modules (some are pending upstream acceptance) @@ -215,7 +224,7 @@ # configs-git-aliases = import ./home/configs/git-aliases.nix; # configs-gh-aliases = import ./home/configs/gh-aliases.nix; configs-starship-symbols = import ./home/configs/starship-symbols.nix; - programs-neovim-extras = import ./modules/home/programs/neovim/extras.nix; + # programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix; }; @@ -228,6 +237,7 @@ pkgs-stable colors apple-silicon + patched ]; }; }); diff --git a/home/kakoune.nix b/home/kakoune.nix index 902cb17..b087c57 100644 --- a/home/kakoune.nix +++ b/home/kakoune.nix @@ -1,14 +1,17 @@ { pkgs, ... }: { - home.packages = [ pkgs.kak-lsp ]; + home.packages = with pkgs; [ + kak-lsp + ]; programs.kakoune = { enable = true; config = { autoReload = "yes"; - colorScheme = "tokyonight"; + # colorScheme = "tokyonight"; hooks = [ + # smarttab hooks { name = "BufOpenFile"; option = ".*"; @@ -31,6 +34,7 @@ set-option global softtabstop %opt{indentwidth} ''; } + # lsp hooks { name = "WinSetOption"; option = "filetype=(haskell)"; @@ -38,6 +42,7 @@ lsp-enable-window ''; } + # general hooks { name = "WinSetOption"; option = "filetype=(haskell|nix)"; @@ -91,6 +96,7 @@ plugins = with pkgs.kakounePlugins; [ active-window-kak auto-pairs-kak + connect-kak fzf-kak kak-lsp kakboard