add nightly build process

This commit is contained in:
Daylin Morgan 2024-07-11 16:31:51 -05:00
parent 3c93835312
commit 0c172affc5
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 53 additions and 5 deletions

47
.github/workflows/nightly.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Build NixOS (on demand)
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
# cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/clean-disk
- uses: DeterminateSystems/nix-installer-action@v12
with:
extra-conf: |
accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v15
with:
name: daylin
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Update nix flake
run:
nix flake update >> $GITHUB_STEP_SUMMARY
- name: Build
run: |
nix run . \
-- \
build --minimal \
--host "othalan" \
--flake . \
--verbose \
--debug \
-- \
--print-build-logs

View file

@ -1,6 +1,5 @@
inputs: inputs@{ nixpkgs, self, ... }:
let let
inherit (inputs) nixpkgs self;
lib = nixpkgs.lib.extend (import ./extended.nix); lib = nixpkgs.lib.extend (import ./extended.nix);
inherit (builtins) mapAttrs readDir listToAttrs; inherit (builtins) mapAttrs readDir listToAttrs;
@ -11,8 +10,7 @@ let
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; #supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
supportedSystems = [ "x86_64-linux" ]; supportedSystems = [ "x86_64-linux" ];
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; })); forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
in
{
oizysFlake = { oizysFlake = {
nixosModules = listToAttrs (findModulesList ../modules); nixosModules = listToAttrs (findModulesList ../modules);
nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts); nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
@ -38,4 +36,7 @@ in
); );
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
}; };
in
{
inherit oizysFlake;
} }

View file

@ -8,7 +8,7 @@
let let
inherit (lib) mkIfIn; inherit (lib) mkIfIn;
cfg = config.oizys.languages; cfg = config.oizys.languages;
zig = inputs.zig2nix.outputs.packages.${pkgs.system}.zig.default.bin; zig = inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin;
zls = inputs.zls.outputs.packages.${pkgs.system}.default.overrideAttrs { zls = inputs.zls.outputs.packages.${pkgs.system}.default.overrideAttrs {
nativeBuildInputs = [ zig ]; nativeBuildInputs = [ zig ];
}; };