patos/flake.nix

92 lines
2.5 KiB
Nix
Raw Normal View History

2024-09-12 21:57:01 +02:00
{
description = "PatOS is a minimal, immutable Linux distribution specialized for the Patagia Platform.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2024-09-12 21:57:01 +02:00
};
2024-09-17 23:02:53 +02:00
outputs =
{ self, nixpkgs }:
let
releaseVersion = "0.0.1";
system = "x86_64-linux";
updateUrl = "https://images.dl.patagia.dev/patos/";
pkgs = import nixpkgs { inherit system; };
in
2024-09-17 23:02:53 +02:00
{
2024-11-16 17:15:56 +01:00
nixosModules.devel.imports = [
./modules/profiles/devel.nix
];
nixosModules.server.imports = [
./modules/profiles/server.nix
];
nixosModules.image.imports = [
./modules
./modules/profiles/base.nix
2024-11-16 15:39:00 +01:00
./modules/image
];
packages.${system} = {
2024-11-16 17:15:56 +01:00
devel =
(nixpkgs.lib.nixosSystem {
modules = [
(
{ lib, ... }:
{
nixpkgs.hostPlatform = system;
system.stateVersion = "24.05";
}
)
{
system.image.updates.url = "${updateUrl}";
system.image.id = "patos";
system.image.version = releaseVersion;
}
self.nixosModules.image
self.nixosModules.devel
];
}).config.system.build.updatePackage;
patos =
(nixpkgs.lib.nixosSystem {
modules = [
(
{ lib, ... }:
{
nixpkgs.hostPlatform = system;
system.stateVersion = "24.05";
}
)
{
system.image.updates.url = "${updateUrl}";
system.image.id = "patos";
system.image.version = releaseVersion;
}
self.nixosModules.image
self.nixosModules.server
];
}).config.system.build.updatePackage;
qemu-uefi-tpm = pkgs.callPackage ./utils/qemu-uefi-tpm.nix { inherit pkgs; };
};
checks.${system} = {
ssh-preseed = import ./tests/ssh-preseed.nix { inherit pkgs self; };
podman = import ./tests/podman.nix { inherit pkgs self; };
system-update = import ./tests/system-update.nix { inherit pkgs self; };
};
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
erofs-utils
just
self.packages.${system}.qemu-uefi-tpm
squashfs-tools-ng
];
};
};
2024-09-12 21:57:01 +02:00
}