-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
purism/librem/5r4: make it usuable without an overlay #932
Conversation
Hiding packages in let ins blocks any overlays and you have no way to access the package without reimporting it (if that is possible). I think you are the only person I know which hacks around overlays like that and we've seen in the past, that silently overwriting any option under nixpkgs. is not that great or straight forward. |
Hiding overlays inside a NixOS is also not great, because you if you use flakes you will always end up with two nixpkgs instances, if you also include packages imported in your flake: inputs.nixpkgs.url = "github:foo/nixpkgs";
inputs.some-package-flake.url = "github:Mic92/some-package-flake";
inputs.some-package-flake.follows = "nixpkgs";
outputs = { nixpkgs, some-package-flake, ... }: {
nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
modules = [
{
# This is the second copy of nixpkgs, NixOS creates the other copy with `nixpkgs.overlays`
# It's also inconsistent because nixpkgs.overlays is applied in one case but not the other.
environment.systemPackages = [ inputs.some-package-flake.packages.mypackage ];
}
];
};
}; How do solve that? Also each overlay makes nixpkgs signifantly slower. Here is a micro benchmark: # ./hello.nix
with import <nixpkgs> {
overlays = [];
};
hello And than with 10, 20, 30 overlays: # ./hello-slow10.nix
with import <nixpkgs> {
overlays = builtins.map (_:
(self: super: {
foo = super.foo.overrideAttrs (oldAttrs: {});
})) [ 1 2 3 4 5 6 7 8 9 10 ];
};
hello Here is the benchmark when running with [hyperfine] like this: taskset -c 0 hyperfine "nix-instantiate ./hello.nix" "nix-instantiate ./hello-slow10.nix" "nix-instantiate ./hello-slow20.nix" "nix-instantiate ./hello-slow30.nix"
|
Most large scale deployments of NixOS are not so open in the public, but it's certainly a well-known trick to get 30% faster evaluation speeds even if you just have 5 machines. |
@SuperSandro2000 Please check again. Packages are now accessible through NixOS options. |
|
||
nixpkgs.hostPlatform = "armv7l-linux"; | ||
|
||
boot.initrd.availableKernelModules = [ "ahci_mvebu" ]; | ||
|
||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_5_15_helios4; | ||
boot.kernelPackages = pkgs.linuxPackagesFor linux_5_15_helios4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux kernels should be always accessed via config.kernelPackages.kernel
, so no need for an overlay here.
in { | ||
options = { | ||
hardware.librem5 = { | ||
package = lib.mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With that the package is no longer hidden.
that looks a lot better. Thanks for taking that time. |
@mergify queue |
☑️ GitHub can't merge the pull request for now.GitHub can't merge the pull request for an unknown reason. You should retry later. |
@mergify rebase |
In larger installations nixpkgs.overlays adds significant overhead because it's harder to share nixpkgs between different NixOS machines i.e. using nixpkgs.pkgs
Note that the linux kernel can and should be accessed through config.kernelPackages.kernel.
✅ Branch has been successfully rebased |
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at a4e2b79 |
In larger installations nixpkgs.overlays adds significant overhead because it's harder to share nixpkgs between different NixOS machines i.e. using nixpkgs.pkgs
Description of changes
Things done
nixos-hardware
andimporting it via
<nixos-hardware>
or Flake input