Skip to content

Commit

Permalink
Install the scripts as apps
Browse files Browse the repository at this point in the history
  • Loading branch information
groves committed May 4, 2024
1 parent 3fc9902 commit 06ca854
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,30 @@
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
in
{
packages.default = mkPoetryApplication { projectDir = self; };

devShells.default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.default ];
packages = with pkgs; [poetry python39 cargo];
};
outputs = {
self,
nixpkgs,
flake-utils,
poetry2nix,
}:
flake-utils.lib.eachDefaultSystem (system: let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication;
hyperer = mkPoetryApplication {projectDir = self;};
in {
packages = {
inherit hyperer;
default = self.packages.${system}.hyperer;
};
apps = pkgs.lib.genAttrs ["hyperer-cargo" "hyperer-rg" "hyperer-ruff"] (name: {
type = "app";
program = "${hyperer}/bin/${name}";
});

devShells.default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.hyperer];
packages = with pkgs; [poetry python39 cargo];
};
});
}

0 comments on commit 06ca854

Please sign in to comment.