diff --git a/cs2109s/labs/flake.lock b/cs2109s/labs/flake.lock new file mode 100644 index 0000000..4f62e1e --- /dev/null +++ b/cs2109s/labs/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": 1712310679, + "narHash": "sha256-XgC/a/giEeNkhme/AV1ToipoZ/IVm1MV2ntiK4Tm+pw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "72da83d9515b43550436891f538ff41d68eecc7f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "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/cs2109s/labs/flake.nix b/cs2109s/labs/flake.nix new file mode 100644 index 0000000..9778b27 --- /dev/null +++ b/cs2109s/labs/flake.nix @@ -0,0 +1,37 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + cudaSupport = true; + }; + }; + in rec { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + cudaPackages.cudatoolkit + (python3.withPackages(ps: with ps; [ + ipython + jupyter + numpy + pandas + matplotlib + torch + scikit-learn + timeout-decorator + torchvision + ])) + ]; + shellHook = "jupyter notebook --ip='100.64.0.8'"; + }; + } + ); +}