forked from dan/liminix
1
0
Fork 0
liminix/default.nix

31 lines
862 B
Nix
Raw Normal View History

{ 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) [
./modules/base.nix
({ lib, ... } : { config = { inherit (device) kernel; }; })
2022-09-25 10:22:15 +00:00
<liminix-config>
] nixpkgs.pkgs;
finalConfig = config // {
packages = (with nixpkgs.pkgs; [ s6-rc ]) ++
config.systemPackages ++
(builtins.attrValues config.services)
;
};
squashfs = (import ./make-image.nix) nixpkgs finalConfig;
kernel = (import ./make-kernel.nix) nixpkgs finalConfig.kernel.config;
in {
outputs = {
inherit squashfs kernel;
default = nixpkgs.pkgs.runCommand "both-kinds" {} ''
mkdir $out
cd $out
ln -s ${squashfs} squashfs
ln -s ${kernel.vmlinux} vmlinux
'';
};
}