-
Notifications
You must be signed in to change notification settings - Fork 25
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
Create a nixos module #76
Comments
Yeah, would be cool. Main problem is, that currently
Probably there are more issues, and I am not sure if it’s worth it to fix all those. One other point is, that I don’t know how to write such a module in a way that it actually replaces nix everywhere it’s called. It could only replace nix in the PATH and in known locations, like nixos-rebuild (for which I am uncertain if a PR would be accepted). That might break users expectations when they e.g. run nixpkgs-review which might use an absolute nix path. |
The module could only add a wrapper function to /etc/profile which could be turned off easily with command. |
I have to confess, I don’t exactly understand what you mean with that. |
There are two ways how we could alias nix to nom:
In both cases only subcommands nom understands should be forwarded to it, everything else including when running in a none interactive shell should be handled by nix. |
Somewhat related, I was toying with making a See KoviRobi/nixpkgs@308f84f then an overlay like final: prev:
{
nom-rebuild = (
import
(builtins.getFlake "github:KoviRobi/nixpkgs/308f84ff16cb962de509dc9f2333cc7ddc79aeac")
{ inherit (final) system; }
).nixos-rebuild.overrideAttrs (_: {
name = "nom-rebuild";
nix3_build = "${final.nix-output-monitor}/bin/nom build";
nix_build = "${final.nix-output-monitor}/bin/nom-build";
});
} but this doesn't seem to work, I think it's because the build is being done by |
I just went the easy path and patched nixos-rebuild ;) |
Ah that works because it is still called |
Is there a way to replicate this behavior without having to build a system from a nixpkgs fork with the patched Since this issue is marked as |
Well, the "help wanted" partially relates to the fact that I don’t know exactly how to do it. As a rough sketch two things need to happen: a) We need to figure out how nom should behave. Preferably we do this without breaking anyone's possibility to rebuild their system if nom screws something up. Yeah, #109 and #106 are probably a step in the right direction to solve a). There are obviously solutions for all of this, as various people have found one or another way to implement this for themselves. I just haven’t had the time to look into how to do this "the right way"(tm). |
For b), that's why I created KoviRobi/nixpkgs@308f84f but it's too ugly to merge back I think. Seems like SuperSandro2000/nixpkgs@449114c solves the problem by moving
❯ sh -x nixos-rebuild switch
[...]
+ flakeFlags=(--extra-experimental-features 'nix-command flakes')
[...]
+ nix --extra-experimental-features 'nix-command flakes' build --out-link /tmp/nixos-rebuild.aSGRCq/nixos-rebuild '/home/rmk35/nixos#nixosConfigurations."pc-nixos-a".config.system.build.nixos-rebuild' I suspect the problem is If we could get that patched, then we could merge a simpler version of |
Excellent input, thanks. We can certainly fix that. |
It would be cool if there would be a nixos module which would just enable nom by creating the aliases. It could also maybe hook into nixos-rebuild.
The text was updated successfully, but these errors were encountered: