commit 0d79b3a472a3287b87d3a65837a021857923515e Author: Florian RICHER Date: Thu Apr 11 17:15:11 2024 +0200 Begin work diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3c0df7b --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712757991, + "narHash": "sha256-kR7C7Fqt3JP40h0mzmSZeWI5pk1iwqj4CSeGjnUbVHc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d6b3ddd253c578a7ab98f8011e59990f21dc3932", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "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/flake.nix b/flake.nix new file mode 100644 index 0000000..f45c71f --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "Standard packages"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + packages = import ./pkgs { + inherit (nixpkgs) lib; + inherit pkgs; + }; + }); +} \ No newline at end of file diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..1ffe446 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,6 @@ +{ lib, pkgs, ... }: + +{ + goPackages = import ./go { inherit lib pkgs; }; + nodePackages = import ./node { inherit lib pkgs; }; +} \ No newline at end of file diff --git a/pkgs/go/default.nix b/pkgs/go/default.nix new file mode 100644 index 0000000..32a3dba --- /dev/null +++ b/pkgs/go/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + stripeMock = pkgs.callPackage ./stripe-mock.nix { }; +} \ No newline at end of file diff --git a/pkgs/go/stripe-mock.nix b/pkgs/go/stripe-mock.nix new file mode 100644 index 0000000..560a678 --- /dev/null +++ b/pkgs/go/stripe-mock.nix @@ -0,0 +1,17 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, +}: + +buildGoModule { + pname = "stripe-mock"; + version = "v0.183.0"; + vendorHash = null; + src = fetchFromGitHub { + owner = "stripe"; + repo = "stripe-mock"; + rev = "v0.183.0"; + sha256 = "hdcINPrlE4bjSCOUJG64Ok1gz+jwYhf2RzT+eBK7dPM="; + }; +} \ No newline at end of file diff --git a/pkgs/node/default.nix b/pkgs/node/default.nix new file mode 100644 index 0000000..da1551c --- /dev/null +++ b/pkgs/node/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + maildev = pkgs.callPackage ./maildev.nix {}; +} \ No newline at end of file diff --git a/pkgs/node/maildev.nix b/pkgs/node/maildev.nix new file mode 100644 index 0000000..06ab690 --- /dev/null +++ b/pkgs/node/maildev.nix @@ -0,0 +1,22 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, + + # Dependencies + nodejs_18, +}: + +buildNpmPackage { + pname = "maildev"; + version = "v2.1.0"; + nodejs = nodejs_18; + dontNpmBuild = true; + src = fetchFromGitHub { + owner = "maildev"; + repo = "maildev"; + rev = "v2.1.0"; + sha256 = "lTLhQ+gKQvfagKp0Ig+uOGwkUtzORaY1TzIkFOcoO3I="; + }; + npmDepsHash = "sha256-2JGA9x5t17EoE7JZeYhorsKfTXM1jSgOWBp/Npzn0d4="; +} \ No newline at end of file