diff --git a/README.md b/README.md index fe26baa..e35c002 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,15 @@ $ ./top500.py # Download and combine latest biannual spreadsheets $ ./top500_plot.py # Create PNG- and SVG-format plots using TOP500_history.csv ``` +# With Nix + +This repository provides a [Nix](https://nixos.org) environment. You can run the scripts as: + +``` +$ nix develop --command python3 top500.py +$ nix develop --command python3 top500_plot.py +``` + # License GPLv3 or later diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..08aa81f --- /dev/null +++ b/flake.lock @@ -0,0 +1,44 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1685566663, + "narHash": "sha256-btHN1czJ6rzteeCuE/PNrdssqYD2nIA4w48miQAFloM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4ecab3273592f27479a583fb6d975d4aba3486fe", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_top500": { + "locked": { + "lastModified": 1618216442, + "narHash": "sha256-t2CgQ5UCbrvE9DucMMcz9++S0gEVd0QKUNG9EyEAgwU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dce8fc727dc2891628e4f878bb18af643b7b255d", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dce8fc727dc2891628e4f878bb18af643b7b255d", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs_top500": "nixpkgs_top500" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..951a0aa --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/23.05"; + nixpkgs_top500.url = "github:nixos/nixpkgs/dce8fc727dc2891628e4f878bb18af643b7b255d"; + }; + + outputs = { self, nixpkgs, nixpkgs_top500 }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + pkgs_top500 = import nixpkgs_top500 { inherit system; }; + in + { + devShells.${system} = { + default = pkgs.mkShell { + buildInputs = [ + pkgs_top500.python3 + pkgs_top500.python3Packages.xlrd + pkgs_top500.python3Packages.matplotlib + pkgs_top500.python3Packages.pandas + pkgs_top500.python3Packages.mechanize + ]; + }; + }; + }; +}