Compare commits

...

2 commits

Author SHA1 Message Date
62e7db65e4
update some tooling 2024-05-25 23:15:31 +02:00
21a081e2a5
temporary nvim lsp/fmt support 2024-05-25 23:15:28 +02:00
17 changed files with 243 additions and 42 deletions

View file

@ -26,7 +26,7 @@ in
++ optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ];
programs.firefox = {
package = pkgs.firefox-beta;
# package = pkgs.firefox-beta;
enable = true;
nativeMessagingHosts.packages =
[ ]

View file

@ -14,9 +14,11 @@ in
noto-fonts
noto-fonts-cjk
font-awesome
noto-fonts-emoji
# noto-fonts-emoji
noto-fonts-monochrome-emoji
roboto
liberation_ttf
nerdfonts
];
fontDir.enable = true;

View file

@ -65,7 +65,7 @@ in
"sd_mod"
];
loader.systemd-boot.enable = true;
extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ];
# extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ];
kernelModules = [
"ddcci_backlight"
"i2c-dev"

69
common/tooling/c.nix Normal file
View file

@ -0,0 +1,69 @@
{
pkgs,
config,
lib,
...
}:
let
lang_support_id = "c";
inherit (config.grimmShared) enable tooling graphical;
inherit (lib)
optionals
mkIf
getExe'
types
mkOption
elem
;
in
{
config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages =
with pkgs;
[
util-linux
linuxPackages.perf
pkg-config
glib
glibc
clang
clang-tools
]
++ optionals graphical [
libva-utils
jetbrains.clion
];
grimmShared.tooling.lang_servers = [
{
lsp = {
package = pkgs.clang-tools;
lspconf_config = ''
{
cmd = { 'clangd', '--background-index'},
root_dir = require("lspconfig.util").root_pattern(
"CMakeLists.txt",
"flake.nix",
".git"
)
}'';
lspconf_mod_name = "clangd";
};
fmt = rec {
package = pkgs.clang-tools;
command = getExe' package "clang-format";
includes = [
"*.c"
"*.h"
"*.cpp"
"*.hpp"
];
};
}
];
};
options.grimmShared.tooling.supportedLangs = mkOption {
type = types.listOf (types.enum [ lang_support_id ]);
};
}

View file

@ -8,6 +8,8 @@ let
inherit (config.grimmShared) enable tooling graphical;
inherit (lib)
mkEnableOption
mkOption
types
getExe
optionals
mkIf
@ -23,6 +25,8 @@ in
./nvim.nix
./lsp.nix
./git.nix
./c.nix
./java.nix
];
config = mkIf (enable && tooling.enable) {
@ -40,14 +44,9 @@ in
wget
bat
hyfetch
util-linux
btop
linuxPackages.perf
eza
gcc
jdk17
pkg-config
unzip
p7zip
@ -55,13 +54,10 @@ in
gomuks
ranger
visualvm
imagemagick
nmap
parted
glib
glibc
expect
]
++ optionals graphical [
@ -69,8 +65,6 @@ in
qdirstat
libva-utils
gparted
jetbrains.clion
jetbrains.idea-community
];
environment.shellAliases = {
@ -104,9 +98,20 @@ in
askPassword = mkIf graphical (getExe pkgs.lxqt.lxqt-openssh-askpass);
};
programs.thefuck.enable = true;
programs.starship.enable = true;
programs.bash.shellInit = ''
eval "$(starship init bash)"
'';
};
options.grimmShared.tooling = {
enable = mkEnableOption "grimm-tooling";
supportedLangs = mkOption {
type = types.listOf (types.enum [ ]);
default = [ ];
description = "Languages for which to enable support";
};
};
}

41
common/tooling/java.nix Normal file
View file

@ -0,0 +1,41 @@
{
pkgs,
config,
lib,
...
}:
let
lang_support_id = "java";
inherit (config.grimmShared) enable tooling graphical;
inherit (lib)
optionals
mkIf
types
mkOption
elem
;
in
{
config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages = [
pkgs.jdk17
pkgs.visualvm
] ++ optionals graphical [ pkgs.jetbrains.idea-community ];
grimmShared.tooling.lang_servers = [
{
lsp = {
package = pkgs.java-language-server;
};
fmt = {
package = pkgs.google-java-format;
includes = [ "*.java" ];
};
}
];
};
options.grimmShared.tooling.supportedLangs = mkOption {
type = types.listOf (types.enum [ lang_support_id ]);
};
}

