add zls and abstract zig to module

This commit is contained in:
Daylin Morgan 2024-04-05 12:18:44 -05:00
parent 360cb79ea1
commit bf6b0b26d8
Signed by: daylin
GPG key ID: 950D13E9719334AD
5 changed files with 168 additions and 3 deletions

View file

@ -15,6 +15,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -73,6 +89,60 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"zls",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hyprcursor": { "hyprcursor": {
"inputs": { "inputs": {
"hyprlang": "hyprlang", "hyprlang": "hyprlang",
@ -219,6 +289,18 @@
"type": "github" "type": "github"
} }
}, },
"langref": {
"flake": false,
"locked": {
"narHash": "sha256-94broSBethRhPJr0G9no4TPyB8ee6BQ/hHK1QnLPln0=",
"type": "file",
"url": "https://raw.githubusercontent.com/ziglang/zig/54bbc73f8502fe073d385361ddb34a43d12eec39/doc/langref.html.in"
},
"original": {
"type": "file",
"url": "https://raw.githubusercontent.com/ziglang/zig/54bbc73f8502fe073d385361ddb34a43d12eec39/doc/langref.html.in"
}
},
"lib-aggregate": { "lib-aggregate": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
@ -401,7 +483,8 @@
"pinix": "pinix", "pinix": "pinix",
"stable": "stable", "stable": "stable",
"tsm": "tsm", "tsm": "tsm",
"zig2nix": "zig2nix" "zig2nix": "zig2nix",
"zls": "zls"
} }
}, },
"stable": { "stable": {
@ -480,6 +563,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -576,6 +674,29 @@
"type": "github" "type": "github"
} }
}, },
"zig-overlay": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_4",
"nixpkgs": [
"zls",
"nixpkgs"
]
},
"locked": {
"lastModified": 1711627798,
"narHash": "sha256-4BUZmgUFrrD5dRZbOUYRRQEDwLX/r7/ErLi+vHfB/+8=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "b01e0b81d1fa489e54362ea0a74f182eaa9a35bb",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"type": "github"
}
},
"zig2nix": { "zig2nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -596,6 +717,30 @@
"repo": "zig2nix", "repo": "zig2nix",
"type": "github" "type": "github"
} }
},
"zls": {
"inputs": {
"flake-utils": "flake-utils_3",
"gitignore": "gitignore",
"langref": "langref",
"nixpkgs": [
"nixpkgs"
],
"zig-overlay": "zig-overlay"
},
"locked": {
"lastModified": 1711925513,
"narHash": "sha256-DFgsGlEGsxLgtRrh7J+v8x4w+/cJatTCkrZP3/0Gb/o=",
"owner": "zigtools",
"repo": "zls",
"rev": "4e01c08f558ea07462aaa7b71d2a24f86f47a855",
"type": "github"
},
"original": {
"owner": "zigtools",
"repo": "zls",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -25,6 +25,9 @@
zig2nix.url = "github:Cloudef/zig2nix"; zig2nix.url = "github:Cloudef/zig2nix";
zig2nix.inputs.nixpkgs.follows = "nixpkgs"; zig2nix.inputs.nixpkgs.follows = "nixpkgs";
zls.url = "github:zigtools/zls";
zls.inputs.nixpkgs.follows = "nixpkgs";
}; };
nixConfig = { nixConfig = {

View file

@ -20,6 +20,7 @@ in {
"nim" "nim"
"tex" "tex"
"node" "node"
"zig"
]; ];
}; };

View file

@ -1,10 +1,10 @@
{lib, ...}: let {lib, ...}: let
inherit (lib) mkOption types literalExpression mdDoc; inherit (lib) mkOption types literalExpression mdDoc;
in { in {
imports = [./nim.nix ./tex.nix ./misc.nix ./node.nix ./python.nix]; imports = [./nim.nix ./tex.nix ./misc.nix ./node.nix ./python.nix ./zig.nix];
options.oizys.languages = mkOption { options.oizys.languages = mkOption {
type = with types; (listOf str); type = with types; (listOf str);
description = lib.mdDoc '' description = mdDoc ''
List of programming languages to enable. List of programming languages to enable.
''; '';
default = []; default = [];

16
modules/languages/zig.nix Normal file
View file

@ -0,0 +1,16 @@
{
inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIfIn;
cfg = config.oizys.languages;
zig = inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin;
zls = inputs.zls.outputs.packages.${pkgs.system}.default;
in {
config = mkIfIn "zig" cfg {
environment.systemPackages = [zig zls];
};
}