Compare commits

...

2 Commits

9 changed files with 112 additions and 156 deletions

View File

@ -122,11 +122,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1695973661, "lastModified": 1698410321,
"narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=", "narHash": "sha256-MphuSlgpmKwtJncGMohryHiK55J1n6WzVQ/OAfmfoMc=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31", "rev": "1aed986e3c81a4f6698e85a7452cbfcc4b31a36e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -140,11 +140,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1698155728, "lastModified": 1698422527,
"narHash": "sha256-PUJ40o/0LyMEgSBEfLVyPA0K3gQnPYQDq9dW9nCOU9M=", "narHash": "sha256-SDu3Xg263t3oXIyTaH0buOvFnKIDeZsvKDBtOz+jRbs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "8c5d52db5690c72406b0cb13a5ac8554a287c93a", "rev": "944d338d24a9d043a3f7461c30ee6cfe4f9cca30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -206,11 +206,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1696343447, "lastModified": 1698579227,
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "narHash": "sha256-KVWjFZky+gRuWennKsbo6cWyo7c/z/VgCte5pR9pEKg=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "rev": "f76e870d64779109e41370848074ac4eaa1606ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -402,11 +402,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1698250431, "lastModified": 1698795315,
"narHash": "sha256-qs2gTeH4wpnWPO6Oi6sOhp2IhG0i0DzcnrJxIY3/CP8=", "narHash": "sha256-fF5ScAWLMHXOuqsbLSG137kS1D+gr9JPtm4H2c4yBbU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "09587fbbc6a669f7725613e044c2577dc5d43ab5", "rev": "9bc7d84b8213255ecd5eb6299afdb77c36ece71d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -420,11 +420,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1698136694, "lastModified": 1698687579,
"narHash": "sha256-YKtA8un/BMJY17r9ydLa08y2St7Dtai2y/67t1+UGeM=", "narHash": "sha256-BWqQQLhpuQolMiLMTcsc8cNlNzI9+MG/uc184IlP2nA=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "contrib", "repo": "contrib",
"rev": "5fd96ad55f4695837e938a8da0a83babcb64371f", "rev": "bfd3e0efc1af9654808e644b157eb3c170c26fa1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -442,11 +442,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1698190104, "lastModified": 1698802123,
"narHash": "sha256-40TEEIjlIb0hJE/yRsjLBwjkRYkj/4QRTkN1Op86umw=", "narHash": "sha256-Tpx1U6IlnD+wrSvUrBwEvwvK5D8cifIdppB9CwpVQdo=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "a1b138a6258b00787cea43bddc48b7caa8cca3a0", "rev": "7b32b4214d028a173c8192bddaa9e43503326080",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -531,11 +531,11 @@
}, },
"master": { "master": {
"locked": { "locked": {
"lastModified": 1698254131, "lastModified": 1698838244,
"narHash": "sha256-wPqfjnqgZIhbLFK9ZDU+mkGJN4o7zWYcgkNdBxfeqZs=", "narHash": "sha256-uOrd51CisNyM0V+Y+c8uXIQSxQYKKBaINsYtd5I9bJU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4df6cc87b5b7b39e4e0160132ca901fd28a10295", "rev": "4be2d0ba3e43534ad23217d66d3abd60613f08ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -593,11 +593,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1698138555, "lastModified": 1698359872,
"narHash": "sha256-HOzLvbRnHtpNQJJN52JYKnTm0d9K508QKsEFLbxjRHk=", "narHash": "sha256-/migmIszx7Kqa/x9I6hKYATeFSpZ7P+6NKRDA1nkZfk=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "1094d0c0dbd0f37ccc0f1d18c73c6066e5690664", "rev": "9dc440400cdb470b317c4169ba916e1cd9a316e1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -616,16 +616,17 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1698192055, "lastModified": 1698364851,
"narHash": "sha256-YC5IWqMTwdFxrIWYfdhW3SWmb356VtzcXt8fc49PCos=", "narHash": "sha256-UQqC71YP6B5uOQ8HZRWQsbiMDKIROLhSNlnFPnDP27Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "d3ea1553487b52fe7603c830994475f51cd619db", "rev": "dacbb092b5d6e97127b3e57007474a5c47305164",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "dacbb092b5d6e97127b3e57007474a5c47305164",
"type": "github" "type": "github"
} }
}, },
@ -636,11 +637,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697946153, "lastModified": 1698550809,
"narHash": "sha256-7k7qIwWLaYPgQ4fxmEdew3yCffhK6rM4I4Jo3X/79DA=", "narHash": "sha256-Um8+Wi6EAH5dCgfgl7OqaVd4wFJn6FKLafcP5QPr/98=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "5a2006282caaf32663cdcd582c5b18809c7d7d8d", "rev": "1f0981f5baeb78e3c89a8980ff1a39f06876fa8c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -788,11 +789,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1697723726, "lastModified": 1698134075,
"narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", "narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", "rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -820,11 +821,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1697915759, "lastModified": 1698266953,
"narHash": "sha256-WyMj5jGcecD+KC8gEs+wFth1J1wjisZf8kVZH13f1Zo=", "narHash": "sha256-jf72t7pC8+8h8fUslUYbWTX5rKsRwOzRMX8jJsGqDXA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "51d906d2341c9e866e48c2efcaac0f2d70bfd43e", "rev": "75a52265bda7fd25e06e3a67dee3f0354e73243c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -836,11 +837,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1697915759, "lastModified": 1698553279,
"narHash": "sha256-WyMj5jGcecD+KC8gEs+wFth1J1wjisZf8kVZH13f1Zo=", "narHash": "sha256-T/9P8yBSLcqo/v+FTOBK+0rjzjPMctVymZydbvR/Fak=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "51d906d2341c9e866e48c2efcaac0f2d70bfd43e", "rev": "90e85bc7c1a6fc0760a94ace129d3a1c61c3d035",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -885,11 +886,11 @@
"none-ls-nvim": { "none-ls-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1697600654, "lastModified": 1698458199,
"narHash": "sha256-dDMZEgT5uG31bEsLiX9r6MJlOJUdQyeTPJAeRcY2z7s=", "narHash": "sha256-r8CyCvGVJG7hLAIlonaqzjxAiybRySkRe/Y9c4krQXE=",
"owner": "nvimtools", "owner": "nvimtools",
"repo": "none-ls.nvim", "repo": "none-ls.nvim",
"rev": "dc9b7e28f5573a1a2225ffb33893d23d3e052ed6", "rev": "b8fd44ee1616e6a9c995ed5f94ad9f1721d303ef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -900,11 +901,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1698253808, "lastModified": 1698835584,
"narHash": "sha256-00mJdl0SYfSO/zQYpOaBV3sSZfQbl8cahI7CewTbEtA=", "narHash": "sha256-2ljVCc2VjvdnRhKRzfZfGwS3mrsHO24Nsr7zf5NxTIg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "923a29e2916f1d2589d933018b80b9ca2c4e39be", "rev": "4c248463ef00cf5a5116940f36f8c154b78b4ded",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -916,11 +917,11 @@
"nvim-lspconfig": { "nvim-lspconfig": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1698055249, "lastModified": 1698537974,
"narHash": "sha256-Ohckvu+Vt5CE5uZt2TJcUmG4QM97d1F67n2YmCaVGwo=", "narHash": "sha256-8io/dDbFRUyBgzg+oVdpJCGhm59d+AwstyHs9OAWlkY=",
"owner": "neovim", "owner": "neovim",
"repo": "nvim-lspconfig", "repo": "nvim-lspconfig",
"rev": "6428fcab6f3c09e934bc016c329806314384a41e", "rev": "d0467b9574b48429debf83f8248d8cee79562586",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -932,11 +933,11 @@
"nvim-puppeteer": { "nvim-puppeteer": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1697557313, "lastModified": 1698399688,
"narHash": "sha256-9aLDtdhyWzU8uqH6mohiLC6eEATC1Neb+rvcx7sxcdU=", "narHash": "sha256-dXeY7O7Qh+1f5qZuZiCF1/3g2xXsb7sDpWr9IhYaeXw=",
"owner": "chrisgrieser", "owner": "chrisgrieser",
"repo": "nvim-puppeteer", "repo": "nvim-puppeteer",
"rev": "b2793ab39120086fa59327d3901a847961198662", "rev": "f3c06a83d24d2af9809c76dc5ec6e4ee1cfc21b6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1056,11 +1057,11 @@
}, },
"stable": { "stable": {
"locked": { "locked": {
"lastModified": 1697957990, "lastModified": 1698696950,
"narHash": "sha256-LlyEQ4z1immaiZV+MQMUXM3KpNoRY/xZVm8mmN5j3yg=", "narHash": "sha256-FHFL58t6lMumvWqwundC8fDDDLOIvc+JJBNIAlPjrDY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b3ddf9649fdac7db15aeea95cb3114c13594d265", "rev": "017ef2132a5bda50bd713aeabce8f918502d4ec1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -37,7 +37,7 @@
}; };
hmts-nvim.flake = false; hmts-nvim.flake = false;
hmts-nvim.url = "github:calops/hmts.nvim"; hmts-nvim.url = "github:calops/hmts.nvim";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay/dacbb092b5d6e97127b3e57007474a5c47305164"; # HACK: because upstream is broken
nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim";
nvim-lspconfig.flake = false; nvim-lspconfig.flake = false;
nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; nvim-lspconfig.url = "github:neovim/nvim-lspconfig";
@ -72,7 +72,6 @@
let let
defaultOverlays = [ defaultOverlays = [
inputs.hypr-contrib.overlays.default inputs.hypr-contrib.overlays.default
inputs.neovim-nightly-overlay.overlay
self.overlays.default self.overlays.default
]; ];
@ -143,6 +142,10 @@
command = "sudo nixos-rebuild boot --flake . $@"; command = "sudo nixos-rebuild boot --flake . $@";
} }
]; ];
packages = with pkgs; [
stylua
sumneko-lua-language-server
];
}; };
pre-commit = { pre-commit = {

View File

@ -23,14 +23,14 @@
extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2"; extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2";
keyboardLayouts = [ "us" "de" ]; keyboardLayouts = [ "us" "de" ];
}; };
services.mullvad.enable = true;
services.wallpaper.enable = true; services.wallpaper.enable = true;
programs.ledger.enable = true; programs.ledger.enable = true;
}; };
home-manager.users.moritz.home.packages = with pkgs; [ home-manager.users.moritz.home.packages = with pkgs; [
jetbrains.idea-community anki
]; ];
hardware = { hardware = {
keyboard.qmk.enable = true; keyboard.qmk.enable = true;
nvidia.modesetting.enable = true; nvidia.modesetting.enable = true;

View File

@ -29,29 +29,22 @@ in
extraPackages = with pkgs; extraPackages = with pkgs;
[ [
alejandra alejandra
black
checkmake checkmake
codespell
deadnix deadnix
dotenv-linter dotenv-linter
fish fish
isort
jq jq
nil nil
nixd nixd
nixpkgs-fmt nixpkgs-fmt
nodePackages.bash-language-server nodePackages.bash-language-server
nodePackages.jsonlint nodePackages.jsonlint
ruff-lsp
rustfmt
shellcheck shellcheck
shfmt shfmt
statix statix
stylua
sumneko-lua-language-server
taplo taplo
typst yamlfix
typst-lsp
yamlfmt
yamllint yamllint
]; ];
extraLuaConfig = readFile ./options.lua; extraLuaConfig = readFile ./options.lua;

View File

@ -1,20 +1,8 @@
{ pkgs, lib, ... }: { pkgs, ... }:
with builtins; with builtins;
{ {
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [ config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
{
plugin = formatter-nvim;
cmd = [ "Format" "Fmt" ];
keys = [
{
key = "=";
cmd = "<cmd>Format<cr>";
desc = "format (formatter)";
}
];
conf = readFile ./lua/formatter-nvim.lua;
}
{ {
plugin = oil-nvim; plugin = oil-nvim;
lazy = false; lazy = false;
@ -321,5 +309,13 @@ with builtins;
]; ];
conf = readFile ./lua/neotest.lua; conf = readFile ./lua/neotest.lua;
} }
{
plugin = conform-nvim;
keys = [
{ key = "="; cmd = "<cmd>lua require('conform').format()<cr>"; desc = "format buffer"; mode = [ "n" "v" ]; }
];
cmd = [ "ConformInfo" "Format" ];
conf = readFile ./lua/conform.lua;
}
]; ];
} }