View file

@ -23,7 +23,7 @@ let
(
''
[formatter.${getName fmt.package}]
command = "${getExe fmt.package}"
command = "${fmt.command}"
includes = ${builtins.toJSON fmt.includes}
''
+ (optionalString (fmt.options != [ ]) "options = ${builtins.toJSON fmt.options}\n")
@ -42,7 +42,6 @@ in
++ (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 =
@ -71,7 +70,7 @@ in
options = {
lspconf_mod_name = mkOption {
type = types.nullOr types.nonEmptyStr;
default = getName config.package;
default = builtins.replaceStrings [ "-" ] [ "_" ] (getName config.package);
description = "lspconfig module name";
};

View file

@ -23,7 +23,10 @@ in
programs.git.config.core.editor = getExe pkgs.neovim;
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ vim-monokai-pro ];
grimmShared.tooling.nvim = {
plugins = with pkgs.vimPlugins; [ vim-monokai-pro ];
# extraLuaRC = [ "vim.lsp.inlay_hint.enable(true)" ];
};
programs.neovim = {
enable = true;

View file

@ -5,6 +5,7 @@
...
}:
let
lang_support_id = "python";
inherit (config.grimmShared) enable tooling graphical;
pyLibs =
python-pkgs: with python-pkgs; [
@ -13,18 +14,31 @@ let
numpy
scipy
pygobject3
pandas
];
inherit (lib)
mkIf
types
mkOption
mapAttrsToList
concatLines
getExe
elem
;
in
{
config = lib.mkIf (enable && tooling.enable) {
config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages = [
(pkgs.python3.withPackages pyLibs)
] ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]);
programs.xonsh = {
enable = true;
config = lib.concatLines (
lib.mapAttrsToList (
config = ''
execx($(${getExe pkgs.starship} init xonsh))
'' + concatLines (
mapAttrsToList (
name: value: "aliases[\"${name}\"] = '''${value}'''"
) config.environment.shellAliases
);
@ -42,4 +56,8 @@ in
}
];
};
options.grimmShared.tooling.supportedLangs = mkOption {
type = types.listOf (types.enum [ lang_support_id ]);
};
}

View file

@ -5,19 +5,35 @@
...
}:
let
lang_support_id = "rust";
inherit (lib)
optionals
mkIf
types
mkOption
elem
;
inherit (config.grimmShared) enable tooling graphical;
in
{
config = lib.mkIf (enable && tooling.enable) {
config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages =
with pkgs;
[ pkg-config ] ++ lib.optionals graphical [ jetbrains.clion ];
[
pkg-config
cargo
]
++ optionals graphical [ jetbrains.clion ];
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [
rustaceanvim
];
grimmShared.tooling.lang_servers = [
{
lsp = {
package = pkgs.rust-analyzer;
lspconf_mod_name = "rust_analyzer";
vimIntegration = false;
};
fmt = {
package = pkgs.rustfmt;
@ -26,4 +42,8 @@ in
}
];
};
options.grimmShared.tooling.supportedLangs = mkOption {
type = types.listOf (types.enum [ lang_support_id ]);
};
}

View file

@ -21,6 +21,13 @@ in
security.polkit.enable = true;
security.rtkit.enable = true;
security.pam.yubico = {
# enable = true;
debug = true;
mode = "challenge-response";
control = "sufficient";
};
security.doas.enable = true;
security.sudo.enable = false;
security.doas.extraRules = [

View file

@ -20,6 +20,12 @@
locale = true;
network = true;
tooling = {
supportedLangs = [
"rust"
"c"
"java"
"python"
];
enable = true;
};
};

View file

@ -28,11 +28,11 @@ let
};
nixpkgs_patches = [
{
# xonsh update
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305316.patch";
hash = "sha256-W3jh6qRA/7V1fImLm3vRmaT6h6gL5rlNBUuIidZHaZc=";
}
#{
# # xonsh update
# url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305316.patch";
# hash = "sha256-W3jh6qRA/7V1fImLm3vRmaT6h6gL5rlNBUuIidZHaZc=";
#}
];
# enable ccache for lix if ccache is enabled
@ -103,11 +103,11 @@ in
in
{
hostPlatform = system;
pkgs = import (applyPatches {
pkgs = if (nixpkgs_patches != []) then (import (applyPatches {
name = "nixpkgs-patched";
inherit src;
patches = map fetchpatch nixpkgs_patches;
}) { inherit config; };
}) { inherit config; }) else unpatched;
overlays = [
(import (

View file

@ -5,10 +5,10 @@
"homepage": "https://matrix.to/#/#agenix:nixos.org",
"owner": "ryantm",
"repo": "agenix",
"rev": "8d37c5bdeade12b6479c85acd133063ab53187a0",
"sha256": "0z26jj4pwliz6v5fdgnwc5fsihjdsy2gz49fcivr4p4178fw4gnr",
"rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
"sha256": "1lpkwinlax40b7xgzspbkm9rsi4a1x48hxhixnni4irxxwnav0ah",
"type": "tarball",
"url": "https://github.com/ryantm/agenix/archive/8d37c5bdeade12b6479c85acd133063ab53187a0.tar.gz",
"url": "https://github.com/ryantm/agenix/archive/c2fc0762bbe8feb06a2e59a364fa81b3a57671c9.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"authentik-nix": {
@ -29,22 +29,34 @@
"homepage": "https://nyx.chaotic.cx",
"owner": "chaotic-cx",
"repo": "nyx",
"rev": "bae54b9e537d17c298b30436990d4962caab73d0",
"sha256": "13p1ygwf7q95na4lc3b4cp8rinpc4jvdhyz4c50ig77iz55mvbij",
"rev": "f3685d816317958caf2bce128f80d02fee65b163",
"sha256": "1nklhkwfsyxilyzls6rw2cw9sdhlni5jnq4llj1m2w2ggw83d0wv",
"type": "tarball",
"url": "https://github.com/chaotic-cx/nyx/archive/bae54b9e537d17c298b30436990d4962caab73d0.tar.gz",
"url": "https://github.com/chaotic-cx/nyx/archive/f3685d816317958caf2bce128f80d02fee65b163.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"glibc-eac": {
"branch": "main",
"description": "Arch glibc with the commit breaking eos-eac reverted - https://github.com/archlinux/svntogit-packages/tree/4da6c3e804e21c39908aa8a3cb597f19e6d764ef/trunk",
"homepage": "",
"owner": "Frogging-Family",
"repo": "glibc-eac",
"rev": "6a2ddcacfa9a16a2b33e3a70cd73e0f7937b8b94",
"sha256": "0p1b3a7ynbg63vl0lrqzf6w19grbxi4dmqch07p1fll7xhvl80km",
"type": "tarball",
"url": "https://github.com/Frogging-Family/glibc-eac/archive/6a2ddcacfa9a16a2b33e3a70cd73e0f7937b8b94.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"lix-module": {
"branch": "main",
"repo": "https://git.lix.systems/lix-project/nixos-module.git",
"rev": "c8ab1e79ba0140bc75731c75177242089506260b",
"rev": "18fa4a89e208cb8e881f5f71c75bbd4c1c2fd37d",
"type": "git"
},
"lix-pkg": {
"branch": "main",
"repo": "https://git.lix.systems/lix-project/lix.git",
"rev": "ceccac835c55e3b5c805851bad871360641ff1d9",
"rev": "2b397c66297bab65c2b5719367a414f9a2efb7e7",
"type": "git"
},
"nixos-mailserver": {
@ -71,10 +83,10 @@
"homepage": null,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"sha256": "0khh2y04wp4dy1hy0nxc4raacp8149ds7mpwmnymf55v7xzf10vn",
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
"sha256": "1rai87jwpfly0bpkhiaq56n3rvzhb15h72n61s42q1mpnw3vf4zh",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/f1010e0469db743d14519a1efd37e23f8513d714.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/5710852ba686cc1fd0d3b8e22b3117d43ba374c2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

View file

@ -30,5 +30,6 @@
./searchclip.nix
./confwhich.nix
./rfindup.nix
./glibc-eac.nix
];
}

18
overlays/glibc-eac.nix Normal file
View file

@ -0,0 +1,18 @@
{ prev, ... }: let
nivSources = import ../nix/sources.nix;
glibc_patches = [
"rogue_company_reverts.patch"
];
in
{
glibc-eac = prev.glibc.overrideAttrs(old: {
patches = (
let
oldPatches = old.patches or [ ];
in
if oldPatches == null then [ ] else oldPatches
)
++ (map (p: "${nivSources.glibc-eac}/${p}") glibc_patches);
doCheck = false;
});
}

View file

@ -43,7 +43,7 @@
obs-studio
element-desktop
ghidra
# rmview
rmview
]
);
};