Skip to content

Commit

Permalink
try namespace labs
Browse files Browse the repository at this point in the history
  • Loading branch information
arianvp committed Jul 20, 2024
1 parent e7d009f commit 5abc813
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 34 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/ci.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/nix-github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Nix Flake actions

on:
pull_request:
push:
branches:
- master
- main

jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- run: |
sudo mkdir /nix
sudo chown "$USER" /nix
- uses: namespacelabs/nscloud-cache-action@v1
with:
path: /nix
- uses: cachix/install-nix-action@v27
- run: nix build -L '.#${{ matrix.attr }}'
38 changes: 21 additions & 17 deletions flake.lock

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

29 changes: 25 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
{
description = "NixOS Village AWS cloud";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
inputs.nixpkgs-amazon-ssm-agent.url = "github:r-ryantm/nixpkgs?ref=auto-update/amazon-ssm-agent";
inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, pre-commit-hooks, ... }: {
outputs = inputs@{ self, nixpkgs, pre-commit-hooks, nix-github-actions, ... }: {
lib.supportedSystems = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" ];
lib.forAllSystems = nixpkgs.lib.genAttrs self.lib.supportedSystems;

githubActions = nix-github-actions.lib.mkGithubMatrix {
inherit (self) checks;
platforms = {
x86_64-linux = [
"nscloud-ubuntu-22.04-amd64-4x16-with-cache"
"nscloud-cache-size-20gb"
"nscloud-cache-tag-aarch64-linux"
];
aarch64-linux = [
"nscloud-ubuntu-22.04-arm64-4x16-with-cache"
"nscloud-cache-size-20gb"
"nscloud-cache-tag-x86_64-linux"
];
};
};

devShells = self.lib.forAllSystems (system: {
default = with nixpkgs.legacyPackages.${system}; mkShell {
packages = [
Expand Down

0 comments on commit 5abc813

Please sign in to comment.