Compare commits

..

No commits in common. "3d88a303bd40cc601793df378b0a85d4d05445d0" and "b72e2a05bd86a3b682d4ce188aefbc699441af45" have entirely different histories.

13 changed files with 64 additions and 341 deletions

View File

@ -13,6 +13,7 @@ let
getExe
optionals
mkIf
concatLines
;
in
{
@ -21,9 +22,6 @@ in
./nix.nix
./security.nix
./python.nix
./rust.nix
./nvim.nix
./lsp.nix
];
config = mkIf (enable && tooling.enable) {
@ -36,13 +34,15 @@ in
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
urlencode
rfindup
pstree
dos2unix
treefmt
file
wget
hyfetch
util-linux
btop
neovim-remote
linuxPackages.perf
eza
@ -82,6 +82,7 @@ in
config = {
init.defaultBranch = "main";
credential.username = tooling.git_user;
core.editor = getExe pkgs.neovim;
user.name = tooling.git_user;
user.email = tooling.git_email;
push.autoSetupRemote = true;
@ -112,9 +113,46 @@ in
services.dbus.implementation = "broker";
grimmShared.tooling.nvim = {
plugins = with pkgs.vimPlugins; [
fugitive
nvim-lspconfig
];
};
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
configure = {
customRC =
let
luarc = pkgs.writeText "init.lua" (concatLines tooling.nvim.extraLuaRC);
in
''
set number
set hidden
set fileencodings=utf-8
set nocompatible
set clipboard+=unnamedplus
set ff=unix
luafile ${luarc}
if filereadable($HOME . "/.vimrc")
source ~/.vimrc
endif
'';
packages.myVimPackage = {
start = tooling.nvim.plugins;
opt = [ ];
};
};
};
programs.ssh = {
startAgent = true;
enableAskPassword = graphical;
@ -125,6 +163,21 @@ in
options.grimmShared.tooling = {
enable = mkEnableOption "grimm-tooling";
nvim = {
plugins = mkOption {
type = types.listOf types.package;
default = [ ];
description = "Extra vim plugins to include";
};
extraLuaRC = mkOption {
type = types.listOf types.nonEmptyStr;
default = [ ];
description = "Extra init LUA scripts";
};
};
git_user = mkOption {
type = types.str;
default = "Grimmauld";

View File

@ -1,139 +0,0 @@
{
pkgs,
config,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling;
inherit (lib)
mkOption
types
mkIf
getName
mkEnableOption
getExe
filter
optionalString
concatLines
;
conf_def =
fmt:
(
''
[formatter.${getName fmt.package}]
command = "${getExe fmt.package}"
includes = ${builtins.toJSON fmt.includes}
''
+ (optionalString (fmt.options != [ ]) "options = ${builtins.toJSON fmt.options}\n")
);
treefmt_conf = pkgs.writeText "treefmt.toml" (
concatLines (map (v: (conf_def v.fmt)) (filter (v: !isNull v.fmt) tooling.lang_servers))
);
find_conf = pkgs.writeShellScriptBin "find-treefmt-conf" "(${getExe pkgs.rfindup} treefmt.toml -e 2>/dev/null || echo ${treefmt_conf}) | tr -d '\n'";
in
{
config = mkIf (enable && tooling.enable) {
environment.systemPackages =
[
pkgs.treefmt
pkgs.findup
pkgs.gnused
]
++ (map (v: v.lsp.package) (filter (v: !isNull v.lsp) tooling.lang_servers))
++ (map (v: v.fmt.package) (filter (v: !isNull v.fmt) tooling.lang_servers));
# environment.shellAliases."treefmt" = "${getExe pkgs.treefmt} --config-file ${treefmt_conf}";
environment.shellAliases."treefmt" = "${getExe pkgs.treefmt} --config-file $(${getExe find_conf})";
grimmShared.tooling.nvim.extraLuaRC =
[ "vim.g.coq_settings = { auto_start = 'shut-up' }" ]
++ (map (
v:
"require'lspconfig'.${v.lsp.lspconf_mod_name}.setup(require('coq').lsp_ensure_capabilities(${v.lsp.lspconf_config}))"
) (filter (v: !isNull v.lsp && v.lsp.vimIntegration) tooling.lang_servers));
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [
nvim-lspconfig
coq_nvim
coq-artifacts
];
};
options.grimmShared.tooling.lang_servers = mkOption {
type = types.listOf (
types.submodule {
options = {
lsp = mkOption {
type = types.nullOr (
types.submodule (
{ config, ... }:
{
options = {
lspconf_mod_name = mkOption {
type = types.nullOr types.nonEmptyStr;
default = getName config.package;
description = "lspconfig module name";
};
lspconf_config = mkOption {
type = types.nonEmptyStr;
default = "{}";
description = "options to pass to lspconfig";
};
package = mkOption {
type = types.package;
default = null;
description = "LSP package";
};
vimIntegration = mkEnableOption "Enable coq/nvim-lspconfig integration" // {
default = true;
};
};
}
)
);
};
fmt = mkOption {
type = types.nullOr (
types.submodule (
{ config, ... }:
{
options = {
package = mkOption {
type = types.package;
description = "FMT package";
};
options = mkOption {
type = types.listOf types.nonEmptyStr;
default = [ ];
};
includes = mkOption {
type = types.listOf types.nonEmptyStr;
default = [ ];
};
command = mkOption {
type = types.nonEmptyStr;
default = getExe config.package;
};
};
}
)
);
};
};
}
);
default = { };
description = "Language servers available on the system";
};
}

View File

@ -6,6 +6,7 @@
(writeShellScriptBin "rebuild" "bash -c \"nixos-rebuild switch |& nom\"")
nixpkgs-review
nixpkgs-fmt
nixfmt-rfc-style
nixd
nixpkgs-hammering
@ -17,19 +18,9 @@
environment.sessionVariables = lib.mkIf pkgs.config.allowUnfree { NIXPKGS_ALLOW_UNFREE = "1"; };
grimmShared.tooling.nvim = {
plugins = with pkgs.vimPlugins; [ vim-nix ];
};
grimmShared.tooling.lang_servers = [
{
lsp.package = pkgs.nixd;
fmt = {
package = pkgs.nixpkgs-fmt;
includes = [ "*.nix" ];
};
}
];
grimmShared.tooling.nvim.extraLuaRC = lib.singleton ''
require'lspconfig'.nixd.setup{}
'';
nix.settings = {
experimental-features = [

View File

@ -1,73 +0,0 @@
{
pkgs,
config,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling;
inherit (lib)
mkOption
types
getExe
mkIf
concatLines
;
in
{
config = mkIf (enable && tooling.enable) {
environment.systemPackages = with pkgs; [
dos2unix
neovim-remote
];
programs.git.config.core.editor = getExe pkgs.neovim;
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ fugitive ];
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
withPython3 = true;
configure = {
customRC =
let
luarc = pkgs.writeText "init.lua" (concatLines tooling.nvim.extraLuaRC);
in
''
set number
set hidden
set fileencodings=utf-8
set nocompatible
set clipboard+=unnamedplus
set ff=unix
luafile ${luarc}
if filereadable($HOME . "/.vimrc")
source ~/.vimrc
endif
'';
packages.myVimPackage = {
start = tooling.nvim.plugins;
opt = [ ];
};
};
};
};
options.grimmShared.tooling.nvim = {
plugins = mkOption {
type = types.listOf types.package;
default = [ ];
description = "Extra vim plugins to include";
};
extraLuaRC = mkOption {
type = types.listOf types.nonEmptyStr;
default = [ ];
description = "Extra init LUA scripts";
};
};
}

View File

@ -25,21 +25,10 @@ in
enable = true;
config = lib.concatLines (
lib.mapAttrsToList (
name: value: "aliases[\"${name}\"] = '''${value}'''"
name: value: ''aliases["${name}"] = "${value}"''
) config.environment.shellAliases
);
package = pkgs.xonsh.wrapper.override { extraPackages = pyLibs; };
};
grimmShared.tooling.lang_servers = [
{
lsp.package = pkgs.pyright;
fmt = {
package = pkgs.yapf;
includes = [ "*.py" ];
options = [ "-i" ];
};
}
];
};
}

View File

@ -1,29 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
inherit (config.grimmShared) enable tooling graphical;
in
{
config = lib.mkIf (enable && tooling.enable) {
environment.systemPackages =
with pkgs;
[ pkg-config ] ++ lib.optionals graphical [ jetbrains.clion ];
grimmShared.tooling.lang_servers = [
{
lsp = {
package = pkgs.rust-analyzer;
lspconf_mod_name = "rust_analyzer";
};
fmt = {
package = pkgs.rustfmt;
includes = [ "*.rs" ];
};
}
];
};
}

View File

@ -52,10 +52,7 @@ in
XDG_CONFIG_HOME = "$HOME/.config";
};
environment.systemPackages = with pkgs; [
xwaylandvideobridge
confwhich
];
environment.systemPackages = with pkgs; [ xwaylandvideobridge ];
};
options.grimmShared.portals = mkEnableOption "Enables portals for wlr, gtk and kde as well as fixes fonts";

