This commit is contained in:
Glen Goodwin 2023-08-15 15:49:35 -04:00
parent 78e8d4cd39
commit ceb75c42fd
14 changed files with 325 additions and 28 deletions

View file

@ -3,11 +3,11 @@
"devenv": { "devenv": {
"locked": { "locked": {
"dir": "src/modules", "dir": "src/modules",
"lastModified": 1686161729, "lastModified": 1689941025,
"narHash": "sha256-PrKWK7xf01qRvxfJhxyHF3cC3ulqDzBtr+Ja+mIsEXc=", "narHash": "sha256-m2EC7dvTnxK0pTUsD+phMvPp2O8DmW+bGUL0UefIQIA=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "5200404ac8d501bde360cfeae7d8bd020a44755c", "rev": "ff78ecd88b5e8c15b274c71560f68ab431eeb94f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -74,11 +74,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1686089707, "lastModified": 1689935543,
"narHash": "sha256-LTNlJcru2qJ0XhlhG9Acp5KyjB774Pza3tRH0pKIb3o=", "narHash": "sha256-6GQ9ib4dA/r1leC5VUpsBo0BmDvNxLjKrX1iyL+h8mc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "af21c31b2a1ec5d361ed8050edd0303c31306397", "rev": "e43e2448161c0a2c4928abec4e16eae1516571bc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -115,11 +115,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1686050334, "lastModified": 1689668210,
"narHash": "sha256-R0mczWjDzBpIvM3XXhO908X5e2CQqjyh/gFbwZk/7/Q=", "narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "6881eb2ae5d8a3516e34714e7a90d9d95914c4dc", "rev": "eb433bff05b285258be76513add6f6c57b441775",
"type": "github" "type": "github"
}, },
"original": { "original": {

37
flake.lock generated
View file

@ -10,11 +10,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1688577390, "lastModified": 1689941025,
"narHash": "sha256-cTejScdjuNUw0QPAsyb1jBjw0TImzk0QSBGqfr1UOUg=", "narHash": "sha256-m2EC7dvTnxK0pTUsD+phMvPp2O8DmW+bGUL0UefIQIA=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "ed538b703ec07b54409944f530d5dc32c4b85150", "rev": "ff78ecd88b5e8c15b274c71560f68ab431eeb94f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -87,11 +87,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1688552611, "lastModified": 1689891262,
"narHash": "sha256-pV/1/AU1l5CNFeKmdJ1jofcaKHhtKAbxY4gazeCyoSo=", "narHash": "sha256-Pc4wDczbdgd6QXKJIXprgxe7L9AVDsoAkMnvm5vmpUU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b23c7501f7e0a001486c9a5555a6c53ac7b08e85", "rev": "ee5673246de0254186e469935909e821b8f4ec15",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -110,11 +110,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1688564762, "lastModified": 1689959100,
"narHash": "sha256-sJ2kaI4VsysYuNjxVII0Yb5n3iYSD1H3o12o3rSVMkY=", "narHash": "sha256-pTK3YtZN32oLm0Zkm6SySX/wv/GGM49/yd7bFKdDSCM=",
"owner": "vaxerski", "owner": "vaxerski",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "981c71e60a4db9838e82dd721f0e5ae4981529aa", "rev": "27dd07f1b8f89dcf6fe29fec75fdd5c8e9bc9ec4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -186,11 +186,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1688500189, "lastModified": 1689850295,
"narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "78419edadf0fabbe5618643bd850b2f2198ed060", "rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -234,11 +234,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1688556768, "lastModified": 1689935543,
"narHash": "sha256-mhd6g0iJGjEfOr3+6mZZOclUveeNr64OwxdbNtLc8mY=", "narHash": "sha256-6GQ9ib4dA/r1leC5VUpsBo0BmDvNxLjKrX1iyL+h8mc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "27bd67e55fe09f9d68c77ff151c3e44c4f81f7de", "rev": "e43e2448161c0a2c4928abec4e16eae1516571bc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -304,17 +304,18 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1686753331, "lastModified": 1689611045,
"narHash": "sha256-KovjVFwcuoUO0eu/UiWrnD3+m/K+SHSAVIz4xF9K1XA=", "narHash": "sha256-3RTOlQabkNetQ4O4UzSf57JPco9VGVHhSU1ls5uKBeE=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "7e7633abf09b362d0bad9e3fc650fd692369291d", "rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e",
"type": "gitlab" "type": "gitlab"
} }
}, },

View file

