{"action":"opened","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/42964","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/42964/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/42964/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/42964/events","html_url":"https://github.com/NixOS/nixpkgs/issues/42964","id":338102166,"node_id":"MDU6SXNzdWUzMzgxMDIxNjY=","number":42964,"title":"Feature request: allow for binary caches that are only optionally available","user":{"login":"cumber","id":63795,"node_id":"MDQ6VXNlcjYzNzk1","avatar_url":"https://avatars1.githubusercontent.com/u/63795?v=4","gravatar_id":"","url":"https://api.github.com/users/cumber","html_url":"https://github.com/cumber","followers_url":"https://api.github.com/users/cumber/followers","following_url":"https://api.github.com/users/cumber/following{/other_user}","gists_url":"https://api.github.com/users/cumber/gists{/gist_id}","starred_url":"https://api.github.com/users/cumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cumber/subscriptions","organizations_url":"https://api.github.com/users/cumber/orgs","repos_url":"https://api.github.com/users/cumber/repos","events_url":"https://api.github.com/users/cumber/events{/privacy}","received_events_url":"https://api.github.com/users/cumber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-04T01:31:46Z","updated_at":"2018-07-04T01:31:46Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have a laptop and a desktop both running Nixos. To save downloads and building, I have the desktop configured to use `services.nix-serve`, and the laptop configured with the desktop's as a binary cache. This is only a local host name on my home network, since my desktop isn't globally available (and if I'm going to download something over the global internet, it might as well be from cache.nixos.org).\r\n\r\nFor the most part this works great; I make a point of running updates on the laptop when I'm at home, after updating the desktop.\r\n\r\nThe major pain point is when I need to update dev environments or use ad-hoc nix shells on the laptop while I'm away from home. Being unable to connect to my desktop's local hostname completely blocks realising nix store paths; it doesn't consider other binary caches or local building as a fallback. I have to either manually add `--option binary-caches https://cache.nixos.org/` to every nix command where I'm away from home, or list my desktop only in `nix.trustedBinaryCaches` and add `--option binary-caches https://my.desktop.machine` to every nix command when I am at home. \r\n\r\nOne thing that would address this problem would be a way to disable a specific binary cache for each command without overriding the whole list of them, or a single flag to rest to the default list (so I don't have to remember the exact spelling of the binary cache names; the slash on the end of `https://cache.nixos.org/` gets me every time, for example).\r\n\r\nBut much better would be a way to mark a binary cache as *optional* in the nixos configuration (or another list of binary caches in between `nix.binaryCaches` and `nix.trustedBinaryCaches`). Such caches should be used by default if available, but unavailability should not be treated as an error.\r\n\r\nThen I could have all of my nix machines running `services.nix-serve` and all listing each other as optional caches, and whichever ones happen to be powered on, reachable, and have the packages I'm installing would transparently speed up my installations on other machines, but I wouldn't have to manage the process at all."}}
{"actor":{"display_login":"cumber"}}