format nix flake #26
133
flake.nix
133
flake.nix
@@ -15,13 +15,21 @@
|
|||||||
flatland.url = "github:StardustXR/flatland";
|
flatland.url = "github:StardustXR/flatland";
|
||||||
};
|
};
|
||||||
outputs =
|
outputs =
|
||||||
inputs@{ self, flake-parts, nixpkgs, hercules-ci-effects, flatland, ... }:
|
inputs@{
|
||||||
|
self,
|
||||||
|
flake-parts,
|
||||||
|
nixpkgs,
|
||||||
|
hercules-ci-effects,
|
||||||
|
flatland,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
name = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
|
name = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
|
||||||
src = builtins.path {
|
src = builtins.path {
|
||||||
name = "${name}-source";
|
name = "${name}-source";
|
||||||
path = toString ./.;
|
path = toString ./.;
|
||||||
filter = path: type:
|
filter =
|
||||||
|
path: type:
|
||||||
nixpkgs.lib.all (n: builtins.baseNameOf path != n) [
|
nixpkgs.lib.all (n: builtins.baseNameOf path != n) [
|
||||||
"flake.nix"
|
"flake.nix"
|
||||||
"flake.lock"
|
"flake.lock"
|
||||||
@@ -29,63 +37,82 @@
|
|||||||
"README.md"
|
"README.md"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in flake-parts.lib.mkFlake { inherit inputs; } {
|
in
|
||||||
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
imports = [ flake-parts.flakeModules.easyOverlay ];
|
imports = [ flake-parts.flakeModules.easyOverlay ];
|
||||||
systems = [ "aarch64-linux" "x86_64-linux" "riscv64-linux" ];
|
systems = [
|
||||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
"aarch64-linux"
|
||||||
_module.args.pkgs = import inputs.nixpkgs {
|
"x86_64-linux"
|
||||||
inherit system;
|
"riscv64-linux"
|
||||||
overlays = [ inputs.self.overlays.default ];
|
];
|
||||||
};
|
perSystem =
|
||||||
overlayAttrs = config.packages;
|
{
|
||||||
packages = let sk_gpu = pkgs.callPackage ./nix/sk_gpu.nix { };
|
config,
|
||||||
in {
|
self',
|
||||||
default = self'.packages.${name};
|
inputs',
|
||||||
gnome-graphical-test = self'.checks.gnome-graphical-test;
|
pkgs,
|
||||||
"${name}" = pkgs.callPackage ./nix/stardust-xr-server.nix {
|
system,
|
||||||
inherit name src sk_gpu;
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ inputs.self.overlays.default ];
|
||||||
|
};
|
||||||
|
overlayAttrs = config.packages;
|
||||||
|
packages =
|
||||||
|
let
|
||||||
|
sk_gpu = pkgs.callPackage ./nix/sk_gpu.nix { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = self'.packages.${name};
|
||||||
|
gnome-graphical-test = self'.checks.gnome-graphical-test;
|
||||||
|
"${name}" = pkgs.callPackage ./nix/stardust-xr-server.nix { inherit name src sk_gpu; };
|
||||||
|
};
|
||||||
|
apps.default = {
|
||||||
|
type = "app";
|
||||||
|
program = self'.packages.${name} + "/bin/stardust-xr-server";
|
||||||
|
};
|
||||||
|
checks.gnome-graphical-test = pkgs.nixosTest (
|
||||||
|
import ./nix/gnome-graphical-test.nix { inherit pkgs self; }
|
||||||
|
);
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
inputsFrom = [ self'.packages.default ];
|
||||||
|
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
apps.default = {
|
|
||||||
type = "app";
|
|
||||||
program = self'.packages.${name} + "/bin/stardust-xr-server";
|
|
||||||
};
|
|
||||||
checks.gnome-graphical-test = pkgs.nixosTest
|
|
||||||
(import ./nix/gnome-graphical-test.nix { inherit pkgs self; });
|
|
||||||
devShells.default = pkgs.mkShell {
|
|
||||||
inputsFrom = [ self'.packages.default ];
|
|
||||||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
flake = {
|
flake = {
|
||||||
herculesCI.ciSystems = [ "x86_64-linux" ];
|
herculesCI.ciSystems = [ "x86_64-linux" ];
|
||||||
effects = let
|
effects =
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
let
|
||||||
hci-effects = hercules-ci-effects.lib.withPkgs pkgs;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
in { ref, rev, ... }: {
|
hci-effects = hercules-ci-effects.lib.withPkgs pkgs;
|
||||||
gnome-graphical-test = hci-effects.mkEffect {
|
in
|
||||||
secretsMap."stardustxrDiscord" = "stardustxrDiscord";
|
{ ref, rev, ... }:
|
||||||
secretsMap."stardustxrIpfs" = "stardustxrIpfs";
|
{
|
||||||
effectScript = ''
|
gnome-graphical-test = hci-effects.mkEffect {
|
||||||
readSecretString stardustxrDiscord .webhook > .webhook
|
secretsMap."stardustxrDiscord" = "stardustxrDiscord";
|
||||||
readSecretString stardustxrIpfs .basicauth > .basicauth
|
secretsMap."stardustxrIpfs" = "stardustxrIpfs";
|
||||||
set -x
|
effectScript = ''
|
||||||
export RESPONSE=$(curl -H @.basicauth -F file=@${
|
readSecretString stardustxrDiscord .webhook > .webhook
|
||||||
self.packages."x86_64-linux".gnome-graphical-test
|
readSecretString stardustxrIpfs .basicauth > .basicauth
|
||||||
}/screen.png https://ipfs-api.stardustxr.org/api/v0/add)
|
set -x
|
||||||
export CID=$(echo "$RESPONSE" | ${pkgs.jq}/bin/jq -r .Hash)
|
export RESPONSE=$(curl -H @.basicauth -F file=@${
|
||||||
set +x
|
self.packages."x86_64-linux".gnome-graphical-test
|
||||||
export ADDRESS="https://ipfs.stardustxr.org/ipfs/$CID"
|
}/screen.png https://ipfs-api.stardustxr.org/api/v0/add)
|
||||||
${pkgs.discord-sh}/bin/discord.sh \
|
export CID=$(echo "$RESPONSE" | ${pkgs.jq}/bin/jq -r .Hash)
|
||||||
--description "\`stardustxr/server\` has been modified, here's how it renders \`weston-cliptest\` on \`flatland\` via \`monado-service\` inside of the \`gnome-graphical-test\`" \
|
set +x
|
||||||
--field "Ref;${ref}" \
|
export ADDRESS="https://ipfs.stardustxr.org/ipfs/$CID"
|
||||||
--field "Commit ID;${rev}" \
|
${pkgs.discord-sh}/bin/discord.sh \
|
||||||
--field "Flatland Revision;${flatland.rev}" \
|
--description "\`stardustxr/server\` has been modified, here's how it renders \`weston-cliptest\` on \`flatland\` via \`monado-service\` inside of the \`gnome-graphical-test\`" \
|
||||||
--field "Reproducer;\`nix build github:stardustxr/server/${rev}#gnome-graphical-test\`" \
|
--field "Ref;${ref}" \
|
||||||
--image "$ADDRESS"
|
--field "Commit ID;${rev}" \
|
||||||
'';
|
--field "Flatland Revision;${flatland.rev}" \
|
||||||
|
--field "Reproducer;\`nix build github:stardustxr/server/${rev}#gnome-graphical-test\`" \
|
||||||
|
--image "$ADDRESS"
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user