feat(nvim): nil -> nixd
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-04-22 11:40:48 -04:00
parent 2af97f6b5a
commit a8ec0fcfff
4 changed files with 190 additions and 105 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ result*
*icons
*.direnv/
modules/ags/config/ts/lockscreen/vars.ts
.nixd.json

View file

@ -1,25 +1,57 @@
{
config,
osConfig,
pkgs,
lib,
nvim-theme-src,
coc-stylelintplus,
nixd,
vimplugin-easytables-src,
vimplugin-riscv-src,
...
}: let
inherit (config.vars) neovimIde;
inherit (lib) fileContents hasAttr optionalAttrs optionals;
inherit (config.vars) hostName mainUser neovimIde;
inherit (lib) fileContents hasPrefix mdDoc optionalAttrs optionals removePrefix;
javaSdk = pkgs.temurin-bin-17;
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 {
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 {
packages = with pkgs; [
gradle
maven
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 {
@ -60,7 +92,7 @@ in {
nodePackages.npm
nodePackages.neovim
gradle
nil
nixdPkg
]);
extraPython3Packages = ps:
@ -115,19 +147,8 @@ in {
languageserver = {
# Nix
nix = {
command = "nil";
command = "nixd";
filetypes = ["nix"];
rootPatterns = ["flake.nix"];
settings = {
nil = {
formatting.command = ["alejandra"];
nix = {
maxMemoryMB = 2560;
flake.autoArchive = hasAttr "sops" config;
};
};
};
};
};

View file

@ -281,6 +281,24 @@
}
},
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_5": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs-wayland",
@ -717,7 +735,7 @@
"lib-aggregate": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs-lib": "nixpkgs-lib_2"
"nixpkgs-lib": "nixpkgs-lib_3"
},
"locked": {
"lastModified": 1713105314,
@ -769,9 +787,9 @@
},
"nix-eval-jobs": {
"inputs": {
"flake-parts": "flake-parts_4",
"flake-parts": "flake-parts_5",
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_6",
"treefmt-nix": "treefmt-nix"
},
"locked": {
@ -917,6 +935,25 @@
"type": "github"
}
},
"nixd": {
"inputs": {
"flake-parts": "flake-parts_4",
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1713710522,
"narHash": "sha256-tBFiQBdH92zyaNUVOBh4PsG8ZQ3t6orBgINTeJ7DKCM=",
"owner": "nix-community",
"repo": "nixd",
"rev": "dc0164e0df37e5d06bda61b6fb2ca16089d5f838",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixd",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1711668574,
@ -984,6 +1021,24 @@
}
},
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib_3": {
"locked": {
"lastModified": 1713055793,
"narHash": "sha256-vIrZQykYW32RnlI2lT/gCcB59BOIqqrAmPirBdiirrc=",
@ -1016,11 +1071,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1712437997,
"narHash": "sha256-g0whLLwRvgO2FsyhY8fNk+TWenS3jg5UdlWL4uqgFeo=",
"lastModified": 1713638189,
"narHash": "sha256-q7APLfB6FmmSMI1Su5ihW9IwntBsk2hWNXh8XtSdSIk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e38d7cb66ea4f7a0eb6681920615dfcc30fc2920",
"rev": "74574c38577914733b4f7a775dd77d24245081dd",
"type": "github"
},
"original": {
@ -1035,7 +1090,7 @@
"flake-compat": "flake-compat",
"lib-aggregate": "lib-aggregate",
"nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": "nixpkgs_6"
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1713651334,
@ -1084,6 +1139,22 @@
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1713596654,
"narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1713537308,
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
@ -1099,7 +1170,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_6": {
"locked": {
"lastModified": 1703134684,
"narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=",
@ -1115,7 +1186,7 @@
"type": "github"
}
},
"nixpkgs_6": {
"nixpkgs_7": {
"locked": {
"lastModified": 1713537308,
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
@ -1131,7 +1202,7 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_8": {
"locked": {
"lastModified": 1708296515,
"narHash": "sha256-FyF489fYNAUy7b6dkYV6rGPyzp+4tThhr80KNAaF/yY=",
@ -1147,7 +1218,7 @@
"type": "github"
}
},
"nixpkgs_8": {
"nixpkgs_9": {
"locked": {
"lastModified": 1713537308,
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
@ -1163,22 +1234,6 @@
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1713596654,
"narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nmd": {
"flake": false,
"locked": {
@ -1270,7 +1325,7 @@
},
"nurl": {
"inputs": {
"nixpkgs": "nixpkgs_7"
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1708368674,
@ -1352,7 +1407,7 @@
},
"pcsd": {
"inputs": {
"nixpkgs": "nixpkgs_8",
"nixpkgs": "nixpkgs_9",
"nixpkgs-pacemaker": "nixpkgs-pacemaker",
"pcs-src": "pcs-src",
"pcs-web-ui-src": "pcs-web-ui-src",
@ -1405,22 +1460,6 @@
}
},
"pocketsphinx-src": {
"flake": false,
"locked": {
"lastModified": 1707149455,
"narHash": "sha256-imrwUIpORpfInitVjU11SKPPpjvObKyfI8IB4f41hfY=",
"owner": "cmusphinx",
"repo": "pocketsphinx",
"rev": "7be89aae3e76568e02e4f3d41cf1adcb7654430c",
"type": "github"
},
"original": {
"owner": "cmusphinx",
"repo": "pocketsphinx",
"type": "github"
}
},
"pocketsphinx-src_2": {
"flake": false,
"locked": {
"lastModified": 1645539790,
@ -1514,7 +1553,8 @@
"nix-index-db": "nix-index-db",
"nix-melt": "nix-melt",
"nix-on-droid": "nix-on-droid",
"nixpkgs": "nixpkgs_4",
"nixd": "nixd",
"nixpkgs": "nixpkgs_5",
"nixpkgs-wayland": "nixpkgs-wayland",
"nms": "nms",
"nur": "nur",
@ -1524,11 +1564,11 @@
"pcsd": "pcsd",
"persist-properties-src": "persist-properties-src",
"plymouth-theme-src": "plymouth-theme-src",
"pocketsphinx-src": "pocketsphinx-src",
"pointer-event-src": "pointer-event-src",
"pokemon-colorscripts-src": "pokemon-colorscripts-src",
"secrets": "secrets",
"solaar": "solaar",
"sops-nix": "sops-nix",
"subsync": "subsync",
"touch-gestures-src": "touch-gestures-src",
"trash-d-src": "trash-d-src",
@ -1559,7 +1599,9 @@
"nixpkgs": [
"nixpkgs"
],
"sops-nix": "sops-nix"
"sops-nix": [
"sops-nix"
]
},
"locked": {
"lastModified": 1712775289,
@ -1598,15 +1640,17 @@
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_9",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1713668495,
"narHash": "sha256-4BvlfPfyUmB1U0r/oOF6jGEW/pG59c5yv6PJwgucTNM=",
"lastModified": 1713775152,
"narHash": "sha256-xyP8h9jLQ0AmyPy40sIwL7/D03oVpXG9YHoYJ4ecYWA=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "09f1bc8ba3277c0f052f7887ec92721501541938",
"rev": "4371a1301c4d36cc791069d90ae522613a3a335e",
"type": "github"
},
"original": {
@ -1637,7 +1681,7 @@
"nixpkgs": [
"nixpkgs"
],
"pocketsphinx-src": "pocketsphinx-src_2",
"pocketsphinx-src": "pocketsphinx-src",
"sphinxbase-src": "sphinxbase-src"
},
"locked": {

View file

@ -1,7 +1,5 @@
{
outputs = inputs @ {
self,
home-manager,
nixpkgs,
nix-on-droid,
secrets,
@ -13,7 +11,7 @@
nixpkgs.lib.genAttrs supportedSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in
attrs system pkgs);
attrs pkgs);
# Default system
mkNixOS = mods:
@ -70,9 +68,9 @@
import ./devices/android inputs
);
formatter = perSystem (_: pkgs: pkgs.alejandra);
formatter = perSystem (pkgs: pkgs.alejandra);
devShells = perSystem (_: pkgs: {
devShells = perSystem (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
alejandra
@ -122,21 +120,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};
secrets = {
type = "git";
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
inputs = {
nixpkgs.follows = "nixpkgs";
sops-nix = {
type = "github";
owner = "Mic92";
repo = "sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
};
nix-on-droid = {
type = "github";
owner = "nix-community";
@ -148,6 +131,24 @@
};
};
sops-nix = {
type = "github";
owner = "Mic92";
repo = "sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
secrets = {
type = "git";
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
inputs = {
nixpkgs.follows = "nixpkgs";
sops-nix.follows = "sops-nix";
};
};
#
# Overlays
nixpkgs-wayland = {
type = "github";
@ -166,6 +167,7 @@
owner = "fufexan";
repo = "nix-gaming";
};
#
# Cluster Inputs
pcsd = {
@ -189,6 +191,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Servivi inputs
nms = {
@ -198,6 +201,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Nos inputs
arion = {
@ -226,8 +230,18 @@
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Desktop inputs
solaar = {
type = "github";
owner = "Svenum";
repo = "Solaar-Flake";
inputs.nixpkgs.follows = "nixpkgs";
};
## Hyprland
hyprland = {
type = "github";
owner = "hyprwm";
@ -251,7 +265,9 @@
inputs.hyprland.follows = "hyprland";
};
##
## Wayland
wpaperd = {
type = "github";
owner = "danyspin97";
@ -259,15 +275,9 @@
inputs.nixpkgs.follows = "nixpkgs";
};
##
solaar = {
type = "github";
owner = "Svenum";
repo = "Solaar-Flake";
inputs.nixpkgs.follows = "nixpkgs";
};
## AGS
ags = {
type = "github";
owner = "Aylur";
@ -291,7 +301,10 @@
inputs.nixpkgs.follows = "nixpkgs";
};
##
#
# Neovim inputs
coc-stylelintplus = {
type = "github";
owner = "matt1432";
@ -300,6 +313,13 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nixd = {
type = "github";
owner = "nix-community";
repo = "nixd";
};
#
# Nix tools
nurl = {
type = "github";
@ -326,17 +346,11 @@
owner = "nix-community";
repo = "nix-melt";
};
#
# -= Non-flake inputs =-
## Custom packages
pocketsphinx-src = {
type = "github";
owner = "cmusphinx";
repo = "pocketsphinx";
flake = false;
};
trash-d-src = {
type = "github";
owner = "rushsteve1";
@ -378,6 +392,7 @@
repo = "easytables.nvim";
flake = false;
};
##
## Overlays
gpu-screen-recorder-src = {
@ -385,8 +400,9 @@
url = "https://repo.dec05eba.com/gpu-screen-recorder";
flake = false;
};
##
# MPV scripts
## MPV scripts
modernx-src = {
type = "github";
owner = "cyl0";
@ -421,8 +437,9 @@
repo = "mpv-scripts";
flake = false;
};
##
## Dracula and theme src
## Theme sources
jellyfin-ultrachromic-src = {
type = "github";
owner = "CTalvio";
@ -479,5 +496,7 @@
repo = "xresources";
flake = false;
};
##
#
};
}