enable cachix and patch nix

This commit is contained in:
Dmitriy Kholkin 2021-09-28 01:49:57 +03:00
parent e0fb0cdab0
commit 09589e890c
2 changed files with 23 additions and 2 deletions

View File

@ -1,7 +1,15 @@
{ config, lib, pkgs, inputs, ... }: {
nix = rec {
nixPath = lib.mkForce [ "self=/etc/self/compat" "nixpkgs=/etc/nixpkgs" ];
binaryCaches = [ "https://cache.nixos.org" ];
binaryCaches = [
"https://cache.nixos.org"
"https://nixos-rocm.cachix.org"
"https://nix-community.cachix.org"
];
binaryCachePublicKeys = [
"nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
registry.self.flake = inputs.self;
registry.nixpkgs.flake = inputs.nixpkgs;
@ -13,7 +21,7 @@
autoOptimiseStore = false;
package = inputs.nix.packages.x86_64-linux.nix.overrideAttrs (oa: {
patches = [./nix.patch] ++ oa.patches or [];
patches = [ ./nix.patch ./flakes.patch ] ++ oa.patches or [];
});
extraOptions = ''

13
profiles/nix/flakes.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/nix/get-env.sh b/src/nix/get-env.sh
index 42c806450..a8563c772 100644
--- a/src/nix/get-env.sh
+++ b/src/nix/get-env.sh
@@ -8,6 +8,8 @@ if [[ -n $stdenv ]]; then
source $stdenv/setup
fi
+unset -f isMachO
+
# Better to use compgen, but stdenv bash doesn't have it.
__vars="$(declare -p)"
__functions="$(declare -F)"