{"action":"created","issue":{"url":"https://api.github.com/repos/nix-community/NUR/issues/27","repository_url":"https://api.github.com/repos/nix-community/NUR","labels_url":"https://api.github.com/repos/nix-community/NUR/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/nix-community/NUR/issues/27/comments","events_url":"https://api.github.com/repos/nix-community/NUR/issues/27/events","html_url":"https://github.com/nix-community/NUR/pull/27","id":339624505,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMjMzMzY5","number":27,"title":"[WIP] NixOS module support: Separate NUR nixpkgs from repos nixpkgs, avoid callPackages","user":{"login":"Infinisil","id":20525370,"node_id":"MDQ6VXNlcjIwNTI1Mzcw","avatar_url":"https://avatars0.githubusercontent.com/u/20525370?v=4","gravatar_id":"","url":"https://api.github.com/users/Infinisil","html_url":"https://github.com/Infinisil","followers_url":"https://api.github.com/users/Infinisil/followers","following_url":"https://api.github.com/users/Infinisil/following{/other_user}","gists_url":"https://api.github.com/users/Infinisil/gists{/gist_id}","starred_url":"https://api.github.com/users/Infinisil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Infinisil/subscriptions","organizations_url":"https://api.github.com/users/Infinisil/orgs","repos_url":"https://api.github.com/users/Infinisil/repos","events_url":"https://api.github.com/users/Infinisil/events{/privacy}","received_events_url":"https://api.github.com/users/Infinisil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-09T22:09:23Z","updated_at":"2018-07-12T21:34:34Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/nix-community/NUR/pulls/27","html_url":"https://github.com/nix-community/NUR/pull/27","diff_url":"https://github.com/nix-community/NUR/pull/27.diff","patch_url":"https://github.com/nix-community/NUR/pull/27.patch"},"body":"This is essential to get modules in NUR to work. By taking a separate\r\nargument for NUR's nixpkgs (for fetchgit, fetchzip and lib), we don't\r\nneed to evaluate the nixpkgs used for repos.\r\n\r\nThis also implies that you won't be able to `callPackage` NUR anymore,\r\nand instead you'll have to use `import (builtins.fetchGit \".../NUR\") {\r\ninherit pkgs; }` instead. Doing this also prevents the evaluation of\r\npkgs. In case of NixOS, this pkgs depends on your whole config, which is\r\nthe source of the recursion. Evaluating this at the last possible moment\r\nis key.\r\n\r\nThis also means that you won't be able to take package arguments in a\r\nrepo definition, you instead get just `pkgs`, also to avoid evaluation\r\nof it.\r\n\r\nNew install instructions would be\r\n```nix\r\n{\r\n  packageOverrides = pkgs: {\r\n    nur = import (builtins.fetchGit \"https://github.com/nix-community/NUR\") {\r\n      inherit pkgs;\r\n    };\r\n  };\r\n}\r\n```\r\n\r\nTo get NixOS modules to work you'll have to use something like\r\n```nix\r\n{ pkgs, ... }:\r\nlet\r\n  nur = import (builtins.fetchGit \"https://github.com/nix-community/NUR\") {\r\n    inherit pkgs;\r\n  };\r\nin {\r\n  imports = [\r\n    nur.repos.infinisil.module\r\n  ];\r\n}\r\n```\r\n\r\nPreferably one would set `nur=https://github.com/nix-community/NUR` in their NIX_PATH, which allows one to do\r\n```nix\r\n{ pkgs, ... }: {\r\n  imports = [\r\n    (import <nur> { inherit pkgs; }).repos.infinisil.module\r\n  ];\r\n}\r\n```\r\n\r\nAlso the pkgs argument should be made optional, so you don't even need to pass it when importing a module.\r\n\r\nDocs and stuff would need to be updated, I might do this later."},"comment":{"url":"https://api.github.com/repos/nix-community/NUR/issues/comments/404658012","html_url":"https://github.com/nix-community/NUR/pull/27#issuecomment-404658012","issue_url":"https://api.github.com/repos/nix-community/NUR/issues/27","id":404658012,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDY1ODAxMg==","user":{"login":"Infinisil","id":20525370,"node_id":"MDQ6VXNlcjIwNTI1Mzcw","avatar_url":"https://avatars0.githubusercontent.com/u/20525370?v=4","gravatar_id":"","url":"https://api.github.com/users/Infinisil","html_url":"https://github.com/Infinisil","followers_url":"https://api.github.com/users/Infinisil/followers","following_url":"https://api.github.com/users/Infinisil/following{/other_user}","gists_url":"https://api.github.com/users/Infinisil/gists{/gist_id}","starred_url":"https://api.github.com/users/Infinisil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Infinisil/subscriptions","organizations_url":"https://api.github.com/users/Infinisil/orgs","repos_url":"https://api.github.com/users/Infinisil/repos","events_url":"https://api.github.com/users/Infinisil/events{/privacy}","received_events_url":"https://api.github.com/users/Infinisil/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T21:34:34Z","updated_at":"2018-07-12T21:34:34Z","author_association":"NONE","body":"Yeah that sounds like a good idea. Should we also disallow defaulted arguments though? E.g. `{ pkgs, lib ? pkgs.lib }: { ... }` is quiet useful."}}
{"actor":{"display_login":"Infinisil"}}