patos/flake.nix
Daniel Lundin 4a82f52920
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
WIP: Just a quick hack overlaying systemd from staging-next
2025-01-13 17:25:34 +01:00

97 lines
2.7 KiB
Nix

{
description = "PatOS is a minimal, immutable Linux distribution specialized for the Patagia Platform.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-staging-next.url = "github:NixOS/nixpkgs/staging-next";
};
outputs =
{ self, nixpkgs, nixpkgs-staging-next }:
let
releaseVersion = "0.0.1";
system = "x86_64-linux";
updateUrl = "https://images.dl.patagia.dev/patos/";
pkgs = import nixpkgs { inherit system; };
in
{
nixosModules.devel.imports = [
./modules/profiles/devel.nix
];
nixosModules.server.imports = [
./modules/profiles/server.nix
];
nixosModules.image.imports = [
./modules
./modules/profiles/base.nix
./modules/image
];
packages.${system} = {
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;
image.compress = false;
nixpkgs.overlays = [
(final: prev: {
systemd = nixpkgs-staging-next.legacyPackages.${final.system}.systemd;
})
];
}
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} = {
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
];
};
};
}