Skip to content

Instantly share code, notes, and snippets.

@djanatyn
Last active April 7, 2020 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djanatyn/1ccc98297bf49da43590aacd152347b2 to your computer and use it in GitHub Desktop.
Save djanatyn/1ccc98297bf49da43590aacd152347b2 to your computer and use it in GitHub Desktop.
fixing steam in NixOS
# 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