1
Fork 0
mirror of https://github.com/RGBCube/hjem synced 2025-10-18 07:32:24 +00:00

flake: export smfh package as an output

This commit is contained in:
NotAShelf 2025-06-14 12:30:06 +03:00
parent d5bf1fd8f3
commit 272de1a114
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF

View file

@ -12,6 +12,9 @@
nixpkgs, nixpkgs,
... ...
} @ inputs: let } @ inputs: let
# We should only specify the modules Hjem explicitly supports, or we risk
# allowing not-so-defined behaviour. For example, adding nix-systems should
# be avoided, because it allows specifying Hjem is not tested on.
forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"]; forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"];
in { in {
nixosModules = { nixosModules = {
@ -19,18 +22,27 @@
default = self.nixosModules.hjem; default = self.nixosModules.hjem;
}; };
packages = forAllSystems (system: {
# Expose the 'smfh' instance used by Hjem as a package in the Hjem flake
# outputs. This allows consuming the exact copy of smfh used by Hjem.
smfh = inputs.smfh.packages.${system}.smfh;
});
checks = forAllSystems (system: let checks = forAllSystems (system: let
checkArgs = { checkArgs = {
inherit self inputs; inherit self inputs;
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
}; };
in { in {
# Build the 'smfh' package as a part of Hjem's test suite.
# If 'nix flake check' is ran in the CI, this might inflate build times
# *a lot*.
inherit (self.packages.${system}) smfh;
# Hjem Integration Tests
hjem-basic = import ./tests/basic.nix checkArgs; hjem-basic = import ./tests/basic.nix checkArgs;
hjem-special-args = import ./tests/special-args.nix checkArgs; hjem-special-args = import ./tests/special-args.nix checkArgs;
hjem-linker = import ./tests/linker.nix checkArgs; hjem-linker = import ./tests/linker.nix checkArgs;
# Build smfh as a part of 'nix flake check'
smfh = inputs.smfh.packages.${system}.smfh;
}); });
devShells = forAllSystems (system: let devShells = forAllSystems (system: let