Compare commits

..

2 commits

9 changed files with 112 additions and 156 deletions

View file

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

View file

@ -37,7 +37,7 @@
};
hmts-nvim.flake = false;
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";
nvim-lspconfig.flake = false;
nvim-lspconfig.url = "github:neovim/nvim-lspconfig";
@ -72,7 +72,6 @@
let
defaultOverlays = [
inputs.hypr-contrib.overlays.default
inputs.neovim-nightly-overlay.overlay
self.overlays.default
];
@ -143,6 +142,10 @@
command = "sudo nixos-rebuild boot --flake . $@";
}
];
packages = with pkgs; [
stylua
sumneko-lua-language-server
];
};
pre-commit = {

View file

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

View file

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

View file

@ -1,20 +1,8 @@
{ pkgs, lib, ... }:
{ pkgs, ... }:
with builtins;
{
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;
lazy = false;
@ -321,5 +309,13 @@ with builtins;
];
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);
};
extraPackages = mkOption {
default = with pkgs; [
poetry
ruff
python310Packages.python-lsp-server
];
default = [ ];
type = with types; listOf package;
};
};

View file

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