build(xatu): add flake package

This commit is contained in:
2026-09-19 16:23:27 -04:00
parent 4b9beae501
commit 1f209f64fb
4 changed files with 61 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
lib,
formatter,
system,
xatu,
}:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
@@ -17,6 +18,7 @@ in
formatter
pkgs.statix
pkgs.deadnix
xatu
];
text = ''
treefmt
@@ -33,6 +35,7 @@ in
src/xatu/testdata \
third_party \
-- .
xatu configs/nixos flake.nix src/dotfiles src/flake src/xatu/package.nix
treefmt
'';
}

View File

@@ -21,6 +21,15 @@ in
inherit inputs system;
}).config.build.wrapper;
packages.${system} = import ./packages.nix {
inherit
inputs
lib
root
system
;
};
apps.${system} = import ./apps.nix {
inherit
inputs
@@ -28,6 +37,7 @@ in
system
;
formatter = self.formatter.${system};
xatu = self.packages.${system}.xatu;
};
inherit (dotfiles) nixosConfigurations;

18
src/flake/packages.nix Normal file
View File

@@ -0,0 +1,18 @@
{
inputs,
lib,
root,
system,
}:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
xatu = import ../xatu/package.nix {
inherit
lib
pkgs
root
;
};
}

30
src/xatu/package.nix Normal file
View File

@@ -0,0 +1,30 @@
{
lib,
pkgs,
root,
}:
pkgs.rustPlatform.buildRustPackage {
pname = "xatu";
version = "0.1.0";
src = lib.fileset.toSource {
inherit root;
fileset = lib.fileset.unions [
(root + "/Cargo.lock")
(root + "/Cargo.toml")
(root + "/src/ariadne")
(root + "/src/machoke")
(root + "/src/monorepo")
(root + "/src/status")
(root + "/src/xatu")
];
};
cargoBuildFlags = [
"-p"
"xatu"
"--bin"
"xatu"
];
cargoLock.lockFile = root + "/Cargo.lock";
}