Skip to content

Commit

Permalink
Add nix flake to repo (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheArcaneBrony committed Feb 19, 2024
1 parent 3eb5a3f commit 29df169
Show file tree
Hide file tree
Showing 21 changed files with 433 additions and 295 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nix stuff is owned by Rory& - we& want to be notified if these are changed.
/flake.nix root@rory.gay
/nix-update.sh root@rory.gay
18 changes: 18 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Nix build

on:
push:
pull_request:

jobs:
build-nix:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build -L
- run: nix develop --command echo OK
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ build
*.log.ansi
*.tmp
tmp/
dump/
dump/
result
26 changes: 25 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#!/usr/bin/env sh
#!nix-shell -i "bash" -p bash prefetch-npm-deps jq nodejs nix-output-monitor
. "$(dirname -- "$0")/_/husky.sh"

npx -y lint-staged
# Check if nix is available
if [ -x "$(/usr/bin/env which nix-shell 2>/dev/null)" ]; then
# Check if we haven't re-executed ourselves yet
if [ ! "$HOOK_NIX_SHELL" ]; then
echo "Nix is available, updating nix flake..."
export HOOK_NIX_SHELL=1
nix-shell $0
exit $?
else
nix flake update
# run ./nix-update.sh if package lock has changed and has no unstaged changes
if [ -n "$(git status --porcelain=v1 2>/dev/null | grep -E '^(MM| M) package-lock.json')" ]; then
echo "package-lock.json has unstaged changes. Skipping update of nix dependencies."
elif [ ! -n "$(git status --porcelain=v1 2>/dev/null | grep -E '^M package-lock.json')" ]; then
echo "package-lock.json has no changes. Skipping update of nix dependencies."
else
./nix-update.sh || exit $?
fi
fi
else
echo "You do not appear to have nix installed. Skipping update of nix dependencies."
fi

npx -y lint-staged
Empty file removed assets/inline-plugins/.gitkeep
Empty file.
Empty file removed assets/plugins/.gitkeep
Empty file.
Empty file removed assets/preload-plugins/.gitkeep
Empty file.
38 changes: 0 additions & 38 deletions assets/preload-plugins/checkLocale.js

This file was deleted.

9 changes: 0 additions & 9 deletions assets/preload-plugins/oauth2.js

This file was deleted.

68 changes: 0 additions & 68 deletions assets/public/fosscord-login.css

This file was deleted.

92 changes: 0 additions & 92 deletions assets/public/fosscord.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/public/user.css

This file was deleted.

82 changes: 0 additions & 82 deletions assets/webrtc.js

This file was deleted.

Loading

0 comments on commit 29df169

Please sign in to comment.