From 3f23792df0ac565d702c757cf95c21642d1d7d0b Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Thu, 16 Feb 2023 20:31:02 +0700
Subject: [PATCH] use the recommended way of using flake-compat

---
 default.nix | 17 +++++++----------
 flake.lock  | 17 +++++++++++++++++
 flake.nix   |  6 +++++-
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/default.nix b/default.nix
index 5cf1b78..2cccff2 100644
--- a/default.nix
+++ b/default.nix
@@ -1,13 +1,10 @@
-(
-  import
+(import
   (
-    builtins.fetchTarball {
-      url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
-      sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
+    let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
+    fetchTarball {
+      url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
+      sha256 = lock.nodes.flake-compat.locked.narHash;
     }
   )
-  {
-    src = ./.;
-  }
-)
-.defaultNix
+  { src = ./.; }
+).defaultNix
diff --git a/flake.lock b/flake.lock
index 7920067..b10c9bf 100644
--- a/flake.lock
+++ b/flake.lock
@@ -19,6 +19,22 @@
         "type": "github"
       }
     },
+    "flake-compat": {
+      "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-utils": {
       "locked": {
         "lastModified": 1642700792,
@@ -84,6 +100,7 @@
     "root": {
       "inputs": {
         "devshell": "devshell",
+        "flake-compat": "flake-compat",
         "flake-utils": "flake-utils_2",
         "nixpkgs": "nixpkgs_2"
       }
diff --git a/flake.nix b/flake.nix
index ca27d59..97f4ed5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,9 +5,13 @@
     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
     devshell.url = "github:numtide/devshell";
     flake-utils.url = "github:numtide/flake-utils";
+    flake-compat = {
+      url = "github:edolstra/flake-compat";
+      flake = false;
+    };
   };
 
-  outputs = { self, flake-utils, devshell, nixpkgs }:
+  outputs = { self, flake-utils, devshell, nixpkgs, flake-compat }:
     let
       inherit (nixpkgs) lib;
       genSystems = lib.genAttrs [