Skip to content

Commit

Permalink
nix
Browse files Browse the repository at this point in the history
  • Loading branch information
dszakallas committed Sep 1, 2024
1 parent 89b1ba6 commit 17e059d
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 28 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: devenv
- name: Install devenv.sh
run: nix profile install nixpkgs#devenv
- name: Get bun cache directory
id: bun-cache-dir
run: |
Expand All @@ -25,13 +28,12 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
bun install
- name: Check code quality
shell: devenv shell bash -- -e {0}
run: |
make check-all
- name: Compile
shell: devenv shell bash -- -e {0}
run: make
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand All @@ -44,10 +46,13 @@ jobs:
runs-on: ubuntu-latest
if: github.ref_type == 'branch' && github.ref_name == 'master'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: devenv
- name: Install devenv.sh
run: nix profile install nixpkgs#devenv
- name: Get bun cache directory
id: bun-cache-dir
run: |
Expand All @@ -60,15 +65,13 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
bun install
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: mixxx-launchpad-${{ github.sha }}-${{ github.run_id }}
path: dist
- name: Create release
shell: devenv shell bash -- -e {0}
run: bunx semantic-release
env:
GITHUB_TOKEN: ${{ github.token }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@ jspm_packages
.vscode
*.iml
.idea
# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
12 changes: 0 additions & 12 deletions .lefthook.yml

This file was deleted.

2 changes: 0 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ The code should pass CI checks, which is equivalent to running
make check-all
```

We use [lefthook](https://github.com/evilmartians/lefthook) to run precommit hooks.

[babel]: https://babeljs.io/
[rollup]: https://rollupjs.org
[standalone]: https://github.com/substack/node-browserify#usage
Expand Down
Binary file modified bun.lockb
Binary file not shown.
122 changes: 122 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1725121898,
"owner": "cachix",
"repo": "devenv",
"rev": "3ec083c9d58c9007d2be2a6145b578c67322d575",
"treeHash": "bf1b1c575f1a722f1c69c1ea92fa7ff5a6030bb7",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1725001927,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
"treeHash": "1e85443cc9f0ba302df2cf61cacb8014943e2d19",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1724857454,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"treeHash": "ced5a8df7c554ce10bf26223c002f41b31aff034",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}
31 changes: 31 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ pkgs, lib, config, inputs, ... }:

{
packages = with pkgs; [ fswatch jq gnumake ];

languages.javascript = {
enable = true;

bun = {
enable = true;
package = pkgs.bun;
install = {
enable = true;
};
};
};

# https://devenv.sh/pre-commit-hooks/
pre-commit.hooks.eslint = {
enable = true;
entry = "bunx eslint";
files = "\\.(ts|js)$";
};
pre-commit.hooks.prettier = {
enable = true;
entry = "bunx prettier -w";
files = "\\.(ts|js|json|ya?ml|md)$";
};

# See full reference at https://devenv.sh/reference/options/
}
14 changes: 14 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true

# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
#imports:
# - ./backend
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@
"repository": {
"type": "git",
"url": "https://github.com/dszakallas/mixxx-launchpad.git"
},
"dependencies": {
"caniuse-lite": ""
}
}

0 comments on commit 17e059d

Please sign in to comment.