From 0d93a7fb84f762eae721dc7797edf16840b38f12 Mon Sep 17 00:00:00 2001 From: ruben beck Date: Mon, 29 Jan 2024 17:00:15 +0100 Subject: [PATCH 1/4] add flake.nix --- snippets/csharp/README.md | 5 ++- snippets/csharp/flake.lock | 61 ++++++++++++++++++++++++++++++ snippets/csharp/flake.nix | 27 +++++++++++++ snippets/dart_snippets/README.md | 5 ++- snippets/dart_snippets/flake.lock | 61 ++++++++++++++++++++++++++++++ snippets/dart_snippets/flake.nix | 26 +++++++++++++ snippets/go/README.md | 5 ++- snippets/go/flake.lock | 61 ++++++++++++++++++++++++++++++ snippets/go/flake.nix | 26 +++++++++++++ snippets/kotlin_mpp_lib/flake.lock | 61 ++++++++++++++++++++++++++++++ snippets/kotlin_mpp_lib/flake.nix | 27 +++++++++++++ snippets/python/flake.lock | 61 ++++++++++++++++++++++++++++++ snippets/python/flake.nix | 27 +++++++++++++ snippets/react-native/flake.lock | 61 ++++++++++++++++++++++++++++++ snippets/react-native/flake.nix | 21 ++++++++++ 15 files changed, 532 insertions(+), 3 deletions(-) create mode 100644 snippets/csharp/flake.lock create mode 100644 snippets/csharp/flake.nix create mode 100644 snippets/dart_snippets/flake.lock create mode 100644 snippets/dart_snippets/flake.nix create mode 100644 snippets/go/flake.lock create mode 100644 snippets/go/flake.nix create mode 100644 snippets/kotlin_mpp_lib/flake.lock create mode 100644 snippets/kotlin_mpp_lib/flake.nix create mode 100644 snippets/python/flake.lock create mode 100644 snippets/python/flake.nix create mode 100644 snippets/react-native/flake.lock create mode 100644 snippets/react-native/flake.nix diff --git a/snippets/csharp/README.md b/snippets/csharp/README.md index 4e9e1f16..f293c212 100644 --- a/snippets/csharp/README.md +++ b/snippets/csharp/README.md @@ -14,4 +14,7 @@ Add a package reference to your local nuget package: dotnet add package Breez.Sdk -s ./packages ``` -Happy coding \ No newline at end of file +Happy coding + +## Nix +Use the command `nix develop` diff --git a/snippets/csharp/flake.lock b/snippets/csharp/flake.lock new file mode 100644 index 00000000..5448dd5e --- /dev/null +++ b/snippets/csharp/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/csharp/flake.nix b/snippets/csharp/flake.nix new file mode 100644 index 00000000..9e070839 --- /dev/null +++ b/snippets/csharp/flake.nix @@ -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; + }); +} diff --git a/snippets/dart_snippets/README.md b/snippets/dart_snippets/README.md index 55f5534d..0dc14fcf 100644 --- a/snippets/dart_snippets/README.md +++ b/snippets/dart_snippets/README.md @@ -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 \ No newline at end of file +3. Happy coding + +## Nix +Use the command `nix develop` diff --git a/snippets/dart_snippets/flake.lock b/snippets/dart_snippets/flake.lock new file mode 100644 index 00000000..5448dd5e --- /dev/null +++ b/snippets/dart_snippets/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/dart_snippets/flake.nix b/snippets/dart_snippets/flake.nix new file mode 100644 index 00000000..2ca92499 --- /dev/null +++ b/snippets/dart_snippets/flake.nix @@ -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; + }); +} diff --git a/snippets/go/README.md b/snippets/go/README.md index 6a91a044..adcb1615 100644 --- a/snippets/go/README.md +++ b/snippets/go/README.md @@ -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 \ No newline at end of file +3. Happy coding + +## With nix +Use the command `nix develop` diff --git a/snippets/go/flake.lock b/snippets/go/flake.lock new file mode 100644 index 00000000..5448dd5e --- /dev/null +++ b/snippets/go/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/go/flake.nix b/snippets/go/flake.nix new file mode 100644 index 00000000..be5842ee --- /dev/null +++ b/snippets/go/flake.nix @@ -0,0 +1,26 @@ +{ + description = "Go 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; [ + go + ]; + }; + + formatter = pkgs.nixpkgs-fmt; + }); +} diff --git a/snippets/kotlin_mpp_lib/flake.lock b/snippets/kotlin_mpp_lib/flake.lock new file mode 100644 index 00000000..5448dd5e --- /dev/null +++ b/snippets/kotlin_mpp_lib/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/kotlin_mpp_lib/flake.nix b/snippets/kotlin_mpp_lib/flake.nix new file mode 100644 index 00000000..bf5878b7 --- /dev/null +++ b/snippets/kotlin_mpp_lib/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Kotlin 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; [ + kotlin + ktlint + ]; + }; + + formatter = pkgs.nixpkgs-fmt; + }); +} diff --git a/snippets/python/flake.lock b/snippets/python/flake.lock new file mode 100644 index 00000000..5448dd5e --- /dev/null +++ b/snippets/python/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/python/flake.nix b/snippets/python/flake.nix new file mode 100644 index 00000000..766a0bf6 --- /dev/null +++ b/snippets/python/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Python 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; [ + python3 + ruff + ]; + }; + + formatter = pkgs.nixpkgs-fmt; + }); +} diff --git a/snippets/react-native/flake.lock b/snippets/react-native/flake.lock new file mode 100644 index 00000000..5448dd5e --- /dev/null +++ b/snippets/react-native/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/react-native/flake.nix b/snippets/react-native/flake.nix new file mode 100644 index 00000000..0e8d46c6 --- /dev/null +++ b/snippets/react-native/flake.nix @@ -0,0 +1,21 @@ +{ + description = "React native 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; [ + nodejs_20 + yarn + nodePackages.eslint + ]; + }; + formatter = pkgs.nixpkgs-fmt; + }); +} From 2f9dc4de9685dd7a9b513ba8479ffa9c502000ff Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Tue, 30 Jan 2024 07:58:45 +0100 Subject: [PATCH 2/4] Add nix flake for Rust snippets --- snippets/rust/flake.lock | 130 +++++++++++++++++++++++++++++++++++++++ snippets/rust/flake.nix | 27 ++++++++ 2 files changed, 157 insertions(+) create mode 100644 snippets/rust/flake.lock create mode 100644 snippets/rust/flake.nix diff --git a/snippets/rust/flake.lock b/snippets/rust/flake.lock new file mode 100644 index 00000000..254e222b --- /dev/null +++ b/snippets/rust/flake.lock @@ -0,0 +1,130 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706373441, + "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "56911ef3403a9318b7621ce745f5452fb9ef6867", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1681358109, + "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1706580650, + "narHash": "sha256-e6q4Pn1dp3NoQJdMYdyNdDHU5IRBW9i3bHSJ3jThEL0=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "39e20b3c02caa91c9970beef325a04975d83d77f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/snippets/rust/flake.nix b/snippets/rust/flake.nix new file mode 100644 index 00000000..5742bd6e --- /dev/null +++ b/snippets/rust/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Rust flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + rust-overlay.url = "github:oxalica/rust-overlay"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { + inherit system overlays; + }; + in + with pkgs; + { + devShells.default = mkShell { + buildInputs = [ + rust-bin.stable.latest.default + ]; + }; + } + ); +} From 33ad346c83c02795099b72a470ee86e99c4e5817 Mon Sep 17 00:00:00 2001 From: ruben beck Date: Mon, 29 Jan 2024 19:13:24 +0100 Subject: [PATCH 3/4] use flake.nix for CI --- .github/workflows/main.yml | 76 +++++++++++++++++-------------- snippets/kotlin_mpp_lib/flake.nix | 1 + snippets/python/flake.nix | 3 +- 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a54d0b4..0e891c71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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 @@ -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 @@ -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: @@ -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: @@ -292,17 +299,16 @@ 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 build diff --git a/snippets/kotlin_mpp_lib/flake.nix b/snippets/kotlin_mpp_lib/flake.nix index bf5878b7..b43782c2 100644 --- a/snippets/kotlin_mpp_lib/flake.nix +++ b/snippets/kotlin_mpp_lib/flake.nix @@ -16,6 +16,7 @@ in { devShells.default = pkgs.mkShell { + # TODO make gradle use java17 by default. buildInputs = with pkgs; [ kotlin ktlint diff --git a/snippets/python/flake.nix b/snippets/python/flake.nix index 766a0bf6..d4b4cd67 100644 --- a/snippets/python/flake.nix +++ b/snippets/python/flake.nix @@ -17,7 +17,8 @@ { devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - python3 + python311Full + python311Packages.pip ruff ]; }; From d30a41ca586705b4244275a3896a69489ebf416d Mon Sep 17 00:00:00 2001 From: ruben beck Date: Tue, 30 Jan 2024 10:13:05 +0100 Subject: [PATCH 4/4] fixup --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e891c71..7eecc8ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -309,7 +309,9 @@ jobs: - name: Compile Kotlin + working-directory: snippets/kotlin_mpp_lib run: | + ./gradlew clean ./gradlew build