Skip to content

Commit

Permalink
refactor(builders): nixpkgs.flake.source now exists in darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Sep 28, 2024
1 parent 8c88960 commit 32e5838
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions parts/lib/builders.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,26 @@ 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 {
# TODO: learn what this means and why its needed to build the iso
_module.args.modules = [ ];

# we set the systems hostname based on the host value
# which should be a string that is the hostname of the system
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;
})

# The path to the nixpkgs sources used to build the system.
# This is automatically set up to be the store path of the nixpkgs flake used to build
# the system if using lib.nixosSystem, and is otherwise null by default.
# so that means that we should set it to our nixpkgs flake output path
(optionals (target != "darwin") (singleton {
nixpkgs.flake.source = inputs.nixpkgs.outPath;
}))
nixpkgs = {
# 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
hostPlatform = mkDefault system;

# The path to the nixpkgs sources used to build the system.
# This is automatically set up to be the store path of the nixpkgs flake used to build
# the system if using lib.nixosSystem, and is otherwise null by default.
# so that means that we should set it to our nixpkgs flake output path
flake.source = inputs.nixpkgs.outPath;
};
})

# if we are on darwin we need to import the nixpkgs source, its used in some
# modules, if this is not set then you will get an error
Expand Down

0 comments on commit 32e5838

Please sign in to comment.