From abcf2b32777ffb934788e3219cacc2bbc048b6a3 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 11 Apr 2021 15:31:32 +0530 Subject: add `selection-start` and `selection-end` primitives --- flake.nix | 104 ++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 51 insertions(+), 53 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 07a9a06..2acc1f3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,9 +6,9 @@ url = "github:mozilla/nixpkgs-mozilla"; flake = false; }; - gitignore = { - url = "github:hercules-ci/gitignore"; - flake=false; + gitignore = { + url = "github:hercules-ci/gitignore"; + flake = false; }; flake-compat = { url = "github:edolstra/flake-compat"; @@ -17,59 +17,57 @@ }; outputs = { self, nixpkgs, utils, naersk, mozillapkgs, gitignore, ... }: - utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages."${system}"; - inherit (import gitignore { inherit (pkgs) lib; }) gitignoreSource; - - # Get a specific rust version - mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") {}; + utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; + inherit (import gitignore { inherit (pkgs) lib; }) gitignoreSource; - rust = (mozilla.rustChannelOf { - date = "2021-03-31"; - channel = "nightly"; - sha256 = "oK5ebje09MRn988saJMT3Zze/tRE7u9zTeFPV1CEeLc="; # set zeros after modifying channel or date - }).rust; + # Get a specific rust version + mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { }; + chanspec = { + date = "2021-03-31"; + channel = "nightly"; + sha256 = "oK5ebje09MRn988saJMT3Zze/tRE7u9zTeFPV1CEeLc="; # set zeros after modifying channel or date + }; - rust-src = (mozilla.rustChannelOf { - date = "2021-03-31"; - channel = "nightly"; - sha256 = "oK5ebje09MRn988saJMT3Zze/tRE7u9zTeFPV1CEeLc="; # set zeros after modifying channel or date - }).rust-src; + rustChannel = mozilla.rustChannelOf chanspec; + rust = rustChannel.rust; + rust-src = rustChannel.rust-src; - naersk-lib = naersk.lib."${system}".override { - cargo = rust; - rustc = rust; - }; + naersk-lib = naersk.lib."${system}".override { + cargo = rust; + rustc = rust; + }; - nativeBuildInputs = with pkgs; [ - SDL2 - SDL2_ttf - ]; + nativeBuildInputs = with pkgs; [ + SDL2 + SDL2_ttf + ]; - in rec { - packages.my-project = naersk-lib.buildPackage { - pname = "sdl-tests"; - version = "0.1.0"; - root = gitignoreSource ./.; - inherit nativeBuildInputs; - }; - defaultPackage = packages.my-project; - apps.my-project = utils.lib.mkApp { - drv = packages.my-project; - }; - defaultApp = apps.my-project; - devShell = pkgs.mkShell { - nativeBuildInputs = nativeBuildInputs ++ (with pkgs; [ - rust - rust-src - rust-analyzer - rustfmt - cargo - ]); - RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; - RUST_LOG="info"; - RUST_BACKTRACE=1; - }; - }); + in + rec { + packages.my-project = naersk-lib.buildPackage { + pname = "sdl-tests"; + version = "0.1.0"; + root = gitignoreSource ./.; + inherit nativeBuildInputs; + }; + defaultPackage = packages.my-project; + apps.my-project = utils.lib.mkApp { + drv = packages.my-project; + }; + defaultApp = apps.my-project; + devShell = pkgs.mkShell { + nativeBuildInputs = nativeBuildInputs ++ [ + rust + rust-src + pkgs.rust-analyzer + pkgs.rustfmt + pkgs.cargo + ]; + RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library"; + RUST_LOG = "info"; + RUST_BACKTRACE = 1; + }; + }); } -- cgit v1.2.3