Skip to content

Commit

Permalink
infra: add flakehub-push (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroHLC committed Sep 28, 2023
1 parent 22095c8 commit 081a69e
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/flakehub-publish-rolling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Publish every Git push to main to FlakeHub"
on:
push:
branches:
- "main"
jobs:
flakehub-publish:
runs-on: "ubuntu-latest"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v3"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
name: "UbiqueLambda/yafas"
rolling: true
visibility: "public"
27 changes: 27 additions & 0 deletions .github/workflows/flakehub-publish-tagged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Publish tags to FlakeHub"
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
tag:
description: "The existing tag to publish to FlakeHub"
type: "string"
required: true
jobs:
flakehub-publish:
runs-on: "ubuntu-latest"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v3"
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
visibility: "public"
name: "UbiqueLambda/yafas"
tag: "${{ inputs.tag }}"
14 changes: 14 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
inputs = { systems.url = "github:nix-systems/default"; };
outputs = { self, systems }:
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/0.1.1.tar.gz";
systems.url = "github:nix-systems/default";
};
outputs = { self, flake-schemas, systems }:
let
# lib
inherit (builtins) attrNames elemAt filter foldl' head isAttrs
Expand Down Expand Up @@ -79,12 +82,14 @@
"${name}" = update accu.${name}.${system} (applier accu combo);
});

withSchemas = withUniversal "schemas";

# system list
importedSystems = import systems;
linuxes = filter (hasSuffix "-linux") importedSystems;
darwins = filter (hasSuffix "-darwin") importedSystems;
in
{
withSchemas (import ./schemas.nix flake-schemas) {
# Constructors
allLinux = support linuxes;
allDarwin = support darwins;
Expand Down Expand Up @@ -117,7 +122,7 @@
withHomeManagerModules = withUniversal "homeManagerModules";
withNixOSModules = withUniversal "nixosModules";
withOverlays = withUniversal "overlays";
withSchemas = withUniversal "schemas";
inherit withSchemas;

# With universals products
inherit withNestedUniversal;
Expand Down
13 changes: 13 additions & 0 deletions schemas.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
flake-schemas: outputs:
let
fns = builtins.mapAttrs
(name: _: {
version = 1;
doc = ''
`${name}` lambda.
'';
inventory = _: { };
})
outputs;
in
fns // { inherit (flake-schemas.schemas) schemas; }

0 comments on commit 081a69e

Please sign in to comment.