Merge d86279d64bdd19c34bbd8d5dcaeeef80654a6efc into 5cfd5166ea7680b784fd8cf556c6d07a9ecce260

This commit is contained in:
Victor Engmark 2023-07-25 12:40:43 +12:00 committed by GitHub
commit 2388010f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 128 additions and 102 deletions

View File

@ -1,11 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: '00:00'
time: "00:00"
timezone: UTC
open-pull-requests-limit: 10
commit-message:

View File

@ -102,3 +102,13 @@ jobs:
- run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
- run: docker pull ghcr.io/catthehacker/ubuntu:js-20.04
- run: ./bin/act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-20.04 push -j simple-build
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: ./
with:
nix_path: nixpkgs=channel:nixos-22.11
- run: nix-shell --packages cacert git nix nodejs pre-commit --pure --run 'pre-commit run --all-files'

3
.gitignore vendored
View File

@ -91,3 +91,6 @@ typings/
# DynamoDB Local files
.dynamodb/
# JetBrains IDEA configuration
/.idea/

14
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,14 @@
# Configuration file for pre-commit (https://pre-commit.com/).
# Please run `pre-commit run --all-files` when adding or changing entries.
repos:
- repo: https://github.com/kamadorueda/alejandra
rev: bb7f2ad3f176aa8e9e2944a10061f7989c8fef17 # frozen: 1.3.0
hooks:
- id: alejandra
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 6f3cb139ef36133b6f903b97facc57b07cef57c9 # frozen: v3.0.0-alpha.6
hooks:
- id: prettier
stages: [commit]

View File

@ -1,22 +1,22 @@
name: 'Install Nix'
description: 'Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.'
author: 'Domen Kožar'
name: "Install Nix"
description: "Installs Nix on GitHub Actions for the supported platforms: Linux and macOS."
author: "Domen Kožar"
inputs:
extra_nix_config:
description: 'Gets appended to `/etc/nix/nix.conf` if passed.'
description: "Gets appended to `/etc/nix/nix.conf` if passed."
github_access_token:
description: 'Configure nix to pull from github using the given github token.'
description: "Configure nix to pull from github using the given github token."
install_url:
description: 'Installation URL that will contain a script to install Nix.'
description: "Installation URL that will contain a script to install Nix."
install_options:
description: 'Additional installer flags passed to the installer script.'
description: "Additional installer flags passed to the installer script."
nix_path:
description: 'Set NIX_PATH environment variable.'
description: "Set NIX_PATH environment variable."
branding:
color: 'blue'
icon: 'sun'
color: "blue"
icon: "sun"
runs:
using: 'composite'
using: "composite"
steps:
- run: ${GITHUB_ACTION_PATH}/install-nix.sh
shell: bash

View File

@ -1,18 +1,18 @@
# Realizes <num>> of derivations with size of <size>MB
{ size ? 1 # MB
, num ? 10 # count
, currentTime ? builtins.currentTime
, noChroot ? false
{
size ? 1, # MB
num ? 10, # count
currentTime ? builtins.currentTime,
noChroot ? false,
}:
with import <nixpkgs> {};
let
drv = i: runCommand "${toString currentTime}-${toString i}" {
with import <nixpkgs> {}; let
drv = i:
runCommand "${toString currentTime}-${toString i}" {
__noChroot = noChroot;
} ''
dd if=/dev/zero of=$out bs=${toString size}MB count=1
'';
in writeText "empty-${toString num}-${toString size}MB" ''
in
writeText "empty-${toString num}-${toString size}MB" ''
${lib.concatMapStringsSep "" drv (lib.range 1 num)}
''