Skip to content

Commit

Permalink
Merge pull request #74 from sbulav/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sbulav authored Dec 5, 2023
2 parents 772b139 + 29f4e8d commit 68e024e
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nvim/.netrwhist
nvim/plugin/
.DS_Store
nix/home-manager/desktop/hypr/hyprpaper.conf
4 changes: 4 additions & 0 deletions fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ set -a PATH "$HOME/bin/" "$HOME/.local/bin" "/opt/homebrew/bin" "$HOME/./go/bin/

# Initialize FZF keybindings
fzf_key_bindings
if status --is-interactive;
atuin init fish --disable-up-arrow | source
end


# Set terminal
set -g TERM screen-256color
Expand Down
4 changes: 2 additions & 2 deletions fish/functions/fzf_key_bindings.fish
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ function fzf_key_bindings
end

bind \ct fzf-file-widget
bind \cr fzf-history-widget
# bind \cr fzf-history-widget
bind \ec fzf-cd-widget

if bind -M insert > /dev/null 2>&1
bind -M insert \ct fzf-file-widget
bind -M insert \cr fzf-history-widget
# bind -M insert \cr fzf-history-widget
bind -M insert \ec fzf-cd-widget
end

Expand Down
4 changes: 2 additions & 2 deletions fish/functions/load_keys.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function load_keys --description 'Load keys from .ssh folder starting with id_rsa'
function load_keys --description 'Load keys from .ssh folder starting with id_'
if status --is-login
for key in (ls $HOME/.ssh/id_rsa* | grep -v pub)
for key in (ls $HOME/.ssh/id_* | grep -v pub)
ssh-add -q $key
end
end
Expand Down
4 changes: 3 additions & 1 deletion lf/lfrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ cmd trash ${{
gio trash "$fx"
else
mkdir -p /tmp/trash
mv -- "$fx" /tmp/trash
echo "$fx" | while read line; do
mv -- "$line" /tmp/trash
done
fi
}}

Expand Down
2 changes: 1 addition & 1 deletion nix/darwin/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ in {
home.packages = pkgs.callPackage ./packages.nix {};

home.stateVersion = "23.05";
# programs = {} // import ../shared/home-manager.nix {inherit config pkgs lib;};
programs = import ../shared/home-manager.nix {inherit config pkgs lib;};
};
};
}
30 changes: 15 additions & 15 deletions nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions nix/home-manager/desktop/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ bind = , XF86MonBrightnessDown, exec, brightnessctl s 5%-

bind = $mainMod, C, exec, copyq menu
bind = $mainMod SHIFT, C, exec, copyq show

