From 101d4ee4ad20264beb67c8ff012fbc1ec7f2756b Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 29 Aug 2022 11:41:29 -0500 Subject: [PATCH] chore: add flake for development with Nix (#5509) --- flake.lock | 41 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 25 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..55d0e8758 --- /dev/null +++ b/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1660639432, + "narHash": "sha256-2WDiboOCfB0LhvnDVMXOAr8ZLDfm3WdO54CkoDPwN1A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6c6409e965a6c883677be7b9d87a95fab6c3472e", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..c58774661 --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "code-server"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = nixpkgs.legacyPackages.${system}; + nodejs = pkgs.nodejs-16_x; + yarn' = pkgs.yarn.override { inherit nodejs; }; + in { + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + nodejs yarn' python pkg-config git rsync jq moreutils + ]; + buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ] + ++ (with xorg; [ libX11 libxkbfile ]) + ++ lib.optionals stdenv.isDarwin [ + AppKit Cocoa CoreServices Security cctools xcbuild + ]); + }; + } + ); +}