Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nix flake to repo #1111

Merged
merged 14 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [email protected]
/nix-update.sh [email protected]
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
Loading