Closed bzm3r closed 8 months ago
Your overlay looks weird. Why aren't you simply overriding the nixpkgs entirely?
Also in your shell.nix
, you probably want to remove the function arguments and put them into a let binding instead.
Generally, I recommend using a build tool like colmena or morph to manage the NixOS configuration, as you then don't need to manually call the rebuild commands in a shell anymore. Many of these tools also support deploying to the local machine.
Your overlay looks weird. Why aren't you simply overriding the nixpkgs entirely?
Because it was (and is) much easier to figure out how to use an overlay, and an override operation is simply an overlay where super
is not used. See:
Overlays are similar to other methods for customizing Nixpkgs, in particular the packageOverrides attribute described in the section called “Modify packages via packageOverrides”. (from: nixpkgs-man)
Also in your shell.nix, you probably want to remove the function arguments and put them into a let binding instead.
Yeah, fair enough. I made this change. (Although I learned that there are some cases where it is useful to have the function argument structure, for the sake of documentation, there's no need to go into that.)
Generally, I recommend using a build tool like colmena or morph to manage the NixOS configuration, as you then don't need to manually call the rebuild commands in a shell anymore. Many of these tools also support deploying to the local machine.
As a newcomer to the Nix ecosystem, I don't find using most third party tooling meant to help make things "more convenient", rather than adding missing functionality (e.g. as npins
does). This is because:
Since the time I opened this issue, I have figured out how to make progress with the help of a guide/example/protocol meant for use with niv
.
It is trivial to convert that example to one for npins
, and I have been using it in practice for the last week. So, to address the issue at hand, I plan on setting up a version of that repo as something that can be linked to by npins
' documentation.
From what I have been able to piece together so far in order to figure out how to use
npins
to manage a NixOS configuration (flake-less):1) Inside configuration.nix, it is necessary to overlay the
nixpkgs
pinned bynpins
:2) Easily building with
nixos-rebuild
requires further steps still (adapted from a solution forniv
), namely the creation of ashell.nix
(possibly using the help ofdirenv
to automatically switch into this shell when entering the the NixOS configuration directory).The
shell.nix
probably looks like this:I am not sure what other packages ought to be/are useful to include in
buildInputs
3) Building a custom live ISO will also need to happen inside this shell.
Am I missing anything else? I'd appreciate some feedback, and if there is interest, would be happy to help submit a PR which adds a small section documenting the above within
README
.