mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 21:50:14 +00:00
Compare commits
6 Commits
language-c
...
05deb5b979
Author | SHA1 | Date | |
---|---|---|---|
05deb5b979 | |||
8621e2375d | |||
25975da0c1 | |||
a79719c21a | |||
5aea58df79 | |||
1833bfddfb |
@ -1,11 +1,10 @@
|
|||||||
{ 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 =
|
||||||
|
|
||||||
@ -19,12 +18,6 @@
|
|||||||
'' 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
|
||||||
@ -48,11 +41,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
use.lspconfig.pyright.setup = dsl.callWith {
|
use.lspconfig.pyright.setup = dsl.callWith {
|
||||||
cmd = if config.python then [
|
cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ];
|
||||||
"${pkgs.pyright}/bin/pyright-langserver"
|
|
||||||
"--stdio"
|
|
||||||
] else
|
|
||||||
[ "echo" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use.lspconfig.terraformls.setup = dsl.callWith {
|
use.lspconfig.terraformls.setup = dsl.callWith {
|
||||||
@ -81,6 +70,8 @@
|
|||||||
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" }),
|
||||||
@ -89,7 +80,6 @@
|
|||||||
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, config, ... }: {
|
{ pkgs, lib, ... }: {
|
||||||
|
|
||||||
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,15 +14,16 @@
|
|||||||
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 {
|
||||||
@ -30,7 +31,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,11 +5,9 @@ let
|
|||||||
neovim = import ./package {
|
neovim = import ./package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors = config.theme.colors;
|
colors = config.theme.colors;
|
||||||
c = config.c.enable;
|
terraform = config.terraform.enable;
|
||||||
github = true;
|
github = true;
|
||||||
kubernetes = config.kubernetes.enable;
|
kubernetes = config.kubernetes.enable;
|
||||||
python = config.python.enable;
|
|
||||||
terraform = config.terraform.enable;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
@ -1 +0,0 @@
|
|||||||
{ 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 width = hs.screen.mainScreen():fullFrame().w
|
local screen = hs.screen.primaryScreen()
|
||||||
local switcherWidth = 500
|
local switcherWidth = 500
|
||||||
obj.canvas = hs.canvas.new({
|
obj.canvas = hs.canvas.new({
|
||||||
x = width / 2 - switcherWidth / 2,
|
x = (screen:fullFrame().x + screen:fullFrame().w) / 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.w / 2
|
frame.x = (max.x * 2 + 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,6 +51,7 @@ 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,7 +3,6 @@
|
|||||||
# 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
|
||||||
|
@ -80,7 +80,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Allows Nextcloud to trust Cloudflare IPs
|
# Allows Nextcloud to trust Cloudflare IPs
|
||||||
services.nextcloud.extraOptions.trusted_proxies = cloudflareIpRanges;
|
services.nextcloud.settings.trusted_proxies = cloudflareIpRanges;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
adminpassFile = config.secrets.nextcloud.dest;
|
adminpassFile = config.secrets.nextcloud.dest;
|
||||||
dbtype = "mysql";
|
dbtype = "mysql";
|
||||||
};
|
};
|
||||||
extraOptions = {
|
settings = {
|
||||||
default_phone_region = "US";
|
default_phone_region = "US";
|
||||||
# Allow access when hitting either of these hosts or IPs
|
# Allow access when hitting either of these hosts or IPs
|
||||||
trusted_domains = [ config.hostnames.content ];
|
trusted_domains = [ config.hostnames.content ];
|
||||||
|
@ -48,23 +48,12 @@
|
|||||||
before = [ "paperless.service" ];
|
before = [ "paperless.service" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Fix permissions on a regular schedule
|
|
||||||
systemd.timers.paperless-permissions = {
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "*-*-* *:0/5"; # Every 5 minutes
|
|
||||||
Unit = "paperless-permissions.service";
|
|
||||||
};
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Fix paperless shared permissions
|
# Fix paperless shared permissions
|
||||||
systemd.services.paperless-permissions = {
|
systemd.services.paperless-web.serviceConfig.UMask = lib.mkForce "0026";
|
||||||
description = "Allow group access to paperless files";
|
systemd.services.paperless-scheduler.serviceConfig.UMask =
|
||||||
serviceConfig = { Type = "oneshot"; };
|
lib.mkForce "0026";
|
||||||
script = ''
|
systemd.services.paperless-task-queue.serviceConfig.UMask =
|
||||||
find ${config.services.paperless.mediaDir} -type f -exec chmod 640 -- {} +
|
lib.mkForce "0026";
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user