Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix "nightly" build #5979

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/nix_continuous.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: nix_continuous

on:
schedule:
- cron: "10 3 * * *"
push:
branches:
- main
paths:
- '**/*.rs'
- '.github/workflows/nix.yml'
- 'nix/**'

jobs:
lints:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install nix
uses: DeterminateSystems/nix-installer-action@main
- name: Cache build artifacts
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check flake inputs
uses: DeterminateSystems/flake-checker-action@main
with:
flake-lock-path: ./nix/flake.lock
ignore-missing-flake-lock: false
- name: Setup Cachix
uses: cachix/cachix-action@v27
with:
name: wezterm
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build default package
run: |
nix build ./nix --json \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push wezterm
85 changes: 85 additions & 0 deletions docs/install/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,91 @@ hide:
$ brew rm wezterm
$ brew install --HEAD wezterm
```
=== "Nix/NixOS"

## Nix

WezTerm is available in nixpkgs as `wezterm`.

```nix
{
# configuration.nix

environment.systemPackages = [
pkgs.wezterm
]
}
```

### Flake

If you need a newer version use the flake. Use the cachix if you want to avoid building WezTerm from source.

The flake is in the `nix` directory, so the url will be something like `github:wez/wezterm?dir=nix`

Here's an example for NixOS configurations:

```nix
{
inputs.wezterm.url = "github:wez/wezterm?dir=nix";
# ...

outputs = inputs @ {nixpkgs, ...}:{
nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; # Make sure you pass inputs through to your nixosConfiguration like this
modules = [
# ...
];
};
};
}
```
And for home-manager you can do the following:

```nix
# flake.nix

{
inputs.wezterm.url = "github:wez/wezterm?dir=nix";
# ...

outputs = inputs @ {nixpkgs, home-manager, ...}:{
homeConfigurations."user@HOSTNAME" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; }; # Pass inputs to homeManagerConfiguration
modules = [
./home.nix
];
};
};
}
```
```nix
# home.nix

{inputs, pkgs, ...}:{
programs.wezterm = {
enable = true;
package = inputs.wezterm.packages.${pkgs.system}.default;
};
}
```


### Cachix

Successful builds of the nightly nix action are pushed to this binary cache.

```nix
# nixosConfiguration module
{
nix.settings = {
substituters = ["https://wezterm.cachix.org"];
trusted-public-keys = ["wezterm.cachix.org-1:kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0="];
};
}
```


=== "Raw"
## Raw Linux Binary
Expand Down
Loading