Skip to content

nixos/nix-daemon: Add enable option - #120565

Merged
Ericson2314 merged 1 commit into
NixOS:masterfrom
Ericson2314:nixos-without-nix
Oct 6, 2021
Merged

Ericson2314 merged 1 commit into
NixOS:masterfrom
Ericson2314:nixos-without-nix

Conversation

@Ericson2314

Copy link
Copy Markdown
Member
Motivation for this change

Don't worry, it's is true by default. But I think this is important to
have because NixOS indeed shouldn't need Nix at run time when the
installation is not being modified, and now we can verify that.

NixOS images that cannot "self-modify" are a legitamate
use-case that this supports more minimally. One should be able to e.g. do a
sshfs mount and use nixos-install to modify them remotely, or just
discard them and build fresh ones if they are run VMs or something.

The next step would be to make generations optional, allowing just
baking /etc and friends rather than using activation scripts. But
that's more involved so I'm leaving it out.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Ericson2314
Ericson2314 requested a review from alyssais April 24, 2021 21:25
@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Apr 24, 2021
@lukegb

lukegb commented Apr 25, 2021

Copy link
Copy Markdown
Contributor

I love the concept of this - I've been toying with this idea myself as well. Being able to build a NixOS image using Nix but without Nix in the runtime closure is a super interesting idea.

@Ericson2314

Copy link
Copy Markdown
Member Author

Ugh, i forgot about nixosTests. The layering violation leaves me deeply unsettled.

@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Apr 25, 2021
@tomberek

Copy link
Copy Markdown
Contributor

Is the pkgsFun portion needed to completely remove nix from the closure?

@Ericson2314

Ericson2314 commented Apr 28, 2021 •

Copy link
Copy Markdown
Member Author

@tomberek Well we aren't removing it, but just trying to make sure it isn't used. But maybe we are disciplined about only getting packages from the nixpkgs's pkgs. maybe I should save that part for another time.

Comment thread nixos/tests/without-nix.nix Resolved
@ofborg ofborg Bot removed the 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. label Oct 6, 2021
Don't worry, it's is true by default. But I think this is important to
have because NixOS indeed shouldn't need Nix at run time when the
installation is not being modified, and now we can verify that.

NixOS images that cannot "self-modify" are a legitamate
use-case that this supports more minimally. One should be able to e.g. do a
sshfs mount and use `nixos-install` to modify them remotely, or just
discard them and build fresh ones if they are run VMs or something.

The next step would be to make generations optional, allowing just
baking `/etc` and friends rather than using activation scripts. But
that's more involved so I'm leaving it out.
@Ericson2314
Ericson2314 merged commit c2cf3eb into NixOS:master Oct 6, 2021
@Ericson2314
Ericson2314 deleted the nixos-without-nix branch October 6, 2021 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants