Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Oct 5, 2022
0 parents commit eb5021c
Show file tree
Hide file tree
Showing 139 changed files with 84,949 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

use flake

55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and test flake outputs
on:
push:
workflow_call:
inputs:
branch:
description: Branch name to build on
default: ''
required: false
type: string

jobs:
nix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
system:
- x86_64
nix-command:
- flake check
- eval .#apps.$_system.nixos-install.program
- eval .#apps.$_system.setup.program

include:
- nix-command: develop
system: x86_64

- nix-command: build --dry-run .#homeConfigurations."demo@non-nixos-vm".activationPackage
system: x86_64

- nix-command: build --dry-run .#nixosConfigurations.nixos-vm.config.system.build.toplevel
system: x86_64

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Install nix
uses: cachix/install-nix-action@v16

- name: Build command (x86_64)
if: matrix.system == 'x86_64'
env:
_system: ${{ matrix.system }}-linux
run: |
nix \
--verbose \
--log-format bar-with-logs \
--keep-going \
--show-trace \
${{ matrix.nix-command }}
71 changes: 71 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Update inputs
on:
schedule:
- cron: 0 0 * * *

jobs:
update:
runs-on: ubuntu-latest

outputs:
branch: ${{ steps.branch.outputs.branch }}
update_available: ${{ steps.commit.outputs.changes_detected }}

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install nix
uses: cachix/install-nix-action@v16

- name: Update inputs
run: nix flake update

- name: Set branch name output
id: branch
run: echo "::set-output name=branch::ci/automatic-update-$(date +%Y-%m-%d)"

- name: Create branch locally
run: git switch -c ${{ steps.branch.outputs.branch }}

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
id: commit
with:
commit_author: Christian Harke <[email protected]>
commit_message: "flake.inputs: automatic update"
branch: ${{ steps.branch.outputs.branch }}
push_options: --force

build:
uses: christianharke/nixcfg/.github/workflows/ci.yml@master
needs: update
if: needs.update.outputs.update_available == 'true'
with:
branch: ${{ needs.update.outputs.branch }}

merge:
runs-on: ubuntu-latest
needs:
- update
- build

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Check if update branch is behind master
run: git diff origin/${{ needs.update.outputs.branch }}...origin/master --exit-code

- name: Merge update into master
run: git merge origin/${{ needs.update.outputs.branch }}

- name: Push master
run: git push origin master

- name: Delete update branch
run: git push --delete origin ${{ needs.update.outputs.branch }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
result
.pre-commit-config.yaml

*.tgz
*.tar
*.gz
*.zip
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Christian Harke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit eb5021c

Please sign in to comment.