@ -7,13 +7,32 @@
[ (import ../modules/editors/nvim/home.nix) ] ++ [ (import ../modules/editors/nvim/home.nix) ] ++
[ (import ../modules/programs/devenv/home.nix) ] ++ [ (import ../modules/programs/devenv/home.nix) ] ++
[ (import ../modules/shell/tmux/home.nix) ] ++ [ (import ../modules/shell/tmux/home.nix) ] ++
[ (import ../modules/editors/lvim/home.nix) ] ++
[ (import ../modules/shell/zsh/home.nix) ]; [ (import ../modules/shell/zsh/home.nix) ];
#Add support for ./local/bin
#home.sessionPath = [
#"$HOME/.local/bin"
#];
home = { home = {
username = "${user}"; username = "${user}";
homeDirectory = "/home/${user}"; homeDirectory = "/home/${user}";
packages = with pkgs; [ packages = with pkgs; [
jetbrains.datagrip
kubernetes-helm
argocd
k3d
tor-browser-bundle-bin
nmap
dig
signal-desktop
minikube
kubectl
viddy
# Terminal # Terminal
htop htop

View file

@ -18,6 +18,7 @@ in
XDG_CURRENT_DESKTOP = "Hyprland"; XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland"; XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland"; XDG_SESSION_DESKTOP = "Hyprland";
XCURSOR_SIZE = "108";
}; };
sessionVariables = { sessionVariables = {
QT_QPA_PLATFORM = "wayland"; QT_QPA_PLATFORM = "wayland";

View file

@ -0,0 +1,9 @@
{ config, pkgs, user, ... }:
{
virtualisation.libvirtd.host.enable = true;
users.extraGroups.libvirtd.members = [ "${user}" ];
}

View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
home.file."/home/glen/.config/lvim" = {
source = ./lvim;
recursive = true;
};
home.packages = with pkgs; [
];
}

View file

@ -0,0 +1,5 @@
reload "user.plugins"
reload "user.surround"
reload "user.dial"
reload "user.oil"
reload "user.keymaps"

View file

@ -0,0 +1,70 @@
local status_ok, dial_config = pcall(require, "dial.config")
if not status_ok then
return
end
local augend = require "dial.augend"
dial_config.augends:register_group {
default = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
},
typescript = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.constant.new { elements = { "let", "const" } },
},
visual = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
augend.constant.alias.alpha,
augend.constant.alias.Alpha,
},
mygroup = {
augend.constant.new {
elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true, -- "or" is incremented into "and".
},
augend.constant.new {
elements = { "True", "False" },
word = true,
cyclic = true,
},
augend.constant.new {
elements = { "public", "private" },
word = true,
cyclic = true,
},
augend.constant.new {
elements = { "sad", "sad" },
word = true,
cyclic = true,
},
augend.constant.new {
elements = { "&&", "||" },
word = false,
cyclic = true,
},
augend.date.alias["%m/%d/%Y"], -- date (02/19/2022, etc.)
augend.constant.alias.bool, -- boolean value (true <-> false)
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.semver.alias.semver
},
}
local map = require "dial.map"
-- change augends in VISUAL mode
vim.api.nvim_set_keymap("n", "<C-a>", map.inc_normal "mygroup", { noremap = true })
vim.api.nvim_set_keymap("n", "<C-x>", map.dec_normal "mygroup", { noremap = true })
vim.api.nvim_set_keymap("v", "<C-a>", map.inc_normal "visual", { noremap = true })
vim.api.nvim_set_keymap("v", "<C-x>", map.dec_normal "visual", { noremap = true })
vim.cmd [[
" enable only for specific FileType
autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "<C-a>", require("dial.map").inc_normal("typescript"), {noremap = true})
]]

View file

@ -0,0 +1 @@
vim.keymap.set("n", "-", require("oil").open, { desc = "Open parent directory" })

View file

@ -0,0 +1,127 @@
require("oil").setup({
-- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns
columns = {
"icon",
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = "hide",
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = "no",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "n",
},
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
default_file_explorer = true,
-- Restore window options to previous values when leaving an oil buffer
restore_win_options = true,
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = false,
-- Deleted files will be removed with the trash_command (below).
delete_to_trash = false,
-- Change this to customize the command used when deleting to trash
trash_command = "trash-put",
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
prompt_save_on_select_new_entry = true,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-s>"] = "actions.select_vsplit",
["<C-h>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-l>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["g."] = "actions.toggle_hidden",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = false,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
max_width = 0,
max_height = 0,
border = "rounded",
win_options = {
winblend = 10,
},
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
override = function(conf)
return conf
end,
},
-- Configuration for the actions floating preview window
preview = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = "rounded",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = "rounded",
minimized_border = "none",
win_options = {
winblend = 0,
},
},
})

View file

@ -0,0 +1,29 @@
-- Additional Plugins
lvim.plugins = {
"kylechui/nvim-surround",
"monaqa/dial.nvim",
{
"cbochs/grapple.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
},
{
'stevearc/oil.nvim',
opts = {},
-- Optional dependencies
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
}

View file

@ -0,0 +1,21 @@
local status_ok, surround = pcall(require, "nvim-surround")
if not status_ok then
return
end
surround.setup {
keymaps = { -- vim-surround style keymaps
insert = "<C-g>s",
insert_line = "<C-g>S",
normal = "s",
normal_cur = "ss",
normal_line = "S",
normal_cur_line = "SS",
visual = "s",
visual_line = "gS",
delete = "ds",
change = "cs",
},
}
vim.cmd [[nmap <leader>' siw']]

View file

@ -50,7 +50,7 @@ create_detached_session() {
(TMUX='' (TMUX=''
tmux new-session -Ad -s "$session_name" -c "$path_name" tmux new-session -Ad -s "$session_name" -c "$path_name"
tmux split-window -vb -t "$session_name" -c "$path_name" -p 70 tmux split-window -vb -t "$session_name" -c "$path_name" -p 70
tmux send-keys -t "$session_name" "nvim '+Telescope find_files'" Enter tmux send-keys -t "$session_name" "/home/glen/.local/bin/lvim '+Telescope find_files'" Enter
) )
fi fi
} }

View file

@ -52,6 +52,7 @@
octal = "stat -c '%a %n'"; octal = "stat -c '%a %n'";
v = "nix run ~/Projects/nvim-flake --"; v = "nix run ~/Projects/nvim-flake --";
lvim = "/home/glen/.local/bin/lvim";
}; };