Removed home environment dependency on the Zig compiler :yay:

This commit is contained in:
Lyla Bravo 2020-10-26 00:27:38 -03:00
parent a48c1598fe
commit 9f94442b19
5 changed files with 22 additions and 33 deletions

View File

@ -1,6 +1,4 @@
{ config, pkgs, ... }:
with builtins;
with import <nixpkgs> { };
let
cargo2nix = (import (builtins.fetchGit {
@ -24,7 +22,7 @@ in {
exa fd ripgrep
pandoc signify
# editor
kak-lsp parinfer-rust rnix-lsp zig-master
kak-lsp parinfer-rust rnix-lsp
# nix tools
nixfmt niv cargo2nix cachix
# gui
@ -123,10 +121,10 @@ in {
option = "filetype=(lisp|scheme)";
commands = "parinfer-enable-window -smart";
}
] ++ lib.lists.forEach tabSettings (v: {
] ++ pkgs.lib.lists.forEach tabSettings (v: {
name = "WinSetOption";
commands = "${v.tab}";
option = if isList v.filetype then
option = if builtins.isList v.filetype then
"filetype=(${builtins.concatStringsSep "|" v.filetype})"
else
"filetype=${v.filetype}";
@ -148,21 +146,6 @@ in {
};
xdg = {
dataFile = {
# compile ZLS and copy the binaries manually to ~/.local/share/zls
# TODO: get ZLS to compile with Nix, this would allow shell environments
# using Zig as a dependency to use ZLS alongside it without cluttering the
# user environment.
"zls/zls.json".text = ''
{
"zig_lib_path": "${zig-master}/lib/zig/",
"zig_exe_path": "${zig-master}/bin/zig",
"warn_style": true,
"enable_semantic_tokens": true,
"operator_completions": true
}
'';
};
configFile = {
"kak-lsp/kak-lsp.toml".source = ~/etc/kak-lsp.toml;
"luakit/userconf.lua".source = ~/etc/luakit/userconf.lua;

View File

@ -1 +0,0 @@
/home/lyla/.etc/nix/nixpkgs-mozilla/rust-overlay.nix

View File

@ -1,4 +1,11 @@
self: super:
{
zig-master = import ../pkgs/zig-master.nix;
zls = import (super.pkgs.fetchFromGitHub {
owner = "arqv"; # TODO: change when pull request gets merged
repo = "zls";
rev = "55e40e600459f3864731c3febd1b95224a305030";
fetchSubmodules = true;
sha256 = "0wgxgm7ap4xjb05i3mqzz8pgf198x3sdn4acmqw3qxlakxvm4jr5";
});
}

View File

@ -1,18 +1,17 @@
with import <nixpkgs> { };
with lib;
stdenv.mkDerivation rec {
name = "zig-master";
version = "0.6.0+198d1438e";
src = fetchTarball "https://ziglang.org/builds/zig-linux-x86_64-${version}.tar.xz";
pkgs.stdenvNoCC.mkDerivation rec {
name = "zig";
version = "0.6.0+91a1c20e7";
src = builtins.fetchTarball
"https://ziglang.org/builds/zig-linux-x86_64-${version}.tar.xz";
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/
mv ./lib $out/
mkdir -p $out/bin
mv ./zig $out/bin
mkdir -p $out/doc
mv ./langref.html $out/doc
mkdir -p $out $out/bin $out/doc
mv lib/ $out/
mv zig $out/bin
mv langref.html $out/doc
'';
}

View File

@ -8,8 +8,9 @@
./hardware-configuration.nix
];
nix = {
nix = rec {
allowedUsers = [ "root" "lyla" ];
trustedUsers = allowedUsers;
gc = {
automatic = true;
dates = "weekly";
@ -68,7 +69,7 @@
fonts = {
fonts = with pkgs; [
noto-fonts noto-fonts-cjk noto-fonts-emoji
inter mononoki tamzen
inter mononoki tamzen terminus_font
];
fontconfig = {
enable = true;