Skip to content
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
23 changes: 23 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build Nix package

on:
workflow_dispatch:
pull_request:
paths:
- go.mod
- go.sum

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

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Build flake package
run: |
nix build .#pangolin-newt -L
48 changes: 48 additions & 0 deletions .github/workflows/nix-dependabot-update-hash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Nix Package Hash On Dependabot PRs

on:
pull_request:
types: [opened, synchronize]
branches:
- main

jobs:
nix-update:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Run nix-update
run: |
nix run nixpkgs#nix-update -- --flake pangolin-newt --no-src --version skip

- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit and push changes
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "dependabot[bot]"
git config user.email "dependabot[bot]@users.noreply.github.com"

git add .
git commit -m "chore(nix): fix hash for updated go dependencies"
git push
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ nohup.out
*.iml
certs/
newt_arm64
key
key
/.direnv/
/result*
15 changes: 14 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
inherit (pkgs) lib;

# Update version when releasing
version = "1.7.0";
version = "1.8.0";
in
{
default = self.packages.${system}.pangolin-newt;
Expand All @@ -37,21 +37,34 @@

vendorHash = "sha256-5Xr6mwPtsqEliKeKv2rhhp6JC7u3coP4nnhIxGMqccU=";

nativeInstallCheckInputs = [ pkgs.versionCheckHook ];

env = {
CGO_ENABLED = 0;
};

ldflags = [
"-s"
"-w"
"-X main.newtVersion=${version}"
];

# Tests are broken due to a lack of Internet.
# Disable running `go test`, and instead do
# a simple version check instead.
doCheck = false;
doInstallCheck = true;

versionCheckProgramArg = [ "-version" ];

meta = {
description = "A tunneling client for Pangolin";
homepage = "https://github.com/fosrl/newt";
license = lib.licenses.gpl3;
maintainers = [
lib.maintainers.water-sucks
];
mainProgram = "newt";
};
};
}
Expand Down