From 15d7ee22b1f4b47ccfa52027b8716020b9410b3d Mon Sep 17 00:00:00 2001 From: aftix Date: Sun, 16 Mar 2025 14:57:01 -0500 Subject: [PATCH] default.nix: Updated use of flake-compat I have added flake-compat to be pinned by flake.lock, updated the source to the still-maintained nix-community repo, and removed the URL literal syntax. --- default.nix | 13 ++++++++++--- flake.lock | 16 +++++++++------- flake.nix | 5 ++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/default.nix b/default.nix index d4c7ec292..d41aa2945 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,13 @@ # The `default.nix` in flake-compat reads `flake.nix` and `flake.lock` from `src` and # returns an attribute set of the shape `{ defaultNix, shellNix }` -(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { - src = ./.; -}).defaultNix +(import ( + let + inherit (lock.nodes.flake-compat.locked) narHash rev; + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/nix-community/flake-compat/archive/${rev}.tar.gz"; + sha256 = narHash; + } +) { src = ./.; }).defaultNix diff --git a/flake.lock b/flake.lock index a98d73a53..9471c1f87 100644 --- a/flake.lock +++ b/flake.lock @@ -1,24 +1,25 @@ { "nodes": { "flake-compat": { - "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", "type": "github" }, "original": { - "owner": "edolstra", + "owner": "nix-community", "repo": "flake-compat", "type": "github" } }, "lix": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": [ + "flake-compat" + ], "nix2container": "nix2container", "nixpkgs": [ "nixpkgs" @@ -106,6 +107,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "lix": "lix", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index fd17a4b6f..06f1c8a70 100644 --- a/flake.nix +++ b/flake.nix @@ -5,8 +5,11 @@ inputs.lix.url = "git+https://git.lix.systems/lix-project/lix"; inputs.lix.inputs.nixpkgs.follows = "nixpkgs"; + inputs.lix.inputs.flake-compat.follows = "flake-compat"; - outputs = { self, nixpkgs, lix }: + inputs.flake-compat.url = "github:nix-community/flake-compat"; + + outputs = { self, nixpkgs, lix, ... }: let systems = [ "x86_64-linux" "aarch64-linux" ]; forEachSystem = nixpkgs.lib.genAttrs systems;