From 2eb9502171cdac826a6973245bd36a3652846672 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sat, 17 Aug 2024 23:46:08 -0700 Subject: [PATCH] initial commit --- flake.lock | 96 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2a46240 --- /dev/null +++ b/flake.lock @@ -0,0 +1,96 @@ +{ + "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": 1723637854, + "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1718428119, + "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", + "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": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1723947704, + "narHash": "sha256-TcVf66N2NgGhxORFytzgqWcg0XJ+kk8uNLNsTRI5sYM=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "456e78a55feade2c3bc6d7bc0bf5e710c9d86120", + "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" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e24c239 --- /dev/null +++ b/flake.nix @@ -0,0 +1,119 @@ +{ + description = "Flake for various development environments."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay.url = "github:oxalica/rust-overlay"; + }; + + outputs = { + nixpkgs, + flake-utils, + rust-overlay, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + overlays = [(import rust-overlay)]; + pkgs = import nixpkgs { + inherit system overlays; + }; + in { + devShells = { + go = pkgs.mkShell { + buildInputs = with pkgs; [ + go + ]; + }; + + zig = pkgs.mkShell { + buildInputs = with pkgs; [ + zig + ]; + }; + + pythonPoetry = pkgs.mkShell { + buildInputs = with pkgs; [ + poetry + ]; + }; + + haskellStack = pkgs.mkShell { + buildInputs = with pkgs; [ + haskellPackages.stack + ]; + }; + + haskellCabal = pkgs.mkShell { + buildInputs = with pkgs; [ + haskellPackages.cabal-install + ghc + ]; + }; + + rustBeta = pkgs.mkShell { + buildInputs = with pkgs; [ + rust-bin.beta.latest.default + ]; + }; + + rustNightly = pkgs.mkShell { + buildInputs = with pkgs; [ + rust-bin.nightly.latest.default + ]; + }; + + rustStable = pkgs.mkShell { + buildInputs = with pkgs; [ + rust-bin.stable.latest.default + ]; + }; + + npmNode = pkgs.mkShell { + buildInputs = with pkgs; [ + nodejs + nodePackages_latest.npm + nodePackages_latest.prettier + ]; + }; + + pnpmNode = pkgs.mkShell { + buildInputs = with pkgs; [ + nodejs + nodePackages_latest.pnpm + nodePackages_latest.prettier + ]; + }; + + yarnNode = pkgs.mkShell { + buildInputs = with pkgs; [ + nodejs + nodePackages_latest.yarn + nodePackages_latest.prettier + ]; + }; + + typst = pkgs.mkShell { + buildInputs = with pkgs; [ + typst + typstfmt + tinymist + ]; + }; + + latexFull = pkgs.mkShell { + buildInputs = with pkgs; [ + texliveFull + ]; + }; + + latexMinimal = pkgs.mkShell { + buildInputs = with pkgs; [ + texliveMinimal + ]; + }; + }; + } + ); +}