From 320dfbaef243c321902902429bce3775dc733c7c Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 15 Apr 2024 13:01:30 -0500 Subject: [PATCH] fix: ensure treesitter parsers are picked up in nix git submodules --- flake.lock | 26 ++++++++++++++++++++++---- flake.nix | 16 ++++++++++++++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 9f8de0a..4600bfc 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1712963716, + "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", "type": "github" }, "original": { @@ -37,7 +37,25 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "self": "self" + } + }, + "self": { + "flake": false, + "locked": { + "dirtyRev": "b8df40f1494c211c36bf1426a249bf8c448066d5-dirty", + "dirtyShortRev": "b8df40f-dirty", + "lastModified": 1712945559, + "narHash": "sha256-4VxNKgCoj8j67p/g/ED4CODyw/91zteY6NrjH6UxF78=", + "submodules": true, + "type": "git", + "url": "file:./." + }, + "original": { + "submodules": true, + "type": "git", + "url": "file:./." } }, "systems": { diff --git a/flake.nix b/flake.nix index 33bfe92..27b2011 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,25 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = github:numtide/flake-utils; + flake-utils.url = "github:numtide/flake-utils"; + self = { + flake = false; + type = "git"; + url = "git+file:./.?submodules=1"; + }; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; + # src = builtins.fetchGit { + # url = ./.; + # # inherit (self) (rev or dirtyRev); + # rev = toString (self.rev or self.dirtyRev); + # # shallow = true; + # submodules = true; + # }; rust-toolchain = pkgs.symlinkJoin { name = "rust-toolchain"; paths = with pkgs; [ @@ -25,7 +37,7 @@ # shoves the newly created static site into the result. packages.default = pkgs.rustPlatform.buildRustPackage { name = "blog"; - src = ./.; + src = "${self}"; cargoLock.lockFile = ./Cargo.lock; postBuild = '' ./target/*/release/blog