View File

@ -0,0 +1,36 @@
local conform = require("conform")
local formatters_by_ft = {
["*"] = { "codespell", "trim_whitespace" },
go = { "gofmt" },
json = { "jq" },
lua = { "stylua" },
nix = { { "nixpkgs_fmt", "alejandra" } },
python = { { "ruff_fix", "isort" }, { "ruff_format", "black" } },
rust = { "rustfmt" },
sh = { "shfmt" },
toml = { "taplo" },
yaml = { "yamlfix" },
}
conform.setup({
formatters_by_ft = formatters_by_ft,
})
vim.api.nvim_create_user_command("Format", function(opts)
conform.format({ formatters = opts.fargs })
end, {
nargs = "+",
complete = function()
local names = formatters_by_ft[vim.bo.filetype] or formatters_by_ft["_"] or {}
names = vim.list_extend(names, formatters_by_ft["*"] or {})
names = vim.tbl_flatten(names)
local formatters = vim.tbl_map(conform.get_formatter_info, names)
formatters = vim.tbl_filter(function(formatter)
return formatter.available
end, formatters)
return vim.tbl_map(function(formatter_info)
return formatter_info.name
end, formatters)
end,
})

View File

@ -1,70 +0,0 @@
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
-- Enable or disable logging
logging = true,
-- Set the log level
log_level = vim.log.levels.WARN,
-- All formatter configurations are opt-in
filetype = {
go = {
require("formatter.filetypes.go").gofmt,
},
json = {
require("formatter.filetypes.json").jq,
},
lua = {
require("formatter.filetypes.lua").stylua,
},
nix = {
require("formatter.filetypes.nix").nixpkgs_fmt,
},
python = {
require("formatter.filetypes.python").black,
},
rust = {
require("formatter.filetypes.rust").rustfmt,
},
sh = {
require("formatter.filetypes.sh").shfmt,
},
toml = {
require("formatter.filetypes.toml").taplo,
},
yaml = {
require("formatter.filetypes.yaml").yamlfmt,
},
-- HACK to use specific formatters only when specified
alejandra = {
require("formatter.filetypes.nix").alejandra,
},
isort = {
require("formatter.filetypes.python").isort,
},
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {
-- "formatter.filetypes.any" defines default configurations for any
-- filetype
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
vim.api.nvim_create_user_command("Fmt", function(opts)
local params = vim.split(opts.args, "%s+", { trimempty = true })
local filetype = vim.bo.filetype
vim.cmd("set filetype=" .. params[1]) -- fake filetype
vim.cmd(":Format")
vim.cmd("set filetype=" .. filetype) -- restore original filetype
end, {
nargs = 1,
complete = function()
local languages = {
nix = { "alejandra" },
python = { "isort" },
}
return languages[vim.bo.filetype] or {}
end,
})

View File

@ -35,11 +35,7 @@ in
type = with types; listOf (enum commonPackages); type = with types; listOf (enum commonPackages);
}; };
extraPackages = mkOption { extraPackages = mkOption {
default = with pkgs; [ default = [ ];
poetry
ruff
python310Packages.python-lsp-server
];
type = with types; listOf package; type = with types; listOf package;
}; };
}; };

View File

@ -1,6 +1,6 @@
{ inputs, lib, ... }: { inputs, lib, ... }:
final: prev: _: prev:
{ {
agenix = inputs.agenix.packages.${prev.system}.default; agenix = inputs.agenix.packages.${prev.system}.default;
hyprpaper = inputs.hyprpaper.packages.${prev.system}.default; hyprpaper = inputs.hyprpaper.packages.${prev.system}.default;
@ -11,6 +11,7 @@ final: prev:
}); });
timers = inputs.timers.packages.${prev.system}.default; timers = inputs.timers.packages.${prev.system}.default;
hyprland = inputs.hyprland.packages.${prev.system}.default; hyprland = inputs.hyprland.packages.${prev.system}.default;
neovim-nightly = inputs.neovim-nightly-overlay.packages.${prev.system}.default;
xorg = prev.xorg // { xorg = prev.xorg // {
lndir = prev.xorg.lndir.overrideAttrs (_: { lndir = prev.xorg.lndir.overrideAttrs (_: {