bind = ,Print, exec, grim -g "$(slurp)"
bind = SHIFT, Print, exec, grim
12 changes: 12 additions & 0 deletions nix/home-manager/desktop/waybar.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{pkgs, ...}: let
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
blueberry = "${pkgs.blueberry}/bin/blueberry";
in {
programs.waybar = {
enable = true;
Expand Down Expand Up @@ -34,12 +35,23 @@ in {
"memory"
"temperature"
"pulseaudio"
"bluetooth"
"network"
"tray"
"battery"
"custom/power"
];

bluetooth = {
"format" = "󰂯";
"format-disabled" = "󰂲";
"format-connected" = "󰂱";
"tooltip-format" = "{controller_alias}\t{controller_address}";
"tooltip-format-connected" = "{controller_alias}\t{controller_address}\n\n{device_enumerate}";
"tooltip-format-enumerate-connected" = "{device_alias}\t\t{device_address}";
"on-click" = "blueberry";
};

"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";
Expand Down
12 changes: 7 additions & 5 deletions nix/home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,26 @@
home.packages = with pkgs; [
awscli2
azure-cli
bluez-tools
brightnessctl
cargo
imv
fd
glib # required for mime
fzf
gh
glib # required for mime
imv
k9s
kubectl
neofetch
networkmanagerapplet
papirus-icon-theme
pcmanfm
ripgrep
slack
pcmanfm
brightnessctl
swayidle
xdg-utils
wl-clipboard
xdg-utils
zoom-us
];

programs.firefox.enable = true;
Expand Down
6 changes: 6 additions & 0 deletions nix/nixos/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
networking.hostName = "nz"; # Define your hostname.
networking.enableIPv6 = false;
networking.networkmanager.enable = true;
networking.wireguard.enable = true;
systemd.services.NetworkManager-wait-online.enable = false;
services.wg-netmanager.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
Expand Down Expand Up @@ -140,6 +142,7 @@
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;

Expand All @@ -154,9 +157,12 @@
symbolsFile = ../symbols/colemak_dh;
};

services.fprintd.enable = true;

security.rtkit.enable = true;
security.sudo.wheelNeedsPassword = false;
security.pam.services.swaylock = {};
security.pam.services.swaylock.fprintAuth = true;

# This setups a SSH server. Very important if you're setting up a headless system.
# Feel free to remove if you don't need it.
Expand Down
1 change: 1 addition & 0 deletions nix/nixos/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.bluetooth.enable = true;
}
7 changes: 6 additions & 1 deletion nix/nixos/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
[
adwaita-qt
adwaita-qt6
blueberry
file
gnome.gnome-tweaks
grim # Screenshot tool for hyprland
slurp # Works with grim to screenshot on wayland
gnumake
file
home-manager
hyprland-protocols
hyprpaper
hyprpicker
nfs-utils
traceroute
pamixer
polkit_gnome
qt5.qtwayland
Expand Down
15 changes: 15 additions & 0 deletions nix/shared/home-manager.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
config,
pkgs,
lib,
...
}: let
name = "Sergei Bulavintsev";
user = "sab";
in {
# atuin = {
# enable = true;
# # Doesn't work for me right now, explicitly do it via fish
# enableFishIntegration = false;
# };
}
8 changes: 5 additions & 3 deletions nix/shared/packages.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{pkgs}:
with pkgs; [
alejandra
atuin
bat
cmake
ctags
curl
dig
fd
ffmpeg
fish
Expand All @@ -25,13 +27,13 @@ with pkgs; [
kubectx
kubernetes-helm
lf
lua-language-server # LSP for lua
marksman # LSP for markdown
mtr
neovim
ripgrep
rsync
rnix-lsp # LSP for nix
marksman # LSP for markdown
lua-language-server # LSP for lua
rsync
stylua
tmux
tree
Expand Down
6 changes: 6 additions & 0 deletions nvim/lua/config/filetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ vim.filetype.add {
[".*%.env.*"] = "sh",
[".*ignore"] = "conf",
[".*enkinsfile.*"] = "groovy",
[".*/playbooks/.*.yml"] = "yaml.ansible",
[".*/playbooks/.*.yaml"] = "yaml.ansible",
[".*/roles/.*/.*.yml"] = "yaml.ansible",
[".*/roles/.*/.*.yaml"] = "yaml.ansible",
[".*/handlers/.*/.*.yml"] = "yaml.ansible",
[".*/handlers/.*/.*.yaml"] = "yaml.ansible",
},
}
9 changes: 9 additions & 0 deletions nvim/lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ return {
{ name = "nvim_lsp", priority = 8 },
{ name = "cmp_tabnine", priority = 8, max_item_count = 3 },
{ name = "treesitter", priority = 7 },
{ name = "cody", priority = 6 },
{ name = "buffer", priority = 7, keyword_length = 5 },
{ name = "nvim_lua", priority = 5 },
{ name = "luasnip", priority = 5 },
Expand All @@ -96,6 +97,13 @@ return {
},
mapping = {
["<CR>"] = cmp.mapping.confirm { select = false },
["<c-a>"] = cmp.mapping.complete {
config = {
sources = {
{ name = "cody" },
},
},
},
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select },
Expand Down Expand Up @@ -148,6 +156,7 @@ return {
cmp_tabnine = "[T9]",
nvim_lsp = "[LSP]",
treesitter = "[TS]",
cody = "[SG]",
path = "[Path]",
luasnip = "[Snippet]",
})[entry.source.name]
Expand Down
26 changes: 26 additions & 0 deletions nvim/lua/plugins/sg.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
return {
"sourcegraph/sg.nvim",
cmd = { "CodyAsk", "CodyChat", "CodyToggle", "CodyTask", "CodyTaskView" },
-- event = "VeryLazy",
keys = {
{
"<leader>sF",
function()
require("sg.extensions.telescope").fuzzy_search_results()
end,
desc = "sourcegraph-fuzzy-search",
},
{ "<leader>cc", "<cmd>CodyChat<CR>", desc = "cody-chat", mode = { "n", "x" } },
{ "<leader>ca", ":CodyAsk<space>", desc = "cody-ask", mode = { "n", "x" } },
{ "<leader>cd", ":CodyTask<space>", desc = "cody-task", mode = { "n", "x" } },
{ "<leader>cn", "<cmd>CodyTaskNext<CR>", desc = "cody-task-next", mode = { "n", "x" } },
{ "<leader>cp", "<cmd>CodyTaskPrev<CR>", desc = "cody-task-prev", mode = { "n", "x" } },
{ "<leader>ct", "<cmd>CodyToggle<CR>", desc = "cody-toggle", mode = { "n", "x" } },
{ "<leader>cv", "<cmd>CodyTaskView<CR>", desc = "cody-task-view", mode = { "n", "x" } },
{ "<leader>cy", "<cmd>CodyTaskAccept<CR>", desc = "cody-task-accept", mode = { "n", "x" } },
{ "<leader>sL", "<cmd>SourcegraphLink<CR>", desc = "sourcegraph-link" },
{ "<leader>sg", "<cmd>SourcegraphSearch<CR>", desc = "sourcegraph-search" },
},
-- Example sg search context:global repo:^github\.com/.*/dotfiles$ file:.*.lua sg.nvim
dependencies = { "nvim-lua/plenary.nvim" },
}
2 changes: 1 addition & 1 deletion tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -g status-left '#[fg=red,bg=black][#h]#[fg=white,bold] W#I:P#P |#[default]'

# Set up right status
set -g status-right-length 60
set -g status-right "| #(/bin/bash $HOME/.tmux/kube.tmux 250 magenta cyan) #[fg=white]| #[fg=red] [%R]"
set -g status-right "| #(/usr/bin/env bash $HOME/.tmux/kube.tmux 250 magenta cyan) #[fg=white]| #[fg=red] [%R]"
# set -g status-right '| #[fg=red]#(whoami) - [%R] '
# set -g status-right '| #[fg=red] [%R] '

Expand Down

0 comments on commit 68e024e

Please sign in to comment.