forked from DGNum/liminix
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{ device ? (import devices/gl-ar750.nix)
|
|
}:
|
|
|
|
let
|
|
overlay = import ./overlay.nix;
|
|
nixpkgs = import <nixpkgs> ( device.system // {overlays = [overlay]; });
|
|
config = (import ./merge-modules.nix) [
|
|
./modules/base.nix
|
|
({ lib, ... } : { config = { inherit (device) kernel; }; })
|
|
<liminix-config>
|
|
./modules/s6-rc.nix
|
|
] nixpkgs.pkgs;
|
|
finalConfig = config // {
|
|
packages = (with nixpkgs.pkgs; [ s6-init-files s6-rc ]) ++
|
|
config.systemPackages ++
|
|
(builtins.attrValues config.services);
|
|
};
|
|
squashfs = (nixpkgs.pkgs.callPackage ./make-image.nix {}) finalConfig;
|
|
kernel = nixpkgs.pkgs.callPackage ./kernel {
|
|
inherit (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
|
|
'';
|
|
};
|
|
# this is just here as a convenience, so that we can get a
|
|
# cross-compiling nix-shell for any package we're customizing
|
|
inherit (nixpkgs) pkgs;
|
|
}
|