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 flake.nix #128

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
76 changes: 42 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

# Set up the flutter environment and run checks
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.9'
channel: 'stable'

- name: Install nix

uses: nixbuild/nix-quick-install-action@v26
- name: Run nix develop
working-directory: snippets/dart_snippets
run: nix develop

- uses: actions/download-artifact@v3
with:
Expand All @@ -130,11 +131,11 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install nix
uses: nixbuild/nix-quick-install-action@v26
- name: Run nix develop
working-directory: snippets/csharp
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -167,10 +168,12 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install nix
uses: nixbuild/nix-quick-install-action@v26

- name: Run nix develop
working-directory: snippets/react-native
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -199,11 +202,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Install nix
uses: nixbuild/nix-quick-install-action@v26
- name: Run nix develop
working-directory: snippets/go
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -234,19 +238,22 @@ jobs:
go build .

check-python:
needs:
- build-packages
needs:
- build-packages

name: Check Python snippets
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name : Install nix
uses: nixbuild/nix-quick-install-action@v26

- name: Run nix develop
working-directory: snippets/go
run: nix develop

- name: Download archived package
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -292,18 +299,19 @@ jobs:
name: Check kotlin MPP snippets
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Java 17
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
- name : Install nix
uses: nixbuild/nix-quick-install-action@v26
- working-directory: snippets/kotlin_mpp_lib
run: nix develop


- name: Compile Kotlin
working-directory: snippets/kotlin_mpp_lib
run: |
./gradlew clean
./gradlew build


Expand Down
5 changes: 4 additions & 1 deletion snippets/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ Add a package reference to your local nuget package:
dotnet add package Breez.Sdk -s ./packages
```

Happy coding
Happy coding

## Nix
Use the command `nix develop`
61 changes: 61 additions & 0 deletions snippets/csharp/flake.lock

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

27 changes: 27 additions & 0 deletions snippets/csharp/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
description = "Dotnet flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, flake-utils
,
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
dotnet-sdk_7
dotnetPackages.Nuget
];
};

formatter = pkgs.nixpkgs-fmt;
});
}
5 changes: 4 additions & 1 deletion snippets/dart_snippets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
- By running the publish-all-platforms CI in the breez-sdk repository (use dummy binaries)
- or by cloning https://github.com/breez/breez-sdk-flutter
2. Place the files in the folder `snippets/dart-snippets/packages/breez-sdk-flutter`
3. Happy coding
3. Happy coding

## Nix
Use the command `nix develop`
61 changes: 61 additions & 0 deletions snippets/dart_snippets/flake.lock

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

26 changes: 26 additions & 0 deletions snippets/dart_snippets/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
description = "Flutter flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, flake-utils
,
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
flutter
];
};

formatter = pkgs.nixpkgs-fmt;
});
}
5 changes: 4 additions & 1 deletion snippets/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
- By running the publish-all-platforms CI in the breez-sdk repository (use dummy binaries)
- or by cloning https://github.com/breez/breez-sdk-go
2. Place the files in the folder `snippets/go/packages/breez-sdk-go`
3. Happy coding
3. Happy coding

## With nix
Use the command `nix develop`
61 changes: 61 additions & 0 deletions snippets/go/flake.lock

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

Loading
Loading