Skip to content

Commit

Permalink
Use Nix and put the CI for contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jul 16, 2023
1 parent bef0117 commit 22ba89f
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
24 changes: 24 additions & 0 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI - Nix
on:
pull_request:
paths:
- '.github/workflows/ci-nix.yml'
- '*.nix'
- 'flake.*'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 1 * * *'
workflow_dispatch:

jobs:
tasks:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix flake check
- run: nix develop --command echo 'This step should be done before any other "nix develop" steps because of measuring Nix build time'
- run: nix develop --command make all
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ public
.DS_Store
**/.hugo_build.lock
tmp
.direnv/
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"golang.go",
"github.vscode-github-actions",
"editorconfig.editorconfig",
"tekumara.typos-vscode",
"dprint.dprint",
"jnoortheen.nix-ide",
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true,
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
},
"[go]": {
"editor.defaultFormatter": "golang.go"
}
}
61 changes: 61 additions & 0 deletions flake.lock

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

29 changes: 29 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/7fd307937db70af23b956c4539033542809ae263";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = with pkgs;
mkShell {
buildInputs = [
hugo
go_1_20
gnumake
coreutils
peco
typos
dprint
actionlint
nil
nixpkgs-fmt
];
};
});
}

0 comments on commit 22ba89f

Please sign in to comment.