Merge #202
202: iso: avoid systemd service startup r=nrdxp a=blaggacao fixes #194 alternative to #197 # Manual Tests <details> <summary>was unrelated</summary> - [ ] `flk install NixOS --impure` correctly onto `/mnt` ❎ (looks like no profile is present) Issue: https://github.com/divnix/devos/issues/204 Upstream Issue: https://github.com/NixOS/nixpkgs/issues/116938 </details> - [x] acceptable build time / closure size ca 850MB (for a simple base OS) ✔️ - [x] local profile with `cage` service is disabled, that is: boots into terminal ✔️ - [x] success: air gapped / offline devshell enter ✔️ - [ ] failure: aire gapped target install: ← non blocking bonus item ❎ ```console $ flk install POS warning: you don't have internet access; disabling some network-dependent features building the flake in path:/iso/devos?narHash=sha265-... warning: you don't have internet access; disabling some network-dependent features error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/df8e3...': Couldn't resolve host name (6) ``` → detailed rationale in the commit messages ❤️ @Pacman99 for the excellent and detailed discussions in #197 and the may ideas, suggestions and code. Co-authored-by: David Arnold <dar@xoe.solutions>
This commit is contained in:
commit
870897a3e9
|
@ -6,27 +6,42 @@ lib.nixosSystem (args // {
|
|||
let
|
||||
moduleList = builtins.attrValues modules;
|
||||
modpath = "nixos/modules";
|
||||
cd = "installer/cd-dvd/installation-cd-minimal-new-kernel.nix";
|
||||
|
||||
fullHostConfig = (lib.nixosSystem (args // { modules = moduleList; })).config;
|
||||
|
||||
isoConfig = (lib.nixosSystem
|
||||
(args // {
|
||||
modules = moduleList ++ [
|
||||
"${nixos}/${modpath}/${cd}"
|
||||
({ config, ... }: {
|
||||
|
||||
"${nixos}/${modpath}/installer/cd-dvd/installation-cd-minimal-new-kernel.nix"
|
||||
|
||||
({ config, suites, ... }: {
|
||||
|
||||
# avoid unwanted systemd service startups
|
||||
disabledModules = lib.remove modules.core suites.allProfiles;
|
||||
|
||||
nix.registry = lib.mapAttrs (n: v: { flake = v; }) inputs;
|
||||
|
||||
isoImage.isoBaseName = "nixos-" + config.networking.hostName;
|
||||
isoImage.contents = [{
|
||||
source = self;
|
||||
target = "/devos/";
|
||||
}];
|
||||
nix.registry = lib.mapAttrs (n: v: { flake = v; }) inputs;
|
||||
isoImage.storeContents = [
|
||||
self.devShell.${config.nixpkgs.system}
|
||||
# include also closures that are "switched off" by the
|
||||
# above profile filter on the local config attribute
|
||||
fullHostConfig.system.build.toplevel
|
||||
];
|
||||
# still pull in tools of deactivated profiles
|
||||
environment.systemPackages = fullHostConfig.environment.systemPackages;
|
||||
|
||||
# confilcts with networking.wireless which might be slightly
|
||||
# more useful on a stick
|
||||
networking.networkmanager.enable = lib.mkForce false;
|
||||
# confilcts with networking.wireless
|
||||
networking.wireless.iwd.enable = lib.mkForce false;
|
||||
|
||||
# Set up a link-local boostrap network
|
||||
# See also: https://github.com/NixOS/nixpkgs/issues/75515#issuecomment-571661659
|
||||
networking.usePredictableInterfaceNames = lib.mkForce true; # so prefix matching works
|
||||
|
|
|
@ -27,7 +27,7 @@ let mkProfileAttrs =
|
|||
f = n: _:
|
||||
lib.optionalAttrs
|
||||
(lib.pathExists "${dir}/${n}/default.nix")
|
||||
{ default = "${dir}/${n}"; }
|
||||
{ default = /. + "${dir}/${n}"; }
|
||||
// mkProfileAttrs "${dir}/${n}";
|
||||
in
|
||||
lib.mapAttrs f imports;
|
||||
|
|
Loading…
Reference in a new issue