peerix/flake.nix
Daniel Phan db651641fa
fix: use pname for mach-nix
suppress `trace: automatically detected pname: 'peerix'`
2021-11-01 08:32:18 +07:00

49 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;
overlay = import ./overlay.nix { inherit self; };
} // flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in {
packages.peerix = mach-nix.lib.${system}.buildPythonApplication {
pname = "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"; };
});
}