Compare commits

..

No commits in common. "1735fb38dadc0503fa68ebc7083381206ed23439" and "9c70942dfb26d3a9fb548eea3a50d0e4ad9888f7" have entirely different histories.

9 changed files with 156 additions and 112 deletions

View file

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

View file

@ -29,22 +29,29 @@ 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
yamlfix typst
typst-lsp
yamlfmt
yamllint yamllint
]; ];
extraLuaConfig = readFile ./options.lua; extraLuaConfig = readFile ./options.lua;

View file

@ -1,8 +1,20 @@
{ pkgs, ... }: { pkgs, lib, ... }:
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;
@ -309,13 +321,5 @@ 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

@ -1,36 +0,0 @@
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

@ -0,0 +1,70 @@
-- 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,7 +35,11 @@ in
type = with types; listOf (enum commonPackages); type = with types; listOf (enum commonPackages);
}; };
extraPackages = mkOption { extraPackages = mkOption {
default = [ ]; default = with pkgs; [
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, ... }:
_: prev: final: 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,7 +11,6 @@ _: 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 (_: {