mirror of
https://github.com/NotAShelf/projectile-simulation.git
synced 2024-11-01 11:01:19 +00:00
nix toolkit
This commit is contained in:
parent
a532eae13b
commit
721ff3eb3c
4 changed files with 89 additions and 1 deletions
38
default.nix
Normal file
38
default.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
doCheck ? true,
|
||||
...
|
||||
}:
|
||||
python3Packages.buildPythonApplication {
|
||||
pname = "projectile-simulation";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
numpy
|
||||
matplotlib
|
||||
pytest
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
python3Packages.pytest
|
||||
];
|
||||
|
||||
checkPhase = lib.optionals doCheck ''
|
||||
runHook preCheck
|
||||
pytest
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Simulate the motion of a projectile with air resistance";
|
||||
longDescription = ''
|
||||
This is a Python package that simulates the motion of a projectile with air resistance.
|
||||
It is based on the Euler method.
|
||||
'';
|
||||
license = lib.licenses.eupl12;
|
||||
maintainers = with lib.maintainers; [NotAShelf];
|
||||
};
|
||||
}
|
27
flake.lock
Normal file
27
flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1696661029,
|
||||
"narHash": "sha256-GIB5VTkvsDIqfMpdtuetOzpm64P8wm8nBSv5Eo8XM3Y=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2de1be5b51c3d6fa833f1c1f222dc867dd054b31",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
23
flake.nix
Normal file
23
flake.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}: let
|
||||
systems = ["x86_64-linux" "aarch64-linux"];
|
||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
pkgsForEach = nixpkgs.legacyPackages;
|
||||
in {
|
||||
packages = forEachSystem (system: {
|
||||
default = pkgsForEach.${system}.callPackage ./default.nix {};
|
||||
});
|
||||
|
||||
devShells = forEachSystem (system: {
|
||||
devShells = {
|
||||
default = pkgsForEach.${system}.callPackage ./shell.nix {};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs ? import <nixpkgs> {}}: let
|
||||
{pkgs, ...}: let
|
||||
my-python-packages = ps:
|
||||
with ps; [
|
||||
matplotlib
|
||||
|
|
Loading…
Reference in a new issue