{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/5725","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/5725/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/5725/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/5725/events","html_url":"https://github.com/NixOS/nixpkgs/issues/5725","id":54034773,"number":5725,"title":"Overriding xorg packages","user":{"login":"saidai-no","id":1191859,"avatar_url":"https://avatars.githubusercontent.com/u/1191859?v=3","gravatar_id":"","url":"https://api.github.com/users/saidai-no","html_url":"https://github.com/saidai-no","followers_url":"https://api.github.com/users/saidai-no/followers","following_url":"https://api.github.com/users/saidai-no/following{/other_user}","gists_url":"https://api.github.com/users/saidai-no/gists{/gist_id}","starred_url":"https://api.github.com/users/saidai-no/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saidai-no/subscriptions","organizations_url":"https://api.github.com/users/saidai-no/orgs","repos_url":"https://api.github.com/users/saidai-no/repos","events_url":"https://api.github.com/users/saidai-no/events{/privacy}","received_events_url":"https://api.github.com/users/saidai-no/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-12T09:43:19Z","updated_at":"2015-01-12T09:58:07Z","closed_at":null,"body":"Is it possible to override xorg packages in `packageOverrides`?\r\n\r\nI was trying to get git version of ati driver with:\r\n```\r\nnixpkgs.config.packageOverrides = pkgs: {\r\n    xorg.xf86videoati = pkgs.lib.overrideDerivation pkgs.xorg.xf86videoati (attrs: attrs // {\r\n      name = \"xf86-video-ati-7.5.99\";\r\n      src = pkgs.fetchgit {\r\n        url = \"git://anongit.freedesktop.org/xorg/driver/xf86-video-ati\";\r\n        rev = \"04da199231bb3f11cf17f94574a8df05855a7b82\";\r\n        sha256 = \"45a76a7019ef503617c58218ced8308ef4fa4355218596ef4d8ea7ecfcb14c5e\";\r\n      };\r\n      preConfigure = ''\r\n        ./autogen.sh\r\n      '';\r\n      buildInputs = attrs.buildInputs ++ [ pkgs.autoreconfHook pkgs.xorg.utilmacros ];\r\n    });\r\n};\r\n```\r\n\r\nbut `nix-rebuild` shows an error:\r\n```shell\r\n$ sudo nixos-rebuild switch --cores 8\r\nbuilding Nix...\r\nerror: attribute ‘libXinerama’ missing, at \"/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/development/libraries/gtk+/2.x.nix\":7:27\r\n(use ‘--show-trace’ to show detailed location information)\r\n```\r\n\r\nForking nixpkgs and changing `pkgs/servers/x11/xorg/overrides.nix` instead of overriding works fine."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/69548149","html_url":"https://github.com/NixOS/nixpkgs/issues/5725#issuecomment-69548149","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/5725","id":69548149,"user":{"login":"vcunat","id":1785925,"avatar_url":"https://avatars.githubusercontent.com/u/1785925?v=3","gravatar_id":"","url":"https://api.github.com/users/vcunat","html_url":"https://github.com/vcunat","followers_url":"https://api.github.com/users/vcunat/followers","following_url":"https://api.github.com/users/vcunat/following{/other_user}","gists_url":"https://api.github.com/users/vcunat/gists{/gist_id}","starred_url":"https://api.github.com/users/vcunat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcunat/subscriptions","organizations_url":"https://api.github.com/users/vcunat/orgs","repos_url":"https://api.github.com/users/vcunat/repos","events_url":"https://api.github.com/users/vcunat/events{/privacy}","received_events_url":"https://api.github.com/users/vcunat/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T09:58:07Z","updated_at":"2015-01-12T09:58:07Z","body":"Well, ``packageOverrides`` is rather tricky when used on attribute sets (such as ``xorg``). The above erases whole ``xorg`` attrmap and puts only that one driver into it. I think this should do what you meant (just two lines added):\r\n\r\n```\r\n  packageOverrides = pkgs: {\r\n    xorg = pkgs.xorg // {\r\n    xf86videoati = pkgs.lib.overrideDerivation pkgs.xorg.xf86videoati (attrs: attrs // {\r\n      name = \"xf86-video-ati-7.5.99\";\r\n      src = pkgs.fetchgit {\r\n        url = \"git://anongit.freedesktop.org/xorg/driver/xf86-video-ati\";\r\n        rev = \"04da199231bb3f11cf17f94574a8df05855a7b82\";\r\n        sha256 = \"45a76a7019ef503617c58218ced8308ef4fa4355218596ef4d8ea7ecfcb14c5e\";\r\n      };\r\n      preConfigure = ''\r\n        ./autogen.sh\r\n      '';\r\n      buildInputs = attrs.buildInputs ++ [ pkgs.autoreconfHook pkgs.xorg.utilmacros ];\r\n    });\r\n  };\r\n  };\r\n```"}}