2023-09-22 10:11:44 +00:00
|
|
|
# limited, non-flake interface to this repo.
|
|
|
|
# this file exposes the same view into `pkgs` which the flake would see when evaluated.
|
|
|
|
#
|
|
|
|
# the primary purpose of this file is so i can run `updateScript`s which expect
|
|
|
|
# the root to be `default.nix`
|
2024-06-12 02:21:50 +00:00
|
|
|
{ }:
|
|
|
|
let
|
2024-06-12 19:59:35 +00:00
|
|
|
mkPkgs = args: (import ./pkgs/additional/nixpkgs args).extend
|
|
|
|
(import ./overlays/all.nix);
|
2024-06-12 02:21:50 +00:00
|
|
|
inherit (mkPkgs {}) lib;
|
|
|
|
|
|
|
|
evalHost = { name, system, branch ? "master", variant ? null }:
|
|
|
|
let
|
|
|
|
pkgs = mkPkgs { inherit system; variant = branch; };
|
|
|
|
in pkgs.nixos (
|
|
|
|
[
|
|
|
|
(lib.optionalAttrs (variant == "light") {
|
|
|
|
sane.maxBuildCost = 2;
|
|
|
|
})
|
|
|
|
(lib.optionalAttrs (variant == "min") {
|
|
|
|
sane.maxBuildCost = 0;
|
|
|
|
})
|
|
|
|
(import ./hosts/instantiate.nix { hostName = name; })
|
|
|
|
(import ./modules)
|
|
|
|
pkgs.sops-nix.nixosModules.sops
|
|
|
|
]
|
|
|
|
);
|
|
|
|
mkFlavoredHost = args: let
|
|
|
|
host = evalHost args;
|
|
|
|
# expose the toplevel nixos system as the toplevel attribute itself,
|
|
|
|
# with nested aliases for other common build targets
|
|
|
|
in host.config.system.build.toplevel.overrideAttrs (base: {
|
|
|
|
passthru = (base.passthru or {}) // {
|
|
|
|
img = host.config.system.build.img;
|
|
|
|
pkgs = host.config.system.build.pkgs;
|
|
|
|
programs = lib.mapAttrs (_: p: p.package) host.config.sane.programs;
|
|
|
|
toplevel = host.config.system.build.toplevel; #< self
|
|
|
|
};
|
|
|
|
});
|
|
|
|
mkHost = args: {
|
2024-06-14 20:21:45 +00:00
|
|
|
# TODO: swap order: $host-{next,staging}-{min,light}:
|
|
|
|
# then lexicographically-adjacent targets would also have the minimal difference in closure,
|
|
|
|
# and the order in which each target should be built is more evident
|
2024-06-12 02:21:50 +00:00
|
|
|
"${args.name}" = mkFlavoredHost args;
|
|
|
|
"${args.name}-next" = mkFlavoredHost args // { branch = "staging-next"; };
|
|
|
|
"${args.name}-staging" = mkFlavoredHost args // { branch = "staging"; };
|
|
|
|
"${args.name}-light" = mkFlavoredHost args // { variant = "light"; };
|
|
|
|
"${args.name}-light-next" = mkFlavoredHost args // { variant = "light"; branch = "staging-next"; };
|
|
|
|
"${args.name}-light-staging" = mkFlavoredHost args // { variant = "light"; branch = "staging"; };
|
|
|
|
"${args.name}-min" = mkFlavoredHost args // { variant = "min"; };
|
|
|
|
"${args.name}-min-next" = mkFlavoredHost args // { variant = "min"; branch = "staging-next"; };
|
|
|
|
"${args.name}-min-staging" = mkFlavoredHost args // { variant = "min"; branch = "staging-staging"; };
|
|
|
|
};
|
|
|
|
|
|
|
|
hosts = lib.foldl' (acc: host: acc // (mkHost host)) {} [
|
|
|
|
{ name = "crappy"; system = "armv7l-linux"; }
|
|
|
|
{ name = "desko"; system = "x86_64-linux"; }
|
|
|
|
{ name = "lappy"; system = "x86_64-linux"; }
|
|
|
|
{ name = "moby"; system = "aarch64-linux"; }
|
|
|
|
{ name = "rescue"; system = "x86_64-linux"; }
|
|
|
|
{ name = "servo"; system = "x86_64-linux"; }
|
|
|
|
];
|
2024-06-14 04:40:47 +00:00
|
|
|
in {
|
2024-06-12 02:21:50 +00:00
|
|
|
inherit hosts;
|
2024-06-14 04:40:47 +00:00
|
|
|
} // (mkPkgs {})
|