From cc0bd940c9ff628949ba6b2f65d73b80ffaca1e7 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 5 Jan 2023 18:47:10 +0530 Subject: [PATCH] Upstream to https://github.com/srid/nixpkgs-match --- flake.lock | 72 ++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 1 + systems/darwin.nix | 19 +----------- 3 files changed, 74 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 34aec4e..a1daa1f 100644 --- a/flake.lock +++ b/flake.lock @@ -240,6 +240,24 @@ "type": "github" } }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1672877861, + "narHash": "sha256-ROnSmsk5grROL6gnHBnSdqlPPBrBJMApCeB7xzY567M=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7930f5b1c356270cec420d4f4cb43f4907206640", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-root": { "locked": { "lastModified": 1671378805, @@ -591,6 +609,43 @@ "type": "github" } }, + "nixpkgs-lib_4": { + "locked": { + "dir": "lib", + "lastModified": 1672350804, + "narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-match": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_8" + }, + "locked": { + "lastModified": 1672924430, + "narHash": "sha256-rzMnLkTGxKowPEaI0am4iNouLvYFjYf2rtjV1lou8tw=", + "owner": "srid", + "repo": "nixpkgs-match", + "rev": "8776f12051e0d9c6467df9f1a0728291d10ad441", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "nixpkgs-match", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 0, @@ -682,6 +737,22 @@ "type": "github" } }, + "nixpkgs_8": { + "locked": { + "lastModified": 1672756850, + "narHash": "sha256-Smbq3+fitwA13qsTMeaaurv09/KVbZfW7m7lINwzDGA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "298add347c2bbce14020fcb54051f517c391196b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-utils": "flake-utils_2", @@ -722,6 +793,7 @@ "nixos-shell": "nixos-shell", "nixos-vscode-server": "nixos-vscode-server", "nixpkgs": "nixpkgs_7", + "nixpkgs-match": "nixpkgs-match", "zk-nvim": "zk-nvim" } }, diff --git a/flake.nix b/flake.nix index bb47695..5231845 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,7 @@ comma.url = "github:nix-community/comma"; comma.inputs.nixpkgs.follows = "nixpkgs"; emanote.url = "github:srid/emanote"; + nixpkgs-match.url = "github:srid/nixpkgs-match"; # Emacs emacs-overlay.url = "github:nix-community/emacs-overlay"; diff --git a/systems/darwin.nix b/systems/darwin.nix index 839c1fa..a5c27ec 100644 --- a/systems/darwin.nix +++ b/systems/darwin.nix @@ -14,6 +14,7 @@ nixpkgs-fmt emanote inputs.hci.packages.${system}.hercules-ci-cli + inputs.nixpkgs-match.packages.${system}.default # We must install Agda globally so that Doom-Emacs' agda config can # recognize it. It doesn't matter that our projects use Nix/direnv. @@ -41,24 +42,6 @@ ''; }) - # Spit out the nixpkgs rev pinned by the given flake. - (pkgs.writeShellApplication { - name = "nixpkgs-rev"; - text = '' - NIXPKGS=$(nix flake metadata --json "$1" | jq -r .locks.nodes.root.inputs.nixpkgs) - nix flake metadata --json "$1" | \ - jq -r .locks.nodes."$NIXPKGS".locked.rev - ''; - }) - - (pkgs.writeShellApplication { - name = "nixpkgs-update-using"; - text = '' - REV=$(nixpkgs-rev "$1") - nix flake lock --update-input nixpkgs --override-input nixpkgs github:nixos/nixpkgs/"$REV" - ''; - }) - ]; nix = {