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 ]; ++ optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ];
programs.firefox = { programs.firefox = {
package = pkgs.firefox-beta; # package = pkgs.firefox-beta;
enable = true; enable = true;
nativeMessagingHosts.packages = nativeMessagingHosts.packages =
[ ] [ ]

View File

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

View File

@ -65,7 +65,7 @@ in
"sd_mod" "sd_mod"
]; ];
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; # extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ];
kernelModules = [ kernelModules = [
"ddcci_backlight" "ddcci_backlight"
"i2c-dev" "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 (config.grimmShared) enable tooling graphical;
inherit (lib) inherit (lib)
mkEnableOption mkEnableOption
mkOption
types
getExe getExe
optionals optionals
mkIf mkIf
@ -23,6 +25,8 @@ in
./nvim.nix ./nvim.nix
./lsp.nix ./lsp.nix
./git.nix ./git.nix
./c.nix
./java.nix
]; ];
config = mkIf (enable && tooling.enable) { config = mkIf (enable && tooling.enable) {
@ -40,14 +44,9 @@ in
wget wget
bat bat
hyfetch hyfetch
util-linux
btop btop
linuxPackages.perf
eza eza
gcc
jdk17
pkg-config
unzip unzip
p7zip p7zip
@ -55,13 +54,10 @@ in
gomuks gomuks
ranger ranger
visualvm
imagemagick imagemagick
nmap nmap
parted parted
glib
glibc
expect expect
] ]
++ optionals graphical [ ++ optionals graphical [
@ -69,8 +65,6 @@ in
qdirstat qdirstat
libva-utils libva-utils
gparted gparted
jetbrains.clion
jetbrains.idea-community
]; ];
environment.shellAliases = { environment.shellAliases = {
@ -104,9 +98,20 @@ in
askPassword = mkIf graphical (getExe pkgs.lxqt.lxqt-openssh-askpass); askPassword = mkIf graphical (getExe pkgs.lxqt.lxqt-openssh-askpass);
}; };
programs.thefuck.enable = true; programs.thefuck.enable = true;
programs.starship.enable = true;
programs.bash.shellInit = ''
eval "$(starship init bash)"
'';
}; };
options.grimmShared.tooling = { options.grimmShared.tooling = {
enable = mkEnableOption "grimm-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}] [formatter.${getName fmt.package}]
command = "${getExe fmt.package}" command = "${fmt.command}"
includes = ${builtins.toJSON fmt.includes} includes = ${builtins.toJSON fmt.includes}
'' ''
+ (optionalString (fmt.options != [ ]) "options = ${builtins.toJSON fmt.options}\n") + (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.lsp.package) (filter (v: !isNull v.lsp) tooling.lang_servers))
++ (map (v: v.fmt.package) (filter (v: !isNull v.fmt) 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})"; environment.shellAliases."treefmt" = "${getExe pkgs.treefmt} --config-file $(${getExe find_conf})";
grimmShared.tooling.nvim.extraLuaRC = grimmShared.tooling.nvim.extraLuaRC =
@ -71,7 +70,7 @@ in
options = { options = {
lspconf_mod_name = mkOption { lspconf_mod_name = mkOption {
type = types.nullOr types.nonEmptyStr; type = types.nullOr types.nonEmptyStr;
default = getName config.package; default = builtins.replaceStrings [ "-" ] [ "_" ] (getName config.package);
description = "lspconfig module name"; description = "lspconfig module name";
}; };

View File

@ -23,7 +23,10 @@ in
programs.git.config.core.editor = getExe pkgs.neovim; 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 = { programs.neovim = {
enable = true; enable = true;

View File

@ -5,6 +5,7 @@
... ...
}: }:
let let
lang_support_id = "python";
inherit (config.grimmShared) enable tooling graphical; inherit (config.grimmShared) enable tooling graphical;
pyLibs = pyLibs =
python-pkgs: with python-pkgs; [ python-pkgs: with python-pkgs; [
@ -13,18 +14,31 @@ let
numpy numpy
scipy scipy
pygobject3 pygobject3
pandas
]; ];
inherit (lib)
mkIf
types
mkOption
mapAttrsToList
concatLines
getExe
elem
;
in in
{ {
config = lib.mkIf (enable && tooling.enable) { config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.python3.withPackages pyLibs) (pkgs.python3.withPackages pyLibs)
] ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]); ] ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]);
programs.xonsh = { programs.xonsh = {
enable = true; enable = true;
config = lib.concatLines ( config = ''
lib.mapAttrsToList ( execx($(${getExe pkgs.starship} init xonsh))
'' + concatLines (
mapAttrsToList (
name: value: "aliases[\"${name}\"] = '''${value}'''" name: value: "aliases[\"${name}\"] = '''${value}'''"
) config.environment.shellAliases ) 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 let
lang_support_id = "rust";
inherit (lib)
optionals
mkIf
types
mkOption
elem
;
inherit (config.grimmShared) enable tooling graphical; inherit (config.grimmShared) enable tooling graphical;
in in
{ {
config = lib.mkIf (enable && tooling.enable) { config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages = environment.systemPackages =
with pkgs; 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 = [ grimmShared.tooling.lang_servers = [
{ {
lsp = { lsp = {
package = pkgs.rust-analyzer; package = pkgs.rust-analyzer;
lspconf_mod_name = "rust_analyzer"; vimIntegration = false;
}; };
fmt = { fmt = {
package = pkgs.rustfmt; 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.polkit.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
security.pam.yubico = {
# enable = true;
debug = true;
mode = "challenge-response";
control = "sufficient";
};
security.doas.enable = true; security.doas.enable = true;
security.sudo.enable = false; security.sudo.enable = false;
security.doas.extraRules = [ security.doas.extraRules = [

View File

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

View File

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

View File

@ -5,10 +5,10 @@
"homepage": "https://matrix.to/#/#agenix:nixos.org", "homepage": "https://matrix.to/#/#agenix:nixos.org",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "8d37c5bdeade12b6479c85acd133063ab53187a0", "rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
"sha256": "0z26jj4pwliz6v5fdgnwc5fsihjdsy2gz49fcivr4p4178fw4gnr", "sha256": "1lpkwinlax40b7xgzspbkm9rsi4a1x48hxhixnni4irxxwnav0ah",
"type": "tarball", "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" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"authentik-nix": { "authentik-nix": {
@ -29,22 +29,34 @@
"homepage": "https://nyx.chaotic.cx", "homepage": "https://nyx.chaotic.cx",
"owner": "chaotic-cx", "owner": "chaotic-cx",
"repo": "nyx", "repo": "nyx",
"rev": "bae54b9e537d17c298b30436990d4962caab73d0", "rev": "f3685d816317958caf2bce128f80d02fee65b163",
"sha256": "13p1ygwf7q95na4lc3b4cp8rinpc4jvdhyz4c50ig77iz55mvbij", "sha256": "1nklhkwfsyxilyzls6rw2cw9sdhlni5jnq4llj1m2w2ggw83d0wv",
"type": "tarball", "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" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"lix-module": { "lix-module": {
"branch": "main", "branch": "main",
"repo": "https://git.lix.systems/lix-project/nixos-module.git", "repo": "https://git.lix.systems/lix-project/nixos-module.git",
"rev": "c8ab1e79ba0140bc75731c75177242089506260b", "rev": "18fa4a89e208cb8e881f5f71c75bbd4c1c2fd37d",
"type": "git" "type": "git"
}, },
"lix-pkg": { "lix-pkg": {
"branch": "main", "branch": "main",
"repo": "https://git.lix.systems/lix-project/lix.git", "repo": "https://git.lix.systems/lix-project/lix.git",
"rev": "ceccac835c55e3b5c805851bad871360641ff1d9", "rev": "2b397c66297bab65c2b5719367a414f9a2efb7e7",
"type": "git" "type": "git"
}, },
"nixos-mailserver": { "nixos-mailserver": {
@ -71,10 +83,10 @@
"homepage": null, "homepage": null,
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714", "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
"sha256": "0khh2y04wp4dy1hy0nxc4raacp8149ds7mpwmnymf55v7xzf10vn", "sha256": "1rai87jwpfly0bpkhiaq56n3rvzhb15h72n61s42q1mpnw3vf4zh",
"type": "tarball", "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" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
} }
} }

View File

@ -30,5 +30,6 @@
./searchclip.nix ./searchclip.nix
./confwhich.nix ./confwhich.nix
./rfindup.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 obs-studio
element-desktop element-desktop
ghidra ghidra
# rmview rmview
] ]
); );
}; };