39 lines
1.1 KiB
Nix
39 lines
1.1 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, utils }:
|
|
let supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
|
in (utils.lib.eachSystem supportedSystems (system:
|
|
let pkgs = import nixpkgs { inherit system; };
|
|
in {
|
|
formatter = pkgs.nixfmt;
|
|
packages.pi4-sdimage = (self.nixosConfigurations.pi4.extendModules {
|
|
modules = [{
|
|
config.nixpkgs = {
|
|
hostPlatform.system = "aarch64-linux";
|
|
buildPlatform.system = system;
|
|
};
|
|
}];
|
|
}).config.system.build.sdImage;
|
|
})) // {
|
|
nixosModules.minify = { ... }: {
|
|
disabledModules = [ "profiles/base.nix" ];
|
|
config = {
|
|
nix.enable = false;
|
|
programs.nano.enable = true;
|
|
};
|
|
};
|
|
|
|
nixosConfigurations.pi4 = nixpkgs.lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
modules = [
|
|
self.nixosModules.minify
|
|
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
|
];
|
|
};
|
|
};
|
|
}
|