diff --git a/flake.lock b/flake.lock index 5c3d11b..0d97769 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,22 @@ { "nodes": { "flake-compat": { + "locked": { + "lastModified": 1709944340, + "narHash": "sha256-xr54XK0SjczlUxRo5YwodibUSlpivS9bqHt8BNyWVQA=", + "owner": "9999years", + "repo": "flake-compat", + "rev": "baa7aa7bd0a570b3b9edd0b8da859fee3ffaa4d4", + "type": "github" + }, + "original": { + "owner": "9999years", + "ref": "baa7aa7", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -259,7 +275,7 @@ }, "nix-wsl": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" @@ -368,6 +384,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "home-manager": "home-manager", "home-manager-unstable": "home-manager-unstable", "hyprland": "hyprland", diff --git a/flake.nix b/flake.nix index dcade92..49c141f 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # edolstra/flake-compat#64 + flake-compat.url = "github:9999years/flake-compat/baa7aa7"; + nixfiles-assets = { # using self-hosted gitea mirror because of GitHub LFS bandwidth limit (even though i'd probably never hit it) type = "git"; @@ -63,6 +66,31 @@ lib = nixpkgs.lib; systems = [ "x86_64-linux" "aarch64-linux" ]; + # absolutely grotesque workaround for NixOS/nix#4623 + nixfiles-assets-grotesque-lfs-workaround = eachSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + # we have to define a flake-compat version of this flake because + # referencing an input directly seems to evaluate it when we only want + # the narHash from flake.lock + self-fc = (import inputs.flake-compat {src = ./.; inherit system; }).defaultNix; + srcWithLFS = pkgs.fetchgit { + inherit (self-fc.inputs.nixfiles-assets) rev; + + # flake inputs don't expose the URL for some reason so we have to define it again here + url = "https://gitea.protogen.io/nullbite/nixfiles-assets"; + + # you need to run `nix flake update` on a user with Git LFS already + # configured (i am assuming?? it seems to work if i lock the flake as + # my current user but not root, which doesn't have LFS configured) + hash = self-fc.inputs.nixfiles-assets.narHash; + fetchLFS = true; + }; + trace = builtins.trace "warning: we're still using this awful LFS workaround"; + in + trace (import inputs.flake-compat { src = srcWithLFS; inherit system; }).defaultNix + ); + overlays = [ /* android-tools 33.0.3p2 */ (final: prev: { inherit (inputs.pkg-android-tools.legacyPackages.${final.system}) @@ -80,7 +108,8 @@ inputs.hyprwm-contrib.overlays.default inputs.rust-overlay.overlays.default - inputs.nixfiles-assets.overlays.default + # inputs.nixfiles-assets.overlays.default + (final: prev: { inherit (nixfiles-assets-grotesque-lfs-workaround.${prev.system}.packages.${prev.system}) nixfiles-assets; }) ]; ### Configuration