2022-09-19 22:51:38 +00:00
|
|
|
{ device ? (import devices/gl-ar750.nix)
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
overlay = import ./overlay.nix;
|
|
|
|
nixpkgs = import <nixpkgs> ( device.system // {overlays = [overlay]; });
|
2022-09-25 10:22:15 +00:00
|
|
|
config = (import ./merge-modules.nix) [
|
2022-09-25 12:17:21 +00:00
|
|
|
./modules/base.nix
|
|
|
|
({ lib, ... } : { config = { inherit (device) kernel; }; })
|
2022-09-25 10:22:15 +00:00
|
|
|
<liminix-config>
|
|
|
|
] nixpkgs.pkgs;
|
2022-09-19 22:51:38 +00:00
|
|
|
finalConfig = config // {
|
|
|
|
packages = (with nixpkgs.pkgs; [ s6-rc ]) ++
|
|
|
|
config.systemPackages ++
|
|
|
|
(builtins.attrValues config.services)
|
|
|
|
;
|
|
|
|
};
|
2022-09-20 17:54:27 +00:00
|
|
|
squashfs = (import ./make-image.nix) nixpkgs finalConfig;
|
2022-09-25 12:17:21 +00:00
|
|
|
kernel = (import ./make-kernel.nix) nixpkgs finalConfig.kernel.config;
|
2022-09-20 17:54:27 +00:00
|
|
|
in {
|
|
|
|
outputs = {
|
|
|
|
inherit squashfs kernel;
|
2022-09-20 22:04:08 +00:00
|
|
|
default = nixpkgs.pkgs.runCommand "both-kinds" {} ''
|
|
|
|
mkdir $out
|
|
|
|
cd $out
|
|
|
|
ln -s ${squashfs} squashfs
|
|
|
|
ln -s ${kernel.vmlinux} vmlinux
|
|
|
|
'';
|
2022-09-20 17:54:27 +00:00
|
|
|
};
|
|
|
|
}
|