From c8d7224dc973f37060b867a182ea9e358802a12a Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 22 Sep 2023 19:37:24 +0300 Subject: [PATCH] Navigate mini.files with enter! --- common/themes/default.nix | 4 ++-- dotfiles/neovim/lua/my/helpers/string.lua | 13 +++++++++++++ dotfiles/neovim/lua/my/plugins/dashboard.lua | 4 +++- dotfiles/neovim/lua/my/plugins/mini-files.lua | 4 +++- home/features/cli/git.nix | 14 +++++++++++--- hosts/nixos/tethys/default.nix | 10 +++++++++- hosts/nixos/tethys/hardware/generated.nix | 12 +++++++----- 7 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 dotfiles/neovim/lua/my/helpers/string.lua diff --git a/common/themes/default.nix b/common/themes/default.nix index 58a8212..4bccea8 100644 --- a/common/themes/default.nix +++ b/common/themes/default.nix @@ -13,7 +13,7 @@ let catppuccin-latte = { stylix = { - image = ./wallpapers/needygirloverdose.jpg; + image = ./wallpapers/watercag.png; base16Scheme = "${inputs.catppuccin-base16}/base16/latte.yaml"; polarity = "light"; }; @@ -85,7 +85,7 @@ let }; # Select your current theme here! - currentTheme = themes.catppuccin-macchiato; + currentTheme = themes.catppuccin-latte; in { # We apply the current theme here. diff --git a/dotfiles/neovim/lua/my/helpers/string.lua b/dotfiles/neovim/lua/my/helpers/string.lua new file mode 100644 index 0000000..fbd9dd9 --- /dev/null +++ b/dotfiles/neovim/lua/my/helpers/string.lua @@ -0,0 +1,13 @@ +local M = {} + +function M.split(text, sep) + ---@diagnostic disable-next-line: redefined-local + local sep, fields = sep or ":", {} + local pattern = string.format("([^%s]+)", sep) + text:gsub(pattern, function(c) + fields[#fields + 1] = c + end) + return fields +end + +return M diff --git a/dotfiles/neovim/lua/my/plugins/dashboard.lua b/dotfiles/neovim/lua/my/plugins/dashboard.lua index 03065f1..8439929 100644 --- a/dotfiles/neovim/lua/my/plugins/dashboard.lua +++ b/dotfiles/neovim/lua/my/plugins/dashboard.lua @@ -1,6 +1,6 @@ local env = require("my.helpers.env") -local header = [[ +local header_string = [[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ██████╗ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ██╗╚════██╗ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ╚═╝ █████╔╝ @@ -9,6 +9,8 @@ local header = [[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ]] +local header = require("my.helpers.string").split(header_string, "\n") + local M = { "goolord/alpha-nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, diff --git a/dotfiles/neovim/lua/my/plugins/mini-files.lua b/dotfiles/neovim/lua/my/plugins/mini-files.lua index 26b04e1..0a4504d 100644 --- a/dotfiles/neovim/lua/my/plugins/mini-files.lua +++ b/dotfiles/neovim/lua/my/plugins/mini-files.lua @@ -15,7 +15,9 @@ function M.config() windows = { preview = false, }, - mappings = {}, + mappings = { + go_in_plus = "", + }, }) K.nmap("", function() diff --git a/home/features/cli/git.nix b/home/features/cli/git.nix index d686db7..156e2e4 100644 --- a/home/features/cli/git.nix +++ b/home/features/cli/git.nix @@ -3,8 +3,6 @@ enable = true; package = pkgs.gitFull; - aliases.graph = "log --decorate --oneline --graph"; - userName = "Matei Adriel"; userEmail = "rafaeladriel11@gmail.com"; @@ -12,16 +10,26 @@ # Syncthing ".stfolder" ".stversions" + # Direnv ".direnv" + ".envrc" ]; + aliases = { + # Print history nicely + graph = "log --decorate --oneline --graph"; + + # Print last commit's hash + hash = "log -1 --format='%H'"; + }; + extraConfig = { github.user = "Mateiadrielrafael"; hub.protocol = "ssh"; core.editor = "nvim"; - rebase.autoStash = true; init.defaultBranch = "main"; + rebase.autoStash = true; # Sign commits using ssh gpg.format = "ssh"; diff --git a/hosts/nixos/tethys/default.nix b/hosts/nixos/tethys/default.nix index cfeb360..7cfca25 100644 --- a/hosts/nixos/tethys/default.nix +++ b/hosts/nixos/tethys/default.nix @@ -26,9 +26,13 @@ system.stateVersion = "22.11"; # {{{ A few ad-hoc hardware settings + hardware.enableAllFirmware = true; hardware.opengl.enable = true; hardware.opentabletdriver.enable = true; hardware.keyboard.qmk.enable = true; + powerManagement.cpuFreqGovernor = "ondemand"; + services.tlp.enable = true; + services.thermald.enable = true; # }}} # {{{ A few ad-hoc programs programs.kdeconnect.enable = true; @@ -42,7 +46,11 @@ # {{{ Some ad-hoc site blocking networking.extraHosts = let - blacklisted = [ "twitter.com" "minesweeper.online" ]; + blacklisted = [ + "twitter.com" + "www.reddit.com" + # "minesweeper.online" + ]; blacklist = lib.concatStringsSep "\n" (lib.forEach blacklisted (host: "127.0.0.1 ${host}")); in blacklist; diff --git a/hosts/nixos/tethys/hardware/generated.nix b/hosts/nixos/tethys/hardware/generated.nix index ed25357..77ccfd2 100644 --- a/hosts/nixos/tethys/hardware/generated.nix +++ b/hosts/nixos/tethys/hardware/generated.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" "sdhci_pci" ]; @@ -14,18 +15,19 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/57846041-f177-45eb-aff3-503006bac638"; + { + device = "/dev/disk/by-uuid/57846041-f177-45eb-aff3-503006bac638"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/01E6-A013"; + { + device = "/dev/disk/by-uuid/01E6-A013"; fsType = "vfat"; }; swapDevices = - [ { device = "/dev/disk/by-uuid/5cf4167c-77f4-4afe-b978-65ed5472e3d0"; } - ]; + [{ device = "/dev/disk/by-uuid/5cf4167c-77f4-4afe-b978-65ed5472e3d0"; }]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's