From 810144f4056b2eb7686776ff1bfea6263ef73a2a Mon Sep 17 00:00:00 2001 From: Brice Redmond Date: Mon, 4 Nov 2024 13:56:29 -0800 Subject: [PATCH 1/2] [other] add nix --- .envrc | 1 + .gitignore | 3 +- flake.lock | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 42 ++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..8392d159 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6a8a90b5..305c9c75 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ dist dev .nyc_output test-results.json -.idea/ \ No newline at end of file +.idea/ +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..d41a6472 --- /dev/null +++ b/flake.lock @@ -0,0 +1,96 @@ +{ + "nodes": { + "branch-nix": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", + "utils": "utils" + }, + "locked": { + "lastModified": 1730304375, + "narHash": "sha256-e3lFvGSVY+L4UE/kmcIA9peAuPpx6Ibxx33wpNdHlt0=", + "ref": "refs/heads/master", + "rev": "5b627a4d06c0f457afcdcdad80eb086835b677e4", + "revCount": 84, + "type": "git", + "url": "ssh://git@github.com/BranchMetrics/nix" + }, + "original": { + "type": "git", + "url": "ssh://git@github.com/BranchMetrics/nix" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730137625, + "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1729880355, + "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18536bf04cd71abd345f9579158841376fdd0c5a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "branch-nix": "branch-nix" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..6f530771 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "NodeJS 16_x project"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + branch-nix.url = "git+ssh://git@github.com/BranchMetrics/nix"; + }; + + outputs = { self, branch-nix }: + let + nixpkgs = branch-nix.nixpkgs; + nixpkgs-unstable = branch-nix.nixpkgs-unstable; + extra-pkgs = branch-nix.packages; + utils = branch-nix.utils; + system-utils = branch-nix.system-utils; + in + utils.lib.eachDefaultSystem (system: + let + stable-pkgs = nixpkgs.legacyPackages.${system}; + unstable-pkgs = nixpkgs.legacyPackages.${system}; + pkgs = stable-pkgs // { + extra-pkgs = extra-pkgs.${system}; + unstable = unstable-pkgs; + }; + bazel-os = system-utils.getBazelOs system; + nodejs = pkgs.extra-pkgs.nodejs-16_x; + in + { + devShell = pkgs.mkShell { + nativeBuildInputs = [ + nodejs + ]; + shellHook = '' + if [ -f $HOME/.config/bin/setup-webstorm-sdk ] && [ -f ./.idea/workspace.xml ]; then + $HOME/.config/bin/setup-webstorm-sdk || echo "setup-webstorm-sdk failed" + fi + ''; + }; + formatter = pkgs.nixpkgs-fmt; + } + ); +} From da6b56e72ff8a82cd7c4ffa355327cfb628f45fc Mon Sep 17 00:00:00 2001 From: Brice Redmond Date: Mon, 4 Nov 2024 14:07:47 -0800 Subject: [PATCH 2/2] pr comments --- .github/workflows/deploy-qa.yml | 2 +- .github/workflows/gate-keep.yml | 2 +- flake.lock | 45 ++++----------------------------- flake.nix | 25 +++++------------- 4 files changed, 13 insertions(+), 61 deletions(-) diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index 7000ddb4..063e7cf5 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -9,7 +9,7 @@ on: - README.md env: BRANCH_NAME: '${{ github.event.inputs.branch_name || github.head_ref || github.ref_name }}' - NODE_VERSION: 16 + NODE_VERSION: 18 JAVA_VERSION: 11 JAVA_DISTRIBUTION: 'adopt' diff --git a/.github/workflows/gate-keep.yml b/.github/workflows/gate-keep.yml index 8125a501..09fab731 100644 --- a/.github/workflows/gate-keep.yml +++ b/.github/workflows/gate-keep.yml @@ -2,7 +2,7 @@ name: Gate Keeping on: push: env: - NODE_VERSION: 16 + NODE_VERSION: 18 JAVA_VERSION: 11 JAVA_DISTRIBUTION: 'adopt' diff --git a/flake.lock b/flake.lock index d41a6472..2df95f3b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,32 +1,12 @@ { "nodes": { - "branch-nix": { - "inputs": { - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", - "utils": "utils" - }, - "locked": { - "lastModified": 1730304375, - "narHash": "sha256-e3lFvGSVY+L4UE/kmcIA9peAuPpx6Ibxx33wpNdHlt0=", - "ref": "refs/heads/master", - "rev": "5b627a4d06c0f457afcdcdad80eb086835b677e4", - "revCount": 84, - "type": "git", - "url": "ssh://git@github.com/BranchMetrics/nix" - }, - "original": { - "type": "git", - "url": "ssh://git@github.com/BranchMetrics/nix" - } - }, "nixpkgs": { "locked": { - "lastModified": 1730137625, - "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "lastModified": 1730602179, + "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", "type": "github" }, "original": { @@ -36,25 +16,10 @@ "type": "github" } }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1729880355, - "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "18536bf04cd71abd345f9579158841376fdd0c5a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "branch-nix": "branch-nix" + "nixpkgs": "nixpkgs", + "utils": "utils" } }, "systems": { diff --git a/flake.nix b/flake.nix index 6f530771..576dc94c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,29 +1,16 @@ { - description = "NodeJS 16_x project"; + description = "web-branch-deep-linking-attribution flake"; inputs = { - # Specify the source of Home Manager and Nixpkgs. - branch-nix.url = "git+ssh://git@github.com/BranchMetrics/nix"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + utils.url = "github:numtide/flake-utils"; }; - outputs = { self, branch-nix }: - let - nixpkgs = branch-nix.nixpkgs; - nixpkgs-unstable = branch-nix.nixpkgs-unstable; - extra-pkgs = branch-nix.packages; - utils = branch-nix.utils; - system-utils = branch-nix.system-utils; - in + outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: let - stable-pkgs = nixpkgs.legacyPackages.${system}; - unstable-pkgs = nixpkgs.legacyPackages.${system}; - pkgs = stable-pkgs // { - extra-pkgs = extra-pkgs.${system}; - unstable = unstable-pkgs; - }; - bazel-os = system-utils.getBazelOs system; - nodejs = pkgs.extra-pkgs.nodejs-16_x; + pkgs = nixpkgs.legacyPackages.${system}; + nodejs = pkgs.nodejs-18_x; in { devShell = pkgs.mkShell {