From c4b13eb043e8a94c2ecdddd710c01f2b908ab4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 21 Jun 2023 14:49:21 +0200 Subject: [PATCH] nix: use builtins to not depend on channels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use `builtins.fetchTarball` to avoid having to first import a `nixpkgs` from existing channels, which breaks if there are no channels. Otherwise new Nix 2.14 version can result in: ``` error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I) ``` Which happens due to no default `nixpkgs` channel existing: ``` > nix-channel --list ``` Resolves: https://github.com/status-im/status-mobile/issues/16342 Signed-off-by: Jakub SokoĊ‚owski --- nix/pkgs.nix | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/nix/pkgs.nix b/nix/pkgs.nix index 17db8c82fe..a8e3292474 100644 --- a/nix/pkgs.nix +++ b/nix/pkgs.nix @@ -3,20 +3,13 @@ { config ? { } }: let - inherit (import { }) fetchFromGitHub; - # For testing local version of nixpkgs #nixpkgsSrc = (import { }).lib.cleanSource "/home/jakubgs/work/nixpkgs"; # We follow the master branch of official nixpkgs. - nixpkgsSrc = fetchFromGitHub { - name = "nixpkgs-source"; - owner = "NixOS"; - repo = "nixpkgs"; - rev = "e7603eba51f2c7820c0a182c6bbb351181caa8e7"; - sha256 = "sha256-XJZ/o17eOd2sEsGif+/MQBnfa2DKmndWgJyc7CWajFc="; - # To get the compressed Nix sha256, use: - # nix-prefetch-url --unpack https://github.com/${ORG}/nixpkgs/archive/${REV}.tar.gz + nixpkgsSrc = builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/e7603eba51f2c7820c0a182c6bbb351181caa8e7.tar.gz"; + sha256 = "sha256:0mwck8jyr74wh1b7g6nac1mxy6a0rkppz8n12andsffybsipz5jw"; }; # Status specific configuration defaults