From c9261e3483a5c317c46c4b8c52c9c92b8fed2034 Mon Sep 17 00:00:00 2001 From: Thomas Croft Date: Fri, 16 Aug 2024 13:24:31 -0600 Subject: [PATCH 1/3] Added: nix nightly build to cachix --- .github/workflows/nix_continuous.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/nix_continuous.yml diff --git a/.github/workflows/nix_continuous.yml b/.github/workflows/nix_continuous.yml new file mode 100644 index 00000000000..eb495af380e --- /dev/null +++ b/.github/workflows/nix_continuous.yml @@ -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 From f790d3a0ac74faf8ac5f6ced23a4aeb1f4e82928 Mon Sep 17 00:00:00 2001 From: Thomas Croft Date: Fri, 16 Aug 2024 13:28:56 -0600 Subject: [PATCH 2/3] Added: nix install docs --- docs/install/linux.md | 85 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/docs/install/linux.md b/docs/install/linux.md index d19b691713d..71d2748020a 100644 --- a/docs/install/linux.md +++ b/docs/install/linux.md @@ -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-"]; + }; + } + ``` + === "Raw" ## Raw Linux Binary From 55299b5332969d0030b1c62cac38c8eb9e8c7db3 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 14 Sep 2024 08:57:08 -0700 Subject: [PATCH 3/3] update cachix public key --- docs/install/linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/linux.md b/docs/install/linux.md index 71d2748020a..a7109f6065d 100644 --- a/docs/install/linux.md +++ b/docs/install/linux.md @@ -366,7 +366,7 @@ hide: { nix.settings = { substituters = ["https://wezterm.cachix.org"]; - trusted-public-keys = ["wezterm.cachix.org-"]; + trusted-public-keys = ["wezterm.cachix.org-1:kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0="]; }; } ```