diff --git a/src/default.nix b/src/default.nix index aac7a28..a06d8db 100644 --- a/src/default.nix +++ b/src/default.nix @@ -1,4 +1,5 @@ { nixpkgs ? import ./lib/nixpkgs.nix +, celun ? import ./lib/celun.nix , lib ? import (nixpkgs + "/lib") , pkgsFun ? import nixpkgs , hostPlatform ? null # if left `null` this will be set based on the ./platform/ @@ -22,6 +23,7 @@ let `nix-build -A` argument. ''; inherit hostPlatform; + inherit celun; nixpkgsOnBuildForHost = pkgsFun (nixpkgsArgs // (lib.optionalAttrs (final.hostPlatform!=null) { @@ -42,8 +44,10 @@ let iasl_20180531 = final.nixpkgsOnBuildForBuild.callPackage ./coreboot/iasl_20180531 { }; coreboot = final.callPackage ./coreboot { }; + device = throw "platforms must override this attribute"; + system = final.callPackage ./system { inherit (final) celun device; }; image = final.callPackage ./image { }; - kernel = final.callPackage ./kernel { }; + kernel = (lib.traceVal final.system.build).kernel; #final.callPackage ./kernel { }; initramfs = final.callPackage ./initramfs { six-initrd = (six-initrd { inherit (final) lib; diff --git a/src/lib/celun.nix b/src/lib/celun.nix new file mode 100644 index 0000000..aab7499 --- /dev/null +++ b/src/lib/celun.nix @@ -0,0 +1,7 @@ +let + commit = "f4e681b896aae165506b7963eb6ac6d6c032145f"; + sha256 = "0mwqzinvacb8xd5wdv13l2b481n8xzm9dvh07ghs5pgifspi7skw"; +in builtins.fetchTarball { + url = "https://github.com/samueldr/celun/archive/${commit}.tar.gz"; + inherit sha256; +} diff --git a/src/system/configuration.nix b/src/system/configuration.nix new file mode 100644 index 0000000..b8a198b --- /dev/null +++ b/src/system/configuration.nix @@ -0,0 +1,3 @@ +{ lib, ... }: { + wip.stage-1.compression = lib.mkDefault "xz"; +} diff --git a/src/system/default.nix b/src/system/default.nix new file mode 100644 index 0000000..bc2b8e9 --- /dev/null +++ b/src/system/default.nix @@ -0,0 +1,17 @@ +{ celun, device }@args: + +import (celun + "/lib/eval-with-configuration.nix") ((builtins.removeAttrs args [ "celun" ]) // { + inherit device; + verbose = true; + configuration = { + imports = [ + ./configuration.nix + ( + { lib, ... }: + { + # celun.system.automaticCross = lib.mkDefault true; + } + ) + ]; + }; +})