summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.nix16
-rw-r--r--flake.lock16
-rw-r--r--flake.nix3
-rw-r--r--shell.nix16
4 files changed, 50 insertions, 1 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 00000000..d7da8cd1
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,16 @@
+# This file provides backward compatibility to nix < 2.4 clients
+{ system ? builtins.currentSystem }:
+let
+ lock = builtins.fromJSON (builtins.readFile ./flake.lock);
+
+ inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;
+
+ flake-compat = fetchTarball {
+ url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
+ sha256 = narHash;
+ };
+
+ flake = import flake-compat { inherit system; src = ./.; };
+in
+flake.defaultNix
+
diff --git a/flake.lock b/flake.lock
index 1eaf1375..57089a32 100644
--- a/flake.lock
+++ b/flake.lock
@@ -42,6 +42,21 @@
"type": "github"
}
},
+ "flake-compat": {
+ "locked": {
+ "lastModified": 1688025799,
+ "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
+ "owner": "nix-community",
+ "repo": "flake-compat",
+ "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -221,6 +236,7 @@
"root": {
"inputs": {
"charon": "charon",
+ "flake-compat": "flake-compat",
"flake-utils": [
"charon",
"flake-utils"
diff --git a/flake.nix b/flake.nix
index b638d4ee..5d5fae40 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,11 +8,12 @@
flake-utils.follows = "charon/flake-utils";
nixpkgs.follows = "charon/nixpkgs";
hacl-nix.url = "github:hacl-star/hacl-nix";
+ flake-compat.url = "github:nix-community/flake-compat";
};
# Remark: keep the list of outputs in sync with the list of inputs above
# (see above remark)
- outputs = { self, charon, flake-utils, nixpkgs, hacl-nix }:
+ outputs = { self, charon, flake-utils, nixpkgs, hacl-nix, flake-compat }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 00000000..4e0d706e
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,16 @@
+# This file provides backward compatibility to nix < 2.4 clients
+{ system ? builtins.currentSystem }:
+let
+ lock = builtins.fromJSON (builtins.readFile ./flake.lock);
+
+ inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;
+
+ flake-compat = fetchTarball {
+ url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
+ sha256 = narHash;
+ };
+
+ flake = import flake-compat { inherit system; src = ./.; };
+in
+flake.shellNix
+