mirror of
https://codeberg.org/mart-w/nixos-x13s.git
synced 2024-12-11 15:36:13 +01:00
- adding an iso package to the flake
- floating dtbName up into the flake so it can be referenced by the module and the iso - linting with nixfmt-rfc-style
This commit is contained in:
parent
8e01e9917f
commit
dec99e46ed
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
.secret.envrc
|
||||
result
|
||||
|
|
80
flake.nix
80
flake.nix
|
@ -6,6 +6,9 @@
|
|||
|
||||
outputs =
|
||||
inputs@{ flake-parts, self, ... }:
|
||||
let
|
||||
dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb";
|
||||
in
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [ ./packages/part.nix ];
|
||||
|
||||
|
@ -18,30 +21,71 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
devShells.default = pkgs.mkShellNoCC { packages = [ pkgs.npins ]; };
|
||||
packages = {
|
||||
iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
||||
};
|
||||
};
|
||||
|
||||
flake.nixosModules.default = import ./module.nix;
|
||||
flake.nixosModules.default = import ./module.nix { inherit dtbName; };
|
||||
|
||||
flake.nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
self.nixosModules.default
|
||||
{
|
||||
nixos-x13s.enable = true;
|
||||
nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported
|
||||
flake.nixosConfigurations = {
|
||||
example = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
self.nixosModules.default
|
||||
{
|
||||
nixos-x13s.enable = true;
|
||||
nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported
|
||||
|
||||
# install multiple kernels! note this increases eval time for each specialization
|
||||
# specialisation = {
|
||||
# mainline.configuration.nixos-x13s.kernel = "mainline";
|
||||
# };
|
||||
# install multiple kernels! note this increases eval time for each specialization
|
||||
# specialisation = {
|
||||
# mainline.configuration.nixos-x13s.kernel = "mainline";
|
||||
# };
|
||||
|
||||
# allow unfree firmware
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
# allow unfree firmware
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# define your fileSystems
|
||||
fileSystems."/".device = "/dev/notreal";
|
||||
}
|
||||
];
|
||||
# define your fileSystems
|
||||
fileSystems."/".device = "/dev/notreal";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
iso = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
|
||||
self.nixosModules.default
|
||||
{
|
||||
nixos-x13s = {
|
||||
enable = true;
|
||||
kernel = "mainline";
|
||||
};
|
||||
}
|
||||
|
||||
(
|
||||
{ modulesPath, config, ... }:
|
||||
let
|
||||
dtb = "${config.boot.kernelPackages.kernel}/dtbs/qcom/${dtbName}";
|
||||
in
|
||||
{
|
||||
imports = [ "${toString modulesPath}/installer/cd-dvd/iso-image.nix" ];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
isoImage = {
|
||||
makeEfiBootable = true;
|
||||
makeUsbBootable = true;
|
||||
|
||||
contents = [
|
||||
{
|
||||
source = dtb;
|
||||
target = "/" + dtbName;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{ dtbName }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
|
@ -9,16 +10,12 @@ let
|
|||
|
||||
x13sPackages = import ./packages/default.nix { inherit lib pkgs; };
|
||||
|
||||
dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb";
|
||||
linuxPackages_x13s =
|
||||
if cfg.kernel == "mainline" then
|
||||
pkgs.linuxPackages_latest
|
||||
else
|
||||
pkgs.linuxPackagesFor (
|
||||
if cfg.kernel == "jhovold" then
|
||||
x13sPackages.linux_jhovold
|
||||
else
|
||||
throw "Unsupported kernel"
|
||||
if cfg.kernel == "jhovold" then x13sPackages.linux_jhovold else throw "Unsupported kernel"
|
||||
);
|
||||
dtb = "${linuxPackages_x13s.kernel}/dtbs/qcom/${dtbName}";
|
||||
dtbEfiPath = "dtbs/${cfg.kernel}/${config.boot.kernelPackages.kernel.version}/${dtbName}";
|
||||
|
|
Loading…
Reference in a new issue