nixos-x13s/flake.nix

103 lines
2.7 KiB
Nix
Raw Normal View History

2024-01-22 18:47:25 +01:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
2024-02-20 20:06:40 +01:00
inputs@{ flake-parts, self, ... }:
let
dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb";
in
2024-01-22 18:47:25 +01:00
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ./packages/part.nix ];
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem =
{ pkgs, ... }:
{
2024-05-14 22:14:22 +02:00
devShells = rec {
default = pkgs.mkShellNoCC { packages = [ pkgs.npins ] ++ ci.nativeBuildInputs; };
ci = pkgs.mkShellNoCC {
packages = [
pkgs.cachix
pkgs.jq
pkgs.just
];
};
2024-05-14 22:13:54 +02:00
};
packages = {
iso = self.nixosConfigurations.iso.config.system.build.isoImage;
};
2024-01-22 18:47:25 +01:00
};
flake.nixosModules.default = import ./module.nix { inherit dtbName; };
2024-02-20 20:06:40 +01:00
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
2024-02-20 20:06:40 +01:00
# install multiple kernels! note this increases eval time for each specialization
# specialisation = {
# mainline.configuration.nixos-x13s.kernel = "mainline";
# };
2024-02-20 20:06:40 +01:00
# allow unfree firmware
nixpkgs.config.allowUnfree = true;
2024-02-20 20:06:40 +01:00
# define your fileSystems
fileSystems."/".device = "/dev/notreal";
}
];
};
iso = inputs.nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
self.nixosModules.default
(
{ modulesPath, config, ... }:
let
dtb = "${config.boot.kernelPackages.kernel}/dtbs/qcom/${dtbName}";
in
{
imports = [ "${toString modulesPath}/installer/cd-dvd/iso-image.nix" ];
2024-05-14 21:33:31 +02:00
nixpkgs.config.allowUnfree = true;
2024-05-14 22:25:22 +02:00
nixos-x13s = {
enable = true;
bluetoothMac = "02:68:b3:29:da:98";
};
isoImage = {
makeEfiBootable = true;
makeUsbBootable = true;
contents = [
{
source = dtb;
2024-05-14 21:33:31 +02:00
target = "/x13s.dtb";
}
];
};
}
)
];
};
2024-02-20 20:06:40 +01:00
};
2024-01-22 18:47:25 +01:00
};
}