Last active
April 7, 2020 07:42
-
-
Save djanatyn/1ccc98297bf49da43590aacd152347b2 to your computer and use it in GitHub Desktop.
fixing steam in NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all mirrors in pkgs/build-support/fetchurl/mirrors.nix for steamrt are currently down or returning 404s | |
# used https://gist.github.com/msteen/6741878f8919f8e2363869693e7ef085 as an example | |
{ config, pkgs, options, ... }: | |
let | |
upstream = | |
import (/home/djanatyn/repos/nixpkgs) { config = config.nixpkgs.config; }; | |
in { | |
imports = [ ./hardware-configuration.nix ]; | |
# nix.nixPath = options.nix.nixPath.default ++ [ | |
# "nixos-19.09=/nix/var/nix/profiles/per-user/root/channels/nixos-19.09" | |
# ]; | |
nixpkgs.overlays = [ | |
(self: super: | |
with builtins; rec { | |
mirrorsPath = self.path + /pkgs/build-support/fetchurl/mirrors.nix; | |
customMirrors = import mirrorsPath // { | |
steamrt = [ "https://mirrors.tuna.tsinghua.edu.cn/steamos/steamrt/" ]; | |
}; | |
customImport = scopedImport { | |
import = path: | |
if path == self.mirrorsPath then | |
self.customMirrors | |
else | |
self.customImport path; | |
}; | |
fetchurl = (self.customImport self.path { }).fetchurl; | |
}) | |
]; | |
nixpkgs.config.allowUnfree = true; | |
nixpkgs.config = { | |
packageOverrides = pkgs: { | |
upstream = import upstream { config = config.nixpkgs.config; }; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment