mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 21:50:14 +00:00
Compare commits
1 Commits
25975da0c1
...
language-c
Author | SHA1 | Date | |
---|---|---|---|
f85a008741 |
@ -1,10 +1,11 @@
|
|||||||
{ pkgs, lib, config, dsl, ... }: {
|
{ pkgs, lib, config, dsl, ... }: {
|
||||||
|
|
||||||
# Terraform optional because non-free
|
# Terraform optional because non-free
|
||||||
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
|
||||||
options.github = lib.mkEnableOption "Whether to enable GitHub features";
|
options.github = lib.mkEnableOption "Whether to enable GitHub features";
|
||||||
options.kubernetes =
|
options.kubernetes =
|
||||||
lib.mkEnableOption "Whether to enable Kubernetes features";
|
lib.mkEnableOption "Whether to enable Kubernetes features";
|
||||||
|
options.python = lib.mkEnableOption "Whether to enable Python LSP";
|
||||||
|
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
||||||
|
|
||||||
config =
|
config =
|
||||||
|
|
||||||
@ -18,6 +19,12 @@
|
|||||||
'' else
|
'' else
|
||||||
"";
|
"";
|
||||||
|
|
||||||
|
pythonFormat = if config.python then ''
|
||||||
|
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
|
||||||
|
require("null-ls").builtins.diagnostics.ruff.with({ command = "${pkgs.ruff}/bin/ruff" }),
|
||||||
|
'' else
|
||||||
|
"";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
plugins = [
|
plugins = [
|
||||||
pkgs.vimPlugins.nvim-lspconfig
|
pkgs.vimPlugins.nvim-lspconfig
|
||||||
@ -41,7 +48,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
use.lspconfig.pyright.setup = dsl.callWith {
|
use.lspconfig.pyright.setup = dsl.callWith {
|
||||||
cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ];
|
cmd = if config.python then [
|
||||||
|
"${pkgs.pyright}/bin/pyright-langserver"
|
||||||
|
"--stdio"
|
||||||
|
] else
|
||||||
|
[ "echo" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
use.lspconfig.terraformls.setup = dsl.callWith {
|
use.lspconfig.terraformls.setup = dsl.callWith {
|
||||||
@ -70,8 +81,6 @@
|
|||||||
require("null-ls").setup({
|
require("null-ls").setup({
|
||||||
sources = {
|
sources = {
|
||||||
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),
|
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),
|
||||||
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
|
|
||||||
require("null-ls").builtins.diagnostics.ruff.with({ command = "${pkgs.ruff}/bin/ruff" }),
|
|
||||||
require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }),
|
require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }),
|
||||||
require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }),
|
require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }),
|
||||||
require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }),
|
require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }),
|
||||||
@ -80,6 +89,7 @@
|
|||||||
command = "${pkgs.shfmt}/bin/shfmt",
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
extra_args = { "-i", "4", "-ci" },
|
extra_args = { "-i", "4", "-ci" },
|
||||||
}),
|
}),
|
||||||
|
${pythonFormat}
|
||||||
${terraformFormat}
|
${terraformFormat}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{ pkgs, lib, ... }: {
|
{ pkgs, lib, config, ... }: {
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||||
with pkgs.tree-sitter-grammars; [
|
with pkgs.tree-sitter-grammars;
|
||||||
|
[
|
||||||
tree-sitter-bash
|
tree-sitter-bash
|
||||||
tree-sitter-c
|
tree-sitter-c
|
||||||
tree-sitter-fish
|
tree-sitter-fish
|
||||||
tree-sitter-hcl
|
|
||||||
tree-sitter-ini
|
tree-sitter-ini
|
||||||
tree-sitter-json
|
tree-sitter-json
|
||||||
tree-sitter-lua
|
tree-sitter-lua
|
||||||
@ -14,16 +14,15 @@
|
|||||||
tree-sitter-markdown-inline
|
tree-sitter-markdown-inline
|
||||||
tree-sitter-nix
|
tree-sitter-nix
|
||||||
tree-sitter-puppet
|
tree-sitter-puppet
|
||||||
tree-sitter-python
|
|
||||||
tree-sitter-rasi
|
tree-sitter-rasi
|
||||||
tree-sitter-toml
|
tree-sitter-toml
|
||||||
tree-sitter-vimdoc
|
tree-sitter-vimdoc
|
||||||
tree-sitter-yaml
|
tree-sitter-yaml
|
||||||
]))
|
] ++ (if config.python.enable then [ tree-sitter-python ] else [ ])
|
||||||
|
++ (if config.terraform.enable then [ tree-sitter-hcl ] else [ ])))
|
||||||
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
||||||
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
||||||
pkgs.vimPlugins.nginx-vim
|
pkgs.vimPlugins.nginx-vim
|
||||||
pkgs.vimPlugins.vim-helm
|
|
||||||
pkgs.baleia-nvim # Clean ANSI from kitty scrollback
|
pkgs.baleia-nvim # Clean ANSI from kitty scrollback
|
||||||
# pkgs.hmts-nvim # Tree-sitter injections for home-manager
|
# pkgs.hmts-nvim # Tree-sitter injections for home-manager
|
||||||
(pkgs.vimUtils.buildVimPlugin {
|
(pkgs.vimUtils.buildVimPlugin {
|
||||||
@ -31,7 +30,7 @@
|
|||||||
version = "0.1";
|
version = "0.1";
|
||||||
src = ../plugin;
|
src = ../plugin;
|
||||||
})
|
})
|
||||||
];
|
] ++ (if config.kubernetes.enable then [ pkgs.vimPlugins.vim-helm ] else [ ]);
|
||||||
|
|
||||||
setup."nvim-treesitter.configs" = {
|
setup."nvim-treesitter.configs" = {
|
||||||
highlight = { enable = true; };
|
highlight = { enable = true; };
|
||||||
|
@ -5,9 +5,11 @@ let
|
|||||||
neovim = import ./package {
|
neovim = import ./package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors = config.theme.colors;
|
colors = config.theme.colors;
|
||||||
terraform = config.terraform.enable;
|
c = config.c.enable;
|
||||||
github = true;
|
github = true;
|
||||||
kubernetes = config.kubernetes.enable;
|
kubernetes = config.kubernetes.enable;
|
||||||
|
python = config.python.enable;
|
||||||
|
terraform = config.terraform.enable;
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
1
modules/common/programming/c.nix
Normal file
1
modules/common/programming/c.nix
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ lib, ... }: { options.c.enable = lib.mkEnableOption "C language tools."; }
|
@ -18,5 +18,5 @@ bind -M insert \cn 'commandline -r "nix shell nixpkgs#"'
|
|||||||
bind -M default \cn 'commandline -r "nix shell nixpkgs#"'
|
bind -M default \cn 'commandline -r "nix shell nixpkgs#"'
|
||||||
bind -M insert \x11F nix-fzf
|
bind -M insert \x11F nix-fzf
|
||||||
bind -M default \x11F nix-fzf
|
bind -M default \x11F nix-fzf
|
||||||
bind -M insert \ch '_atuin_search --filter-mode global'
|
bind -M insert \ch _atuin_search --filter-mode global
|
||||||
bind -M default \ch '_atuin_search --filter-mode global'
|
bind -M default \ch _atuin_search --filter-mode global
|
||||||
|
@ -8,10 +8,10 @@ obj.name = "Launcher"
|
|||||||
obj.version = "0.1"
|
obj.version = "0.1"
|
||||||
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
||||||
|
|
||||||
local screen = hs.screen.primaryScreen()
|
local width = hs.screen.mainScreen():fullFrame().w
|
||||||
local switcherWidth = 500
|
local switcherWidth = 500
|
||||||
obj.canvas = hs.canvas.new({
|
obj.canvas = hs.canvas.new({
|
||||||
x = (screen:fullFrame().x + screen:fullFrame().w) / 2 - switcherWidth / 2,
|
x = width / 2 - switcherWidth / 2,
|
||||||
y = 1,
|
y = 1,
|
||||||
h = 3,
|
h = 3,
|
||||||
w = switcherWidth,
|
w = switcherWidth,
|
||||||
|
@ -56,7 +56,7 @@ function obj:init()
|
|||||||
local frame = win:frame()
|
local frame = win:frame()
|
||||||
-- maximize if possible
|
-- maximize if possible
|
||||||
local max = win:screen():fullFrame()
|
local max = win:screen():fullFrame()
|
||||||
frame.x = (max.x * 2 + max.w) / 2
|
frame.x = max.w / 2
|
||||||
frame.y = max.y
|
frame.y = max.y
|
||||||
frame.w = max.w / 2
|
frame.w = max.w / 2
|
||||||
frame.h = max.h
|
frame.h = max.h
|
||||||
|
@ -51,7 +51,6 @@ local function worklayout()
|
|||||||
local laptop = {
|
local laptop = {
|
||||||
{ "Firefox", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
{ "Firefox", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
||||||
{ "Obsidian", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
{ "Obsidian", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
||||||
{ "Calendar", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
|
|
||||||
}
|
}
|
||||||
local layout = concat(left, right, laptop)
|
local layout = concat(left, right, laptop)
|
||||||
hs.layout.apply(layout)
|
hs.layout.apply(layout)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
# MacOS-specific settings for Kitty
|
# MacOS-specific settings for Kitty
|
||||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
|
darwinLaunchOptions = [ "--start-as=fullscreen" ];
|
||||||
font.size = lib.mkForce 20;
|
font.size = lib.mkForce 20;
|
||||||
settings = {
|
settings = {
|
||||||
shell = "/run/current-system/sw/bin/fish";
|
shell = "/run/current-system/sw/bin/fish";
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
visidata # CSV inspector
|
# visidata # CSV inspector
|
||||||
dos2unix # Convert Windows text files
|
dos2unix # Convert Windows text files
|
||||||
inetutils # Includes telnet
|
inetutils # Includes telnet
|
||||||
youtube-dl # Convert web videos
|
youtube-dl # Convert web videos
|
||||||
|
Reference in New Issue
Block a user