Add flake.nix to project

This commit is contained in:
Oystein Kristoffer Tveit 2023-05-04 16:40:30 +02:00
parent e04d558b3a
commit cebb6ccb86
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
6 changed files with 77 additions and 5 deletions

4
.gitignore vendored
View File

@ -18,4 +18,6 @@ venv.bak/
.env.production.local .env.production.local
.env.local .env.local
dist/ dist/
result

26
flake.lock Normal file
View File

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1683014792,
"narHash": "sha256-6Va9iVtmmsw4raBc3QKvQT2KT/NGRWlvUlJj46zN8B8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1a411f23ba299db155a5b45d5e145b85a7aafc42",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

44
flake.nix Normal file
View File

@ -0,0 +1,44 @@
{
# inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
in {
apps.${system} = let
app = program: {
type = "app";
inherit program;
};
in {
default = self.apps.${system}.dev;
dev = app "${self.packages.${system}.worblehat}/bin/dev";
scanner = app "${self.packages.${system}.worblehat}/bin/scanner";
};
packages.${system} = {
default = self.packages.${system}.worblehat;
worblehat = with pkgs.python3Packages; buildPythonPackage {
pname = "worblehat";
version = "0.1.0";
src = ./.;
format = "pyproject";
buildInputs = [ poetry-core ];
propagatedBuildInputs = [
alembic
click
flask
flask-admin
flask-sqlalchemy
isbnlib
python-dotenv
sqlalchemy
];
};
};
};
}

View File

@ -7,22 +7,22 @@ license = "MIT"
readme = "README.md" readme = "README.md"
[tool.poetry.dependencies] [tool.poetry.dependencies]
alembic = "^1.10.4" alembic = "^1.9.4"
click = "^8.1.3" click = "^8.1.3"
flask = "^2.3.2" flask = "^2.2.2"
flask-admin = "^1.6.1" flask-admin = "^1.6.1"
flask-sqlalchemy = "^3.0.3" flask-sqlalchemy = "^3.0.3"
isbnlib = "^3.10.14" isbnlib = "^3.10.14"
python = "^3.10" python = "^3.10"
python-dotenv = "^1.0.0" python-dotenv = "^1.0.0"
sqlalchemy = "^2.0.12" sqlalchemy = "^2.0.8"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
werkzeug = "^2.3.3" werkzeug = "^2.3.3"
[tool.poetry.scripts] [tool.poetry.scripts]
scanner = "worblehat.tools.scanner:main" scanner = "worblehat.tools.scanner:main"
dev = "worblehat.wsgi-dev:main" dev = "worblehat.wsgi_dev:main"
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]