Remove flake-utils dependency

This commit is contained in:
2026-06-09 16:41:23 -07:00
parent a5d8ba6709
commit 274ae3fb07
2 changed files with 53 additions and 75 deletions

34
flake.lock generated
View File

@@ -1,23 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1780749050, "lastModified": 1780749050,
@@ -36,24 +18,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "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", "root": "root",

View File

@@ -3,54 +3,66 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, flake-utils, ... }: outputs = { self, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system: let
let # Systems to support
pkgs = nixpkgs.legacyPackages.${system}; supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
python = pkgs.python3;
# Helper to generate an attrset for all supported systems
# Define the application package forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
piratsApp = python.pkgs.buildPythonApplication { in
pname = "pirats"; {
version = "0.1.0"; packages = forAllSystems (system:
src = ./.; let
format = "pyproject"; pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python3;
in
{
default = python.pkgs.buildPythonApplication {
pname = "pirats";
version = "0.1.0";
src = ./.;
format = "pyproject";
nativeBuildInputs = with python.pkgs; [ nativeBuildInputs = with python.pkgs; [
setuptools setuptools
wheel wheel
]; ];
propagatedBuildInputs = with python.pkgs; [ propagatedBuildInputs = with python.pkgs; [
fastapi fastapi
sqlmodel sqlmodel
uvicorn uvicorn
jinja2 jinja2
python-multipart python-multipart
]; ];
nativeCheckInputs = with python.pkgs; [ nativeCheckInputs = with python.pkgs; [
pytestCheckHook pytestCheckHook
]; ];
pythonImportsCheck = [ "pirats" ]; pythonImportsCheck = [ "pirats" ];
}; };
in pirats = self.packages.${system}.default;
{ }
packages.default = piratsApp; );
packages.pirats = piratsApp;
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.default ];
packages = with pkgs; [
pkgs.python3.pkgs.pytest
];
};
}
);
devShells.default = pkgs.mkShell {
inputsFrom = [ piratsApp ];
packages = with pkgs; [
python.pkgs.pytest
];
};
}
) // {
# NixOS Module to run the application as a service # NixOS Module to run the application as a service
nixosModules.default = { config, lib, pkgs, ... }: nixosModules.default = { config, lib, pkgs, ... }:
let let