diff --git a/flake.lock b/flake.lock index c33795d..8ef4521 100644 --- a/flake.lock +++ b/flake.lock @@ -15,6 +15,22 @@ "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": { "inputs": { "nixpkgs-lib": [ @@ -73,6 +89,60 @@ "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": { "inputs": { "hyprlang": "hyprlang", @@ -219,6 +289,18 @@ "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": { "inputs": { "flake-utils": "flake-utils", @@ -401,7 +483,8 @@ "pinix": "pinix", "stable": "stable", "tsm": "tsm", - "zig2nix": "zig2nix" + "zig2nix": "zig2nix", + "zls": "zls" } }, "stable": { @@ -480,6 +563,21 @@ "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": { "inputs": { "nixpkgs": [ @@ -576,6 +674,29 @@ "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": { "inputs": { "flake-utils": "flake-utils_2", @@ -596,6 +717,30 @@ "repo": "zig2nix", "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", diff --git a/flake.nix b/flake.nix index a582665..8b2d3b9 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,9 @@ zig2nix.url = "github:Cloudef/zig2nix"; zig2nix.inputs.nixpkgs.follows = "nixpkgs"; + + zls.url = "github:zigtools/zls"; + zls.inputs.nixpkgs.follows = "nixpkgs"; }; nixConfig = { diff --git a/hosts/othalan/default.nix b/hosts/othalan/default.nix index de03ad7..a54a0b1 100644 --- a/hosts/othalan/default.nix +++ b/hosts/othalan/default.nix @@ -20,6 +20,7 @@ in { "nim" "tex" "node" + "zig" ]; }; diff --git a/modules/languages/default.nix b/modules/languages/default.nix index a05b37a..a21d7f3 100644 --- a/modules/languages/default.nix +++ b/modules/languages/default.nix @@ -1,10 +1,10 @@ {lib, ...}: let inherit (lib) mkOption types literalExpression mdDoc; 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 { type = with types; (listOf str); - description = lib.mdDoc '' + description = mdDoc '' List of programming languages to enable. ''; default = []; diff --git a/modules/languages/zig.nix b/modules/languages/zig.nix new file mode 100644 index 0000000..15677ef --- /dev/null +++ b/modules/languages/zig.nix @@ -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]; + }; +}