Update rust treesitter grammar for helix

This commit is contained in:
Riley Apeldoorn 2024-04-27 12:13:43 +02:00
parent 0b1c7bce55
commit e8b83724ca
5 changed files with 141 additions and 14 deletions

View file

@ -20,6 +20,27 @@
"type": "github" "type": "github"
} }
}, },
"crane": {
"inputs": {
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709610799,
"narHash": "sha256-5jfLQx0U9hXbi2skYMGodDJkIgffrjIOgMRjZqms2QE=",
"owner": "ipetkov",
"repo": "crane",
"rev": "81c393c776d5379c030607866afef6406ca1be57",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -46,6 +67,24 @@
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": {
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1681202837, "lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
@ -60,7 +99,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "flake-utils_3": {
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
@ -75,6 +114,27 @@
"type": "github" "type": "github"
} }
}, },
"helix": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1714168229,
"narHash": "sha256-EzNJ7L1XgqSIo3myFl/dFVqm6BXa8oV9qzSJpMBGYWU=",
"owner": "helix-editor",
"repo": "helix",
"rev": "5ee7411450021df3854b62f61b8722451e40277c",
"type": "github"
},
"original": {
"owner": "helix-editor",
"repo": "helix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -98,7 +158,7 @@
}, },
"home-manager_2": { "home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1703265279, "lastModified": 1703265279,
@ -178,6 +238,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1709479366,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1702312524, "lastModified": 1702312524,
"narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=",
@ -193,7 +269,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1703013332, "lastModified": 1703013332,
"narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
@ -209,7 +285,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1681358109, "lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
@ -227,8 +303,8 @@
}, },
"oxalica": { "oxalica": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1703297543, "lastModified": 1703297543,
@ -246,7 +322,7 @@
}, },
"pwnix": { "pwnix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"jwt-tool": "jwt-tool", "jwt-tool": "jwt-tool",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -286,14 +362,40 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"helix": "helix",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-latest": "nixpkgs-latest", "nixpkgs-latest": "nixpkgs-latest",
"oxalica": "oxalica", "oxalica": "oxalica",
"pwnix": "pwnix" "pwnix": "pwnix"
} }
}, },
"rust-overlay": {
"inputs": {
"flake-utils": [
"helix",
"flake-utils"
],
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709604635,
"narHash": "sha256-le4fwmWmjGRYWwkho0Gr7mnnZndOOe4XGbLw68OvF40=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "e86c0fb5d3a22a5f30d7f64ecad88643fe26449d",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -308,6 +410,21 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -11,6 +11,7 @@
agenix.url = github:ryantm/agenix; agenix.url = github:ryantm/agenix;
nixos-hardware.url = github:NixOS/nixos-hardware; nixos-hardware.url = github:NixOS/nixos-hardware;
oxalica.url = github:oxalica/rust-overlay; oxalica.url = github:oxalica/rust-overlay;
helix.url = "github:helix-editor/helix";
}; };
outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, oxalica, ... }: with nixpkgs; rec { outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, oxalica, ... }: with nixpkgs; rec {
@ -77,7 +78,7 @@
}; };
overlays = { overlays = {
default = (import ./shared/overlay.nix); default = (import ./shared/overlay.nix args.helix);
}; };
devShells."x86_64-linux"."utils" = let devShells."x86_64-linux"."utils" = let

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, nixpkgs, pwnix, ... }: { pkgs, lib, config, nixpkgs, pwnix, helix, ... }:
let cfg = config.custom.nix; let cfg = config.custom.nix;
@ -9,11 +9,12 @@ in with lib; {
# TODO: Add strawberry as a build machine here # TODO: Add strawberry as a build machine here
config = { config = {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ../overlay.nix) ]; nixpkgs.overlays = [ (import ../overlay.nix helix) ];
nix.extraOptions = '' nix.extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
nix.registry.helix.flake = helix;
nix.registry.pwnix.flake = pwnix; nix.registry.pwnix.flake = pwnix;
nix.settings.trusted-users = [ nix.settings.trusted-users = [
"@wheel" "@wheel"

View file

@ -1,4 +1,4 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, helix, ... }:
(lib.mkIf (!config.isNixos) { (lib.mkIf (!config.isNixos) {
@ -12,7 +12,7 @@
nixpkgs.config = import ./nix-config.nix; nixpkgs.config = import ./nix-config.nix;
nixpkgs.overlays = [ nixpkgs.overlays = [
(import ../../overlay.nix) (import ../../overlay.nix helix)
]; ];
xdg.configFile."nixpkgs/config.nix".source = ./nix-config.nix; xdg.configFile."nixpkgs/config.nix".source = ./nix-config.nix;

View file

@ -1,4 +1,4 @@
final: prev: helix: final: prev:
with (import ./lib.nix final); { with (import ./lib.nix final); {
element-web = webApp "element" "https://riot.badat.dev"; element-web = webApp "element" "https://riot.badat.dev";
@ -10,6 +10,14 @@ with (import ./lib.nix final); {
prev.tor-browser-bundle-bin.override { prev.tor-browser-bundle-bin.override {
useHardenedMalloc = false; useHardenedMalloc = false;
}; };
# We can't just patch it because grammars are fetched at build time.
helix = helix.packages.${prev.stdenv.system}.default.override {
grammarOverlays = [(f: p: {
"rust" = p.rust.overrideAttrs (o: {
rev = "04352146022062c101b8ddd853adf17eadd8cf56";
});
})];
};
# python311Packages.deemix = prev.python311Packages.deemix.overrideAttrs (old: { # python311Packages.deemix = prev.python311Packages.deemix.overrideAttrs (old: {
# patches = [./patch/dont_write_arl.patch]; # patches = [./patch/dont_write_arl.patch];
# }); # });