myxce/src/flake.nix
2026-03-04 18:18:53 +08:00

66 lines
2.1 KiB
Nix

{
description = "Flake for NEXA xce";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
xbuild.url = "github:shen390s/my-nix-channel?ref=master";
extralib.url = "git+ssh://forgejo@gitea.shenrs.eu/nexa/extralibs?ref=main";
librtti.url = "git+ssh://forgejo@gitea.shenrs.eu/rshen/librtti?ref=master";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, xbuild, extralib, librtti, flake-utils }:
let
supportedSystems = [ "x86_64-linux" ];
myCommitId =
if builtins.hasAttr "shortRev" self
then self.shortRev
else self.dirtyShortRev;
in
flake-utils.lib.eachSystem supportedSystems (
system: let
mypkgs = xbuild.packages.${system} // extralib.packages.${system} // librtti.packages.${system};
overlays = [
(final: prev: mypkgs // prev)
];
pkgs = import nixpkgs { inherit overlays system;};
xpkgs = import ./nixSupport/default.nix {
inherit pkgs myCommitId;
};
appImageScriptContent = builtins.readFile ./tools/appimage/entry.sh;
appImageEntryPackage = pkgs.writeShellApplication {
name = "xce";
runtimeInputs = with pkgs; [
xpkgs.xcecore
glibcLocales
coreutils-full
which
bash
gzip
glow
less
haproxy
];
text = appImageScriptContent;
runtimeEnv = {
LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive";
LANG="en_US.UTF-8";
LESS="-R";
};
meta = {
mainProgram = "xce";
};
};
in rec {
packages = pkgs // xpkgs // { xce = appImageEntryPackage; };
defaultPackage = xpkgs.xcecore_debug;
devShells.default = pkgs.mkShell {
nativeBuildInputs = xpkgs.xcecore.nativeBuildInputs;
};
devShell = self.devShells.${system}.default;
}
);
}