[Nix-dev] A call for hardware configurations

Ericson, John john_ericson at brown.edu
Wed Feb 10 20:51:34 CET 2016


This is a great idea, and I'll be happy to contribute to it! I hope
this could really be a killer draw for new users, maybe even those new
to Linux. While the NixOS installation procedure isn't so fancy, being
reliable over a GUI install that's easy until something hard to debug
goes wrong give us some advantage. Somethings things to think about:

1. It might be good to use `findFirst` to select from stable/default
and unstable/bespoke arguments. For example on my laptop I am
currently using `linuxPackages_latest` because 4.4 seems to be
necessary, and I hope the next version will be fix more things. But
rather than bake in `linuxPackage_4_4`, or `linuxPackages_latest`, I'd
think the most robust thing would be something like:

  findFirst
    (p: builtins.compareVersions p.version "4.4" >= 0)
    (assert false "no adiquate kernel avilable"; null)
    [ linuxPackages linuxPackages_4_4 linuxPackages_latest ]

That way we only break from the default/stable when necessary.

2. Beware of caching generated results. Already I have a branch of
just stock-generated configuration.nix I merge my config team to time,
lest some default I kept around is no longer considered best practice.
Likewise I try to see what I can do so the generated
hardware-configuration.nix is valid, and I now don't even both to
stick it in version control as I've had good luck with it on multiple
machines. There's a tension between wanting to really freeze a good
configuration in place (the logical extreme would also include pinning
a version of nixpkgs), and the maintenance burden of little-used
configs assuming the generated defaults that best/apply to older
nixpkgs. I know we try to be backwards compatible with nixos settings,
and that's great, but I'd feel bad making the need for backwards
comparability greater. Not really sure what the ideal solution is.

3. For PCs, many things are contingent on firmware settings which
unfortunately we do not (can not?) control. A convention for guides on
how to setup ones firmware before installing nix would be nice.

On Mon, Feb 8, 2016 at 3:50 AM, Emery Hemingway <emery at vfemail.net> wrote:
> Garbas and I were talking about hardware at the last Berlin Nix meetup and
> the idea came up that the community might be ready for a collection of
> model specific hardware configurations. Git repositories are vastly easier
> to manage than wikis, so I went and created one.
>
> https://github.com/ehmry/nixos-hardware
>
> This will just be a collection of standalone modules to import into
> configuration.nix, and is not intended to merge with nixpkgs. Suggestions
> are solicited for shipping the configurations to machines. Importing by
> a channel and <...> would be nice, but I don't know how to do it.
>
> I'm not a hardware guru, but I'm willing to handle pull requests.
>
> Emery
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>


More information about the nix-dev mailing list