peerix/flake.nix
2021-10-29 14:29:52 +02:00

48 lines
1.3 KiB
Nix

{
description = "Peer2Peer Nix-Binary-Cache";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
mach-nix.url = "github:DavHau/mach-nix";
};
outputs = { self, nixpkgs, flake-utils, mach-nix, ... }: {
nixosModules.peerix = import ./module.nix;
} // flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in {
packages.peerix = mach-nix.lib.${system}.buildPythonApplication {
name = "peerix";
python = "python39";
src = ./.;
version = builtins.readFile ./VERSION;
requirements = builtins.readFile ./requirements.txt;
propagatedBuildInputs = with pkgs; [
nix
nix-serve
];
};
defaultPackage = self.packages.${system}.peerix;
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nix-serve
niv
(mach-nix.lib.${system}.mkPython {
python = "python39";
requirements = ''
${builtins.readFile ./requirements.txt}
ipython
'';
})
];
};
defaultApp = { type = "app"; program = "${self.packages.${system}.peerix}/bin/peerix"; };
});
}