-
Notifications
You must be signed in to change notification settings - Fork 108
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
iso: only include the host's dependencies #197
Changes from all commits
b420ed9
91883d0
ca8f8ef
85b3978
89ce077
35906f2
04a882f
b632880
48a998c
16ea493
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,19 @@ | |
lib.nixosSystem (args // { | ||
modules = | ||
let | ||
moduleList = builtins.attrValues modules; | ||
modpath = "nixos/modules"; | ||
cd = "installer/cd-dvd/installation-cd-minimal-new-kernel.nix"; | ||
|
||
hostConfig = (lib.nixosSystem (args // { modules = moduleList; })).config; | ||
|
||
isoConfig = (lib.nixosSystem | ||
(args // { | ||
modules = modules ++ [ | ||
modules = moduleList ++ [ | ||
"${nixos}/${modpath}/${cd}" | ||
({ config, ... }: { | ||
({ config, suites, ... }: { | ||
disabledModules = lib.remove modules.core suites.allProfiles; | ||
|
||
isoImage.isoBaseName = "nixos-" + config.networking.hostName; | ||
isoImage.contents = [{ | ||
source = self; | ||
|
@@ -20,7 +25,10 @@ lib.nixosSystem (args // { | |
nix.registry = lib.mapAttrs (n: v: { flake = v; }) inputs; | ||
isoImage.storeContents = [ | ||
self.devShell.${config.nixpkgs.system} | ||
hostConfig.system.build.toplevel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this is actually redundant: https://github.com/NixOS/nixpkgs/blob/a6155fc19e31fe0a49b75409d02a2d8b6bb97aa0/nixos/modules/installer/cd-dvd/iso-image.nix#L627-L638 and we need to remove the They are equivalent to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh I see, fixed in latest commit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does includeSystemBuildDependencies mean? I would assume if you pass the toplevel, that would include all buildInputs for that store path. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also remove the
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-dvd/iso-image.nix#L482-L486 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are you talking about this line: https://github.com/NixOS/nixpkgs/blob/a6155fc19e31fe0a49b75409d02a2d8b6bb97aa0/nixos/modules/installer/cd-dvd/iso-image.nix#L630? That would get the toplevel of the isoConfig. Which won't include the profiles that have been disabled. And the goal is to include the profile's closure, just without including them in the config. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, just realized that my self and renamed to |
||
]; | ||
environment.systemPackages = hostConfig.environment.systemPackages; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the rationale (use case) for this again? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well by including the hostConfig toplevel, all packages are now in the nix store. So I thought as convenience we could just forward to the environment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm actually not sure if we can include the toplevel derivation, it takes a lot more time to produce the squashfs, now. Well, maybe we can leave it, but open an issue in search for a better solution (eg. w/o compression?). So we might just leave this line, as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm currently attempting to build and I see what you mean. If this PR increases the time to build or the iso size by a lot, it might not be the best solution. Perhaps we could just forward the systemPackages and not include the toplevel build. Or we could add a separate build that has the entire toplevel. So one for network install and one that includes everything making an offline install possible. |
||
|
||
# confilcts with networking.wireless which might be slightly | ||
# more useful on a stick | ||
networking.networkmanager.enable = lib.mkForce false; | ||
|
@@ -58,7 +66,7 @@ lib.nixosSystem (args // { | |
]; | ||
})).config; | ||
in | ||
modules ++ [{ | ||
moduleList ++ [{ | ||
system.build = { | ||
iso = isoConfig.system.build.isoImage; | ||
}; | ||
|
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.
We should be able to add
drvPath
for devshell, as well, fixing #195, shall we?Not meaning to block this PR, though.
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.
x-ref: Pacman99#2 (also going to test that)
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.
good idea, merged!, But will that really cache evaluations? I thought evaluation caches were sqlite databases in your home directory. I remember it being a series of sqlite db's with hashe's as names
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.
I believe @Pacman99 is right about the evaluation cache. I've been struggling with how to clear the dang thing for a while now. Pretty annoying when the error message for a failed derivation just becomes the generic:
failure of cached attribute
I know I found it's exact location once in order to clear it, but now I can't seem to find it. If it is still in the home dir, perhaps we could make some clever use of home-manager to include it.
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.
Ohh for me its in
~/.cache/nix/eval-cache-v2
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.
you should be able to safely delete that since its just evaluations that can be done again