forked from fabian/nix
Merge commit 'b424cc1c1c
'
This commit is contained in:
commit
9f38ea87a6
7 changed files with 171 additions and 20 deletions
|
@ -9,11 +9,11 @@
|
|||
nixpkgs,
|
||||
flake-utils,
|
||||
}: let
|
||||
mapOverlayOverride = namespace: overlay: final: prev: let
|
||||
mapOverlayOverride = prefix: overlay: final: prev: let
|
||||
overlayPkgs = overlay final prev;
|
||||
in
|
||||
{
|
||||
"${namespace}" = builtins.removeAttrs overlayPkgs ["override"];
|
||||
"${prefix}" = (prev.${prefix} or {}) // builtins.removeAttrs overlayPkgs ["override"];
|
||||
}
|
||||
// (overlayPkgs.override or {});
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
packages =
|
||||
(import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [(mapOverlayOverride doctrineNoPkgs.prefix (import ./pkgs))];
|
||||
overlays = [self.overlays.default];
|
||||
}).${
|
||||
doctrineNoPkgs.prefix
|
||||
};
|
||||
|
@ -121,7 +121,7 @@
|
|||
}
|
||||
# NB: Preserve the relative order
|
||||
{
|
||||
overlay = self.overlays.default;
|
||||
overlay = mapOverlayOverride prefix (import ./pkgs);
|
||||
condition = true;
|
||||
}
|
||||
{
|
||||
|
@ -164,24 +164,12 @@
|
|||
}
|
||||
// optionalAttrs (paths ? nixosSource) {
|
||||
nixosConfigurations = let
|
||||
nixosSystem = {modules}:
|
||||
lib.makeOverridable nixpkgs.lib.nixosSystem {
|
||||
inherit modules pkgs system;
|
||||
|
||||
specialArgs = {
|
||||
inherit flakes;
|
||||
|
||||
doctrine = mkDoctrine {
|
||||
inherit pkgs;
|
||||
namespace = "sys";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hostConfig = platform:
|
||||
nixosSystem {
|
||||
self.lib.mkSystem {
|
||||
inherit flakes pkgs;
|
||||
doctrine = doctrineNoPkgs;
|
||||
|
||||
modules = [
|
||||
self.nixosModules.default
|
||||
nixosSourcePath
|
||||
platform
|
||||
];
|
||||
|
@ -213,6 +201,29 @@
|
|||
in
|
||||
lib.mapAttrs home (importAll {root = hmPlatformsPath;});
|
||||
};
|
||||
|
||||
mkSystem = {
|
||||
pkgs,
|
||||
flakes,
|
||||
doctrine,
|
||||
modules,
|
||||
}:
|
||||
flakes.nixpkgs.lib.makeOverridable flakes.nixpkgs.lib.nixosSystem {
|
||||
inherit pkgs;
|
||||
inherit (pkgs) system;
|
||||
|
||||
modules = [self.nixosModules.default] ++ modules;
|
||||
|
||||
specialArgs = {
|
||||
inherit flakes;
|
||||
|
||||
doctrine = self.lib.mkDoctrine {
|
||||
inherit pkgs;
|
||||
inherit (doctrine) prefix;
|
||||
namespace = "sys";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue