From 20c4d88b46dea59224f066f3e5902fd2550dc46f Mon Sep 17 00:00:00 2001 From: mat ess Date: Sat, 17 Sep 2022 19:02:51 -0400 Subject: [PATCH] Clean up --- flake.lock | 70 +----- flake.nix | 53 ++-- {darwin => home}/dark-mode-notify-service.nix | 3 +- home/kakoune.nix | 231 ------------------ modules/home/programs/kakoune/extras.nix | 2 + pkgs/default.nix | 18 +- pkgs/kakoune-sudo-write.nix | 8 - pkgs/luar.nix | 9 - pkgs/smarttab-kak.nix | 8 - 9 files changed, 21 insertions(+), 381 deletions(-) rename {darwin => home}/dark-mode-notify-service.nix (94%) delete mode 100644 home/kakoune.nix delete mode 100644 pkgs/kakoune-sudo-write.nix delete mode 100644 pkgs/luar.nix delete mode 100644 pkgs/smarttab-kak.nix diff --git a/flake.lock b/flake.lock index b161dfc..bf350a6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "auto-pairs-kak-src": { - "flake": false, - "locked": { - "lastModified": 1647175978, - "narHash": "sha256-MgqCuGj03ctKty2yQgQvy6qV/0s7euNwukhSjqauqW8=", - "owner": "alexherbo2", - "repo": "auto-pairs.kak", - "rev": "bfdcb8566076f653ec707f86207f83ea75173ce9", - "type": "github" - }, - "original": { - "owner": "alexherbo2", - "repo": "auto-pairs.kak", - "type": "github" - } - }, "crane": { "flake": false, "locked": { @@ -252,22 +236,6 @@ "type": "github" } }, - "kakoune-sudo-write-src": { - "flake": false, - "locked": { - "lastModified": 1629101282, - "narHash": "sha256-O+yw8upyYnQThDoWKnFbjrjthPTCm6EaBUoJNqpUPLA=", - "owner": "occivink", - "repo": "kakoune-sudo-write", - "rev": "ec0d6d26ceaadd93d6824630ba587b31e442214d", - "type": "github" - }, - "original": { - "owner": "occivink", - "repo": "kakoune-sudo-write", - "type": "github" - } - }, "kitty-icon": { "flake": false, "locked": { @@ -284,22 +252,6 @@ "type": "github" } }, - "luar-src": { - "flake": false, - "locked": { - "lastModified": 1644781788, - "narHash": "sha256-vHn/V3sfzaxaxF8OpA5jPEuPstOVwOiQrogdSGtT6X4=", - "owner": "gustavo-hms", - "repo": "luar", - "rev": "2f430316f8fc4d35db6c93165e2e77dc9f3d0450", - "type": "github" - }, - "original": { - "owner": "gustavo-hms", - "repo": "luar", - "type": "github" - } - }, "nixCargoIntegration": { "inputs": { "devshell": "devshell", @@ -377,7 +329,6 @@ }, "root": { "inputs": { - "auto-pairs-kak-src": "auto-pairs-kak-src", "dark-mode-notify-src": "dark-mode-notify-src", "darwin": "darwin", "flake-compat": "flake-compat", @@ -385,13 +336,10 @@ "helix": "helix", "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", - "nixpkgs-unstable": "nixpkgs-unstable", - "smarttab-kak-src": "smarttab-kak-src" + "nixpkgs-unstable": "nixpkgs-unstable" } }, "rust-overlay": { @@ -416,22 +364,6 @@ "type": "github" } }, - "smarttab-kak-src": { - "flake": false, - "locked": { - "lastModified": 1649581983, - "narHash": "sha256-STLZSwQPM+gTnkA+FQOF4I0ifPTjQWpEc/95JRzvIqU=", - "owner": "andreyorst", - "repo": "smarttab.kak", - "rev": "86ac6599b13617ff938905ba4cdd8225d7eb6a2e", - "type": "github" - }, - "original": { - "owner": "andreyorst", - "repo": "smarttab.kak", - "type": "github" - } - }, "utils": { "locked": { "lastModified": 1653893745, diff --git a/flake.nix b/flake.nix index 3739a59..ac57b40 100644 --- a/flake.nix +++ b/flake.nix @@ -16,48 +16,27 @@ # Config "flag" for disabling homebrew homebrew-enabled.url = "github:boolean-option/true"; - # Other sources + # Flake helpers flake-utils.url = "github:numtide/flake-utils"; flake-utils.inputs.nixpkgs.follows = "nixpkgs-unstable"; + flake-compat.url = "github:edolstra/flake-compat"; + flake-compat.flake = false; + + # Extra sources helix.url = "github:helix-editor/helix"; helix.inputs.nixpkgs.follows = "nixpkgs-unstable"; - 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; - }; - auto-pairs-kak-src = { - url = "github:alexherbo2/auto-pairs.kak"; - flake = false; - }; - kakoune-sudo-write-src = { - url = "github:occivink/kakoune-sudo-write"; - flake = false; - }; - kitty-icon = { - url = "github:DinkDonk/kitty-icon"; - flake = false; - }; + dark-mode-notify-src.url = "github:bouk/dark-mode-notify"; + dark-mode-notify-src.flake = false; + kitty-icon.url = "github:DinkDonk/kitty-icon"; + kitty-icon.flake = false; }; - outputs = { self, darwin, nixpkgs, home-manager, flake-utils, ... }@inputs: + outputs = { self, darwin, home-manager, flake-utils, ... }@inputs: let inherit (darwin.lib) darwinSystem; inherit (inputs.nixpkgs-unstable.lib) attrValues - genAttrs makeOverridable optionalAttrs; @@ -67,7 +46,7 @@ overlays = attrValues self.overlays ++ [ (final: prev: import ./pkgs { - inherit inputs genAttrs; + inherit inputs; inherit (final) callPackage; inherit (final.stdenv) system; }) @@ -277,11 +256,6 @@ patched = final: prev: optionalAttrs prev.stdenv.isDarwin { 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; - }); - }; }; }; @@ -303,15 +277,16 @@ # configs configs-starship-symbols = import ./home/configs/starship-symbols.nix; copyApplications = import ./home/copyApplications.nix; + dark-mode-notify-service = import ./home/dark-mode-notify-service.nix; files = import ./home/files.nix; fish = import ./home/fish.nix; git = import ./home/git.nix; - kakoune = import ./home/kakoune.nix; kitty = import ./home/kitty.nix; programs = import ./home/programs.nix; starship = import ./home/starship.nix; # modules - programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; + # TODO: migrate to helix + # programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix; home-primary-user = { lib, ... }: { options.home.primaryUser = diff --git a/darwin/dark-mode-notify-service.nix b/home/dark-mode-notify-service.nix similarity index 94% rename from darwin/dark-mode-notify-service.nix rename to home/dark-mode-notify-service.nix index 04b2c1d..5748e20 100644 --- a/darwin/dark-mode-notify-service.nix +++ b/home/dark-mode-notify-service.nix @@ -1,7 +1,6 @@ -{ +{ pkgs, ... }: { # dark-mode-notify configuration # {{{ - launchd.enable = true; launchd.agents.dark-mode-notify = { enable = true; config = { diff --git a/home/kakoune.nix b/home/kakoune.nix deleted file mode 100644 index be3e730..0000000 --- a/home/kakoune.nix +++ /dev/null @@ -1,231 +0,0 @@ -{ pkgs, ... }: - -let - colorsToKakoune = colors: with colors; { - attribute = magenta; - builtin = cyan; - comment = comment; - documentation = comment; - enum = red; - function = blue; - keyword = magenta; - meta = foreground; - module = blue; - operator = magenta; - parameter = yellow; - string = green; - type = magenta; - value = orange; - variable = white; - block = blue; - bullet = comment; - header = blue; - link = cyan; - list = foreground; - mono = foreground; - title = white; - BufferPadding = [ background background ]; - Default = [ foreground background ]; - PrimarySelection = [ "default" "!${magenta}40" ]; - SecondarySelection = [ "default" "!${green}40" ]; - PrimaryCursor = [ "default" "!${blue}80" ]; - SecondaryCursor = [ "default" "!${green}80" ]; - PrimaryCursorEol = [ "default" "!${red}80" ]; - SecondaryCursorEol = [ "default" "!${orange}80" ]; - LineNumbers = comment; - LineNumberCursor = orange; - LineNumbersWrapped = [ background background ]; - MenuForeground = [ active_tab_foreground active_tab_background ]; - MenuBackground = [ inactive_tab_foreground inactive_tab_background ]; - MenuInfo = green; - Information = [ inactive_tab_foreground inactive_tab_background ]; - Error = red; - StatusLine = [ active_tab_foreground "${active_tab_background}+b" ]; - StatusLineMode = orange; - StatusLineInfo = blue; - StatusLineValue = foreground; - StatusCursor = [ "default" "!${blue}80" ]; - Prompt = yellow; - MatchingChar = [ "default" comment ]; - Whitespace = comment; - InfoDefault = "Information"; - InfoBlock = "block"; - InfoBlockQuote = "quote"; - InfoBullet = "bullet"; - InfoHeader = "header"; - InfoLink = "link"; - InfoLinkMono = "header"; - InfoMono = "mono"; - InfoRule = "comment"; - InfoDiagnosticError = "InlayDiagnosticError"; - InfoDiagnosticHint = "InlayDiagnosticHint"; - InfoDiagnosticInformation = "InlayDiagnosticInfo"; - InfoDiagnosticWarning = "InlayDiagnosticWarning"; - }; - -in - -{ - home.packages = with pkgs; [ - kak-lsp - ]; - programs.kakoune = { - enable = true; - - extras.colors.enable = true; - extras.colors.dark = colorsToKakoune pkgs.lib.colors.tokyonight.dark; - extras.colors.light = colorsToKakoune pkgs.lib.colors.tokyonight.light; - - config = { - autoReload = "yes"; - - hooks = [ - # smarttab hooks - { - name = "BufOpenFile"; - option = ".*"; - commands = "expandtab"; - } - { - name = "BufNewFile"; - option = ".*"; - commands = "expandtab"; - } - { - name = "WinSetOption"; - option = "filetype=(makefile)"; - commands = "noexpandtab"; - } - { - name = "ModuleLoaded"; - option = "smarttab"; - commands = '' - set-option global softtabstop %opt{indentwidth} - ''; - } - # lsp hooks - { - name = "WinSetOption"; - option = "filetype=(none)"; - commands = '' - lsp-enable-window - lsp-auto-hover-enable - ''; - } - # general hooks - { - name = "WinSetOption"; - option = "filetype=(haskell|nix)"; - commands = '' - set-option window indentwidth 2 - ''; - } - { - name = "WinCreate"; - option = ".*"; - commands = '' - kakboard-enable - ''; - } - ]; - - indentWidth = 4; - - keyMappings = [ - { - key = ""; - effect = ": fzf-mode"; - mode = "normal"; - docstring = "Open fzf-mode with ctrl-alt-p"; - } - { - key = ""; - effect = ": fzf-modef"; - mode = "normal"; - docstring = "Open fzf-mode file dialog with ctrl-p"; - } - { - key = ""; - effect = ": fzf-modeb"; - mode = "normal"; - docstring = "Open fzf-mode buffer dialog with ctrl-b"; - } - { - key = "v"; - effect = ": vertical-selection-down"; - mode = "user"; - docstring = "Extend vertical selection down"; - } - { - key = ""; - effect = ": vertical-selection-up"; - mode = "user"; - docstring = "Extend vertical selection up"; - } - { - key = "V"; - effect = ": vertical-selection-up-and-down"; - mode = "user"; - docstring = "Extend vertical selection both up and down"; - } - ]; - - numberLines.enable = true; - numberLines.highlightCursor = true; - numberLines.relative = true; - - scrollOff.columns = 4; - scrollOff.lines = 2; - - showMatching = true; - - showWhitespace.enable = true; - showWhitespace.space = " "; - - ui.assistant = "cat"; - ui.enableMouse = true; - - wrapLines.enable = true; - wrapLines.indent = true; - wrapLines.marker = "⏎"; - wrapLines.word = true; - }; - - extraConfig = '' - eval %sh{${pkgs.kak-lsp}/bin/kak-lsp --kakoune -s $kak_session} - enable-auto-pairs - alias global w!! sudo-write - ''; - - plugins = with pkgs.kakounePlugins; [ - active-window-kak - auto-pairs-kak - connect-kak - fzf-kak - kak-lsp - kakboard - kakoune-state-save - kakoune-vertical-selection - pkgs.smarttab-kak - pkgs.kakoune-sudo-write - # disabled, tabs-kak tries to load before luar for some reason - # pkgs.luar - # tabs-kak - ]; - }; - programs.fish.functions.set-kak-colors = { - body = '' - if test "$term_background" = light - kak-light - else - kak-dark - end - ''; - onVariable = "term_background"; - }; - programs.fish.shellAliases = { - vi = "kak"; - vim = "kak"; - nvim = "kak"; - }; -} diff --git a/modules/home/programs/kakoune/extras.nix b/modules/home/programs/kakoune/extras.nix index f7f334d..7893b18 100644 --- a/modules/home/programs/kakoune/extras.nix +++ b/modules/home/programs/kakoune/extras.nix @@ -1,3 +1,5 @@ +# TODO: migrate this to helix + { config, lib, pkgs, ... }: with lib; diff --git a/pkgs/default.nix b/pkgs/default.nix index 91e8b2b..1348512 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,17 +1,5 @@ -{ callPackage, inputs, genAttrs, system }: -let - buildPkg = name: - callPackage - (./. + "/${name}.nix") - { "${name}-src" = inputs."${name}-src"; }; - pkgs = [ - "dark-mode-notify" - "luar" - "smarttab-kak" - "kakoune-sudo-write" - "yubiswitch" - ]; -in -genAttrs pkgs buildPkg // { +{ callPackage, inputs, system }: +{ + dark-mode-notify = callPackage ./dark-mode-notify.nix { inherit (inputs) dark-mode-notify-src; }; helix = inputs.helix.packages.${system}.default; } diff --git a/pkgs/kakoune-sudo-write.nix b/pkgs/kakoune-sudo-write.nix deleted file mode 100644 index 98485d7..0000000 --- a/pkgs/kakoune-sudo-write.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ kakouneUtils, kakoune-sudo-write-src, ... }: - -with kakouneUtils; - -buildKakounePlugin { - name = "kakoune-sudo-write"; - src = kakoune-sudo-write-src; -} diff --git a/pkgs/luar.nix b/pkgs/luar.nix deleted file mode 100644 index 4ec95f0..0000000 --- a/pkgs/luar.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ kakouneUtils, luar-src, lua, ... }: - -with kakouneUtils; - -buildKakounePlugin { - name = "luar"; - src = luar-src; - buildInputs = [ lua ]; -} diff --git a/pkgs/smarttab-kak.nix b/pkgs/smarttab-kak.nix deleted file mode 100644 index b783f8e..0000000 --- a/pkgs/smarttab-kak.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ kakouneUtils, smarttab-kak-src, ... }: - -with kakouneUtils; - -buildKakounePlugin { - name = "smarttab"; - src = smarttab-kak-src; -}