readme: mention 'nix run'

This commit is contained in:
Sridhar Ratnakumar 2022-05-22 14:53:04 -04:00
parent 0866cd1c25
commit c082385a7f
2 changed files with 5 additions and 3 deletions

View file

@ -44,6 +44,7 @@ git add . && git commit -m rename
- Run `nix flake update` to update all flake inputs. - Run `nix flake update` to update all flake inputs.
- Run `treefmt` in nix shell to autoformat the project. This uses [treefmt](https://github.com/numtide/treefmt), which uses `./treefmt.toml` (where fourmolu and nixpkgs-fmt are specified). - Run `treefmt` in nix shell to autoformat the project. This uses [treefmt](https://github.com/numtide/treefmt), which uses `./treefmt.toml` (where fourmolu and nixpkgs-fmt are specified).
- Run `bin/hoogle` to start Hoogle with packages in your cabal file. - Run `bin/hoogle` to start Hoogle with packages in your cabal file.
- Run the application without installing: `nix run github:srid/haskell-template` (or `nix run .` from checkout)
## Alternatives ## Alternatives

View file

@ -21,6 +21,8 @@
inputs.flake-utils.lib.eachDefaultSystem inputs.flake-utils.lib.eachDefaultSystem
(system: (system:
let let
name = "haskell-template";
# Because: https://zimbatm.com/notes/1000-instances-of-nixpkgs # Because: https://zimbatm.com/notes/1000-instances-of-nixpkgs
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (pkgs.lib.lists) optionals; inherit (pkgs.lib.lists) optionals;
@ -46,8 +48,7 @@
, withHoogle ? false , withHoogle ? false
}: }:
hp.developPackage { hp.developPackage {
inherit returnShellEnv withHoogle; inherit returnShellEnv withHoogle name;
name = "haskell-template";
root = ./.; root = ./.;
overrides = self: super: with pkgs.haskell.lib; { overrides = self: super: with pkgs.haskell.lib; {
# Use callCabal2nix to override Haskell dependencies here # Use callCabal2nix to override Haskell dependencies here
@ -74,7 +75,7 @@
apps = { apps = {
default = { default = {
type = "app"; type = "app";
program = "${inputs.self.packages.${system}.default}/bin/haskell-template"; program = "${inputs.self.packages.${system}.default}/bin/${name}";
}; };
}; };
# Used by `nix develop ...` # Used by `nix develop ...`