feat(nvim): nil -> nixd
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
2af97f6b5a
commit
a8ec0fcfff
4 changed files with 37 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,3 +8,4 @@ result*
|
||||||
*icons
|
*icons
|
||||||
*.direnv/
|
*.direnv/
|
||||||
modules/ags/config/ts/lockscreen/vars.ts
|
modules/ags/config/ts/lockscreen/vars.ts
|
||||||
|
.nixd.json
|
||||||
|
|
|
@ -1,25 +1,57 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
osConfig,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
nvim-theme-src,
|
nvim-theme-src,
|
||||||
coc-stylelintplus,
|
coc-stylelintplus,
|
||||||
|
nixd,
|
||||||
vimplugin-easytables-src,
|
vimplugin-easytables-src,
|
||||||
vimplugin-riscv-src,
|
vimplugin-riscv-src,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.vars) neovimIde;
|
inherit (config.vars) hostName mainUser neovimIde;
|
||||||
inherit (lib) fileContents hasAttr optionalAttrs optionals;
|
inherit (lib) fileContents hasPrefix mdDoc optionalAttrs optionals removePrefix;
|
||||||
|
|
||||||
javaSdk = pkgs.temurin-bin-17;
|
javaSdk = pkgs.temurin-bin-17;
|
||||||
coc-stylelintplus-flake = coc-stylelintplus.packages.${pkgs.system}.default;
|
coc-stylelintplus-flake = coc-stylelintplus.packages.${pkgs.system}.default;
|
||||||
|
nixdPkg = nixd.packages.${pkgs.system}.default;
|
||||||
|
|
||||||
|
flakeEnv = osConfig.environment.variables.FLAKE;
|
||||||
|
flakeDir = "${removePrefix "/home/${mainUser}/" flakeEnv}";
|
||||||
in {
|
in {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = hasPrefix "/home/${mainUser}/" flakeEnv;
|
||||||
|
message = mdDoc ''
|
||||||
|
Your $FLAKE environment variable needs to point to a directory in
|
||||||
|
the main users' home to use the neovim module.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
home = optionalAttrs neovimIde {
|
home = optionalAttrs neovimIde {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
gradle
|
gradle
|
||||||
maven
|
maven
|
||||||
alejandra
|
alejandra
|
||||||
|
|
||||||
|
# FIXME: set nixd to use alejandra
|
||||||
|
(writeShellApplication {
|
||||||
|
name = "nixpkgs-fmt";
|
||||||
|
runtimeInputs = [alejandra];
|
||||||
|
text = "alejandra \"$@\"";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
file."${flakeDir}/.nixd.json".text = builtins.toJSON {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import (builtins.getFlake \"${flakeDir}\").inputs.nixpkgs {}";
|
||||||
|
};
|
||||||
|
options.nixos = {
|
||||||
|
expr = "(builtins.getFlake \"${flakeDir}\").nixosConfigurations.${hostName}.options";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.dataFile = optionalAttrs neovimIde {
|
xdg.dataFile = optionalAttrs neovimIde {
|
||||||
|
@ -60,7 +92,7 @@ in {
|
||||||
nodePackages.npm
|
nodePackages.npm
|
||||||
nodePackages.neovim
|
nodePackages.neovim
|
||||||
gradle
|
gradle
|
||||||
nil
|
nixdPkg
|
||||||
]);
|
]);
|
||||||
|
|
||||||
extraPython3Packages = ps:
|
extraPython3Packages = ps:
|
||||||
|
@ -115,19 +147,8 @@ in {
|
||||||
languageserver = {
|
languageserver = {
|
||||||
# Nix
|
# Nix
|
||||||
nix = {
|
nix = {
|
||||||
command = "nil";
|
command = "nixd";
|
||||||
filetypes = ["nix"];
|
filetypes = ["nix"];
|
||||||
rootPatterns = ["flake.nix"];
|
|
||||||
settings = {
|
|
||||||
nil = {
|
|
||||||
formatting.command = ["alejandra"];
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
maxMemoryMB = 2560;
|
|
||||||
flake.autoArchive = hasAttr "sops" config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
BIN
flake.nix
BIN
flake.nix
Binary file not shown.
Loading…
Reference in a new issue