Skip to content

Commit

Permalink
fix: correct iso builds
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Aug 15, 2024
1 parent c1fc8de commit ea662d1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions parts/lib/builders.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ let
target ? "nixos",
modules ? [ ],
specialArgs ? { },
...
}@args:
}:
let
system = if (target == "iso" || target == "nixos") then "${arch}-linux" else "${arch}-${target}";
in
Expand All @@ -62,7 +61,7 @@ let
inherit lib;
inherit self self';
inherit inputs inputs';
} args.specialArgs;
} specialArgs;

# A nominal type for modules. When set and non-null, this adds a check to
# make sure that only compatible modules are imported.
Expand All @@ -75,7 +74,7 @@ let

# configurations based on that are imported based hostname,
# these don't exist for iso systems (at the moment) so we ignore those
(optionals (target != "iso") [ "${self}/systems/${args.host}/default.nix" ])
(optionals (target != "iso") [ "${self}/systems/${host}/default.nix" ])

# get an installer profile from nixpkgs to base the Isos off of
# this is useful because it makes things alot easier
Expand All @@ -93,8 +92,11 @@ let
"${inputs.nixpkgs}/nixos/modules/module-list.nix"
))

# TODO: learn what this means and why its needed to build the iso
(singleton { _module.args.modules = [ ]; })

(singleton {
networking.hostName = args.host;
networking.hostName = host;
# you can also do this as `inherit system;` with the normal `lib.nixosSystem`
# however for evalModules this will not work, so we do this instead
nixpkgs.hostPlatform = mkDefault system;
Expand Down Expand Up @@ -126,7 +128,8 @@ let
};
}))

args.modules
# import any additional modules that the user has provided
modules
];
};
in
Expand Down

0 comments on commit ea662d1

Please sign in to comment.