https://github.com/encoredev/encore-flake
Nix flake for encores released binaries
https://github.com/encoredev/encore-flake
Last synced: about 1 month ago
JSON representation
Nix flake for encores released binaries
- Host: GitHub
- URL: https://github.com/encoredev/encore-flake
- Owner: encoredev
- Created: 2024-10-14T08:36:39.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-04-29T09:54:40.000Z (about 1 month ago)
- Last Synced: 2025-04-29T10:47:48.763Z (about 1 month ago)
- Language: Nix
- Size: 35.2 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :snowflake: encore-flake
A flake for simplifying installation of the released encore binaries on nix systems.
Try it out by simply running
```shell
$ nix run github:encoredev/encore-flake
```## Usage
Add as an input in your nix configuration flake
```nix
{
inputs = {
# other inputs...
encore = {
url = "github:encoredev/encore-flake";
# optional
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
```### Only the CLI
Import `encore.packages.default` into your nixos configuration
```nix
# Home manager
home.packages = [
inputs.encore.packages.${pkgs.system}.encore
];# NixOS configuration
environment.systemPackages = [
inputs.encore.packages.${pkgs.system}.encore
];
```### In a Development Shell
Add a `flake.nix` file in to your Encore project folder and include `encore` in the available command line tools for that project/folder using the `outputs` function.
```nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"
encore = {
url = "github:encoredev/encore-flake";
# optional
inputs.nixpkgs.follows = "nixpkgs";
};
# other inputs...
};outputs = { self, nixpkgs, flake-utils, encore, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
encorePkg = encore.packages.${system}.default;
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
encorePkg
git
go
# other outputs...
];
};
});
}
```then run `nix develop` from the project folder to enter the development shell for your project that will now include the `encore` CLI in the tool chain.
### With Home manager
Import `encore.homeModules.default` into your home manager config
```nix
imports = [
inputs.encore.homeModules.default
];
```and use the `programs.encore` options
```nix
{
programs.encore = {
enable = true;
settings = {
browser = "never";
};
};
}
```You can then keep it up to date by running
```shell
$ nix flake update encore
```