Skip to content

Commit

Permalink
add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
quinneden committed Jan 3, 2025
1 parent 3177336 commit 73ce747
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build installer package

on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:

jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
id-token: "write"
contents: "read"
steps:
- uses: actions/checkout@v4
- name: Decrypt Secrets
run: base64 -d <<< ${{ secrets.GIT_CRYPT_KEY }} | git-crypt unlock -
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
github-token: '${{ github.token }}'
extra-conf: "extra-platforms = aarch64-linux"
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
use-flakehub: false
diagnostic-endpoint: ""
- name: Build package
run: nix build -L .#packages.aarch64-linux.installerPackage
16 changes: 0 additions & 16 deletions flake.lock

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

30 changes: 4 additions & 26 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
forkpkgs.url = "git+file:///Users/quinn/repos/forks/nixpkgs";

nixos-apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon";
Expand All @@ -29,21 +28,13 @@
secrets = builtins.fromJSON (builtins.readFile ./secrets.json);
in
{
packages = forEachSystem (
system:
packages.aarch64-linux =
let
pkgsCross = import nixpkgs {
crossSystem.system = "aarch64-linux";
localSystem.system = system;
overlays = [ nixos-apple-silicon.overlays.default ];
};

pkgsHost = import nixpkgs {
system = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ nixos-apple-silicon.overlays.default ];
};

pkgs = if system == "x64-linux" then pkgsCross else pkgsHost;
in
{
installerPackage = pkgs.callPackage ./package.nix { inherit self pkgs; };
Expand All @@ -53,7 +44,7 @@
image-config = nixpkgs.lib.nixosSystem {
inherit system;

pkgs = if system == "x86_64-linux" then pkgsCross else pkgsHost;
pkgs = import nixpkgs { inherit system; };

specialArgs = {
modulesPath = nixpkgs + "/nixos/modules";
Expand All @@ -68,21 +59,8 @@
config = image-config.config;
in
config.system.build.image;
}
);

nixosConfigurations.nixos = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
pkgs = import nixpkgs { inherit system; };

specialArgs = {
inherit inputs;
modulesPath = nixpkgs + "/nixos/modules";
};

modules = [ ./nixos/configuration.nix ];
};

apps = forEachSystem (
system:
let
Expand Down

0 comments on commit 73ce747

Please sign in to comment.