Skip to content

Commit

Permalink
Merge pull request #1 from NetUnion/flake
Browse files Browse the repository at this point in the history
Add flake and build workflow
  • Loading branch information
pure01fx authored Oct 25, 2023
2 parents 974db3a + fd0d5ae commit b70ba4e
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build -L .#default
- uses: actions/upload-artifact@v3
with:
name: static-build
path: result/bin
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/.vscode
/config.json
/config.json
/result
64 changes: 64 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
description = "login portal";

inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};

outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
perSystem = { pkgs, ... }: {
packages = rec {
nd-portal = with pkgs; pkgsStatic.rustPlatform.buildRustPackage rec {
name = "nd-portal";

src = lib.cleanSource ./.;

cargoLock.lockFile = ./Cargo.lock;

nativeBuildInputs = [ pkg-config ];

buildInputs = with pkgsStatic; [ openssl ];
};
default = nd-portal;
};
};
};
}

0 comments on commit b70ba4e

Please sign in to comment.