View File

@ -1,28 +0,0 @@
{
lib,
rustPlatform,
fetchFromGitea,
}:
rustPlatform.buildRustPackage {
pname = "confwhich";
version = "unstable-2024-05-14";
src = fetchFromGitea {
domain = "git.grimmauld.de";
owner = "Grimmauld";
repo = "confwhich";
rev = "e561b82d1e2b0d0998ccbef316014297f3468fb6";
hash = "sha256-dMkUJMQjlKzmSsgtH0xOZ5Bk654+h84M1cTx8hVM5SQ=";
};
cargoHash = "sha256-cn9vtRO+negpIVs0rnp2y5q7L4w554dfBK9MtbWd8FA=";
meta = {
description = "tool to find the path of xdg config files";
homepage = "https://git.grimmauld.de/Grimmauld/confwhich";
license = lib.licenses.bsd3;
mainProgram = "confwhich";
maintainers = with lib.maintainers; [ grimmauld ];
platforms = lib.platforms.linux;
};
}

View File

@ -1,28 +0,0 @@
{
lib,
rustPlatform,
fetchFromGitea,
}:
rustPlatform.buildRustPackage {
pname = "rfindup";
version = "unstable-2024-05-16";
src = fetchFromGitea {
domain = "git.grimmauld.de";
owner = "Grimmauld";
repo = "rfindup";
rev = "fe2c39e74c667593896ce03033cccdffda6b288d";
hash = "sha256-N23sKOfir07WIFbjdHNku7nLTtRd7A5tfs7kvdeCyeU=";
};
cargoHash = "sha256-MD7ViPWkL/aYECWj1f+NdVrPVwwFTd8GyyKSUUgXXHE=";
meta = {
description = "tool to find files by name in parent directories";
homepage = "https://git.grimmauld.de/Grimmauld/rfindup";
license = lib.licenses.bsd3;
mainProgram = "rfindup";
maintainers = with lib.maintainers; [ grimmauld ];
platforms = lib.platforms.linux;
};
}

View File

@ -31,7 +31,7 @@ let
{
# xonsh update
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305316.patch";
hash = "sha256-W3jh6qRA/7V1fImLm3vRmaT6h6gL5rlNBUuIidZHaZc=";
hash = "sha256-/OSbAur16Q1XZ/Nhf8VAzaQ3gqbaxWkQlf5G4UWKnh8=";
}
];

View File

@ -1,4 +0,0 @@
{ prev, ... }:
{
confwhich = prev.callPackage ../custom/confwhich/package.nix { };
}

View File

@ -28,7 +28,5 @@
./mcontrolcenter.nix
./ccache-wrapper.nix
./searchclip.nix
./confwhich.nix
./rfindup.nix
];
}

View File

@ -1,4 +0,0 @@
{ prev, ... }:
{
rfindup = prev.callPackage ../custom/rfindup/package.nix { };
}