chore(repo): remove nix support (#2038)

This commit is contained in:
Aram Drevekenin 2022-12-20 12:24:19 +01:00 committed by GitHub
parent 6a5e15edf3
commit d1cacc3fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 0 additions and 672 deletions

1
.envrc
View File

@ -1 +0,0 @@
use flake

View File

@ -1,17 +0,0 @@
# This file contains a list of commits that are not likely what you
# are looking for in a blame, such as mass reformatting or renaming.
# You can set this file as a default ignore file for blame by running
# the following command.
#
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# fix: small lints - https://github.com/zellij-org/zellij/commit/9544a09786ef39ed741db166c5052cade45fde91
9544a09786ef39ed741db166c5052cade45fde91
# fix: typos - https://github.com/zellij-org/zellij/commit/16b53aa52f73e5ee7383889dc7a422d27be22ef0
16b53aa52f73e5ee7383889dc7a422d27be22ef0
# add(style): add trailing commas in match blocks - https://github.com/zellij-org/zellij/commit/67d2673cae60954e8287c2a1f58a21a56e066afb
67d2673cae60954e8287c2a1f58a21a56e066afb
# clippy fixes
3de59dac42c05de43beba2f7d09b07111c711394
# chore: move `nix` directory
47540d7cabae144f032c0fc4972e7c9af5ab5e8d

View File

@ -30,11 +30,6 @@ jobs:
options: -v ${{ github.workspace }}/target:/usr/src/zellij --name ssh
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: zellij
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Add WASM target
run: rustup target add wasm32-wasi
- name: Install musl-tools

View File

@ -1,72 +0,0 @@
# This is a workflow, consisting of jobs that only need to be run,
# once `*nix`, or `flake.lock` files change
name: nix-develop
on:
push:
branches:
- main
paths:
- '**.nix'
- 'flake.lock'
- 'rust-toolchain'
pull_request:
branches:
- main
paths:
- '**.nix'
- 'flake.lock'
- 'rust-toolchain'
jobs:
check:
runs-on: ubuntu-latest
name: "nix check"
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: zellij
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix develop .#fmtShell --command treefmt --fail-on-change
## nix flake check still fails on IFD
#- run: nix flake check --print-build-logs --show-trace
develop:
runs-on: ubuntu-latest
name: "nix develop"
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: zellij
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix develop --profile devShell
build:
runs-on: ubuntu-latest
name: "nix build"
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: zellij
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix build || nix build --substituters 'https://cache.nixos.org' --extra-substituters ''

View File

@ -1,24 +0,0 @@
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 1 * *' # runs on the first of every month at 00:00
jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v15
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
pr-labels: |
dependencies
nix

5
.gitignore vendored
View File

@ -4,8 +4,3 @@ target/
.vim
.DS_Store
/assets/man/zellij.1
# nix
.direnv/
result
result-*

View File

@ -1,45 +0,0 @@
{
pkgs,
crate2nix,
name,
src,
patchPhase,
postInstall,
nativeBuildInputs,
desktopItems,
meta,
}: let
inherit
(import "${crate2nix}/tools.nix" {inherit pkgs;})
generatedCargoNix
;
darwinBuildInputs = pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.DiskArbitration
pkgs.darwin.apple_sdk.frameworks.Foundation
];
project =
import
(generatedCargoNix {
inherit name src;
})
{
inherit pkgs;
buildRustCrateForPkgs = pkgs:
pkgs.buildRustCrate.override {
defaultCrateOverrides =
pkgs.defaultCrateOverrides
// {
# Crate dependency overrides go here
zellij = attrs: {
inherit postInstall desktopItems meta name nativeBuildInputs patchPhase;
buildInputs = darwinBuildInputs;
};
sysinfo = attrs: {
buildInputs = darwinBuildInputs;
};
};
};
};
in
project.workspaceMembers.zellij.build

View File

@ -1,14 +0,0 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ../.;
})
.defaultNix

View File

@ -1,11 +0,0 @@
{
mkShell,
buildInputs,
nativeBuildInputs,
}:
mkShell {
name = "zj-dev-env";
inherit buildInputs nativeBuildInputs;
### Environment Variables
RUST_BACKTRACE = 1;
}

View File

@ -1,53 +0,0 @@
{
pkgs,
root,
cargo,
rustc,
cargoLock,
nativeBuildInputs,
buildInputs,
}: let
ignoreSource = [
".git"
".github"
"docs"
"example"
"target"
".editorconfig"
".envrc"
".git-blame-ignore-revs"
"CHANGELOG.md"
"CODE_OF_CONDUCT.md"
"CONTRIBUTING.md"
"GOVERNANCE.md"
"LICENSE.md"
"docker-compose.yml"
];
src = pkgs.nix-gitignore.gitignoreSource ignoreSource root;
makeDefaultPlugin = name:
(pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage {
inherit
src
name
cargoLock
buildInputs
nativeBuildInputs
;
buildPhase = ''
cargo build --package ${name} --release --target=wasm32-wasi
mkdir -p $out/bin;
#cp target/wasm32-wasi/release/${name}.wasm $out/bin/${name}.wasm
wasm-opt \
-O target/wasm32-wasi/release/${name}.wasm \
-o $out/bin/${name}.wasm
'';
installPhase = ":";
checkPhase = ":";
};
in {
status-bar = makeDefaultPlugin "status-bar";
tab-bar = makeDefaultPlugin "tab-bar";
strider = makeDefaultPlugin "strider";
compact-bar = makeDefaultPlugin "compact-bar";
}

View File

@ -1,14 +0,0 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ../.;
})
.shellNix

View File

@ -1,275 +0,0 @@
{
self,
nixpkgs,
rust-overlay,
flake-utils,
flake-compat,
crate2nix,
}:
flake-utils.lib.eachSystem [
"aarch64-linux"
"aarch64-darwin"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
]
(system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;};
pkgsMusl = import nixpkgs {
inherit system overlays;
crossSystem = {config = "x86_64-unknown-linux-musl";};
};
crate2nixPkgs = import nixpkgs {
inherit system;
overlays = [
(self: _: {
rustc = rustToolchainToml;
cargo = rustToolchainToml;
})
];
};
crate2nixMsrvPkgs = import nixpkgs {
inherit system;
overlays = [
(self: _: {
rustc = msrvToolchain;
cargo = msrvToolchain;
})
];
};
name = "zellij";
pname = name;
root = self;
ignoreSource = [".git" "target" "example"];
src = pkgs.nix-gitignore.gitignoreSource ignoreSource root;
cargoToml = builtins.fromTOML (builtins.readFile (src + "/Cargo.toml"));
toolchainToml = builtins.fromTOML (builtins.readFile (src + "/rust-toolchain.toml"));
rustToolchainToml = pkgs.rust-bin.fromRustupToolchainFile (src + "/rust-toolchain.toml");
msrvToolchain = pkgs.rust-bin.fromRustupToolchain {
channel = cargoToml.package.rust-version;
components = toolchainToml.toolchain.components;
targets = toolchainToml.toolchain.targets;
};
cargoLock = {
lockFile = builtins.path {
path = src + "/Cargo.lock";
name = "Cargo.lock";
};
};
cargo = rustToolchainToml;
rustc = rustToolchainToml;
cargoMSRV = msrvToolchain;
rustcMSRV = msrvToolchain;
buildInputs = [
# in order to run tests
pkgs.openssl
] ++ (
pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.DiskArbitration
pkgs.darwin.apple_sdk.frameworks.Foundation
]
);
nativeBuildInputs = [
# for openssl/openssl-sys
pkgs.pkg-config
# generates manpages
pkgs.mandown
pkgs.installShellFiles
pkgs.copyDesktopItems
];
defaultPlugins = [
plugins.compact-bar
plugins.status-bar
plugins.tab-bar
plugins.strider
];
pluginNativeBuildInputs = [
pkgs.pkg-config
# optimizes wasm binaries
pkgs.binaryen
];
devInputs = [
rustToolchainToml
pkgs.cargo-make
pkgs.rust-analyzer
# optimizes wasm binaries
pkgs.binaryen
# used for snapshotting the e2e tests
pkgs.cargo-insta
];
fmtInputs = [
pkgs.alejandra
pkgs.treefmt
];
plugins = import ./plugins.nix {
inherit root pkgs cargo rustc cargoLock buildInputs;
nativeBuildInputs = pluginNativeBuildInputs;
};
postInstall = ''
mandown ./docs/MANPAGE.md > ./zellij.1
installManPage ./zellij.1
# explicit behavior
$out/bin/zellij setup --generate-completion bash > ./completions.bash
installShellCompletion --bash --name ${pname}.bash ./completions.bash
$out/bin/zellij setup --generate-completion fish > ./completions.fish
installShellCompletion --fish --name ${pname}.fish ./completions.fish
$out/bin/zellij setup --generate-completion zsh > ./completions.zsh
installShellCompletion --zsh --name _${pname} ./completions.zsh
install -Dm644 ./assets/logo.png $out/share/icons/hicolor/scalable/apps/zellij.png
copyDesktopItems
'';
patchPhase = ''
cp ${plugins.tab-bar}/bin/tab-bar.wasm assets/plugins/tab-bar.wasm
cp ${plugins.status-bar}/bin/status-bar.wasm assets/plugins/status-bar.wasm
cp ${plugins.strider}/bin/strider.wasm assets/plugins/strider.wasm
cp ${plugins.compact-bar}/bin/compact-bar.wasm assets/plugins/compact-bar.wasm
'';
desktopItems = [
(pkgs.makeDesktopItem {
type = "Application";
inherit name;
desktopName = "zellij";
terminal = true;
genericName = "Terminal multiplexer";
comment = "Manage your terminal applications";
exec = "zellij";
icon = "zellij";
categories = ["ConsoleOnly"];
})
];
meta = with pkgs.lib; {
homepage = "https://github.com/zellij-org/zellij/";
description = "A terminal workspace with batteries included";
license = [licenses.mit];
};
in rec {
packages.default = packages.zellij-native;
# crate2nix - better incremental builds, but uses ifd
packages.zellij = crate2nixPkgs.callPackage ./crate2nix.nix {
inherit
name
src
crate2nix
desktopItems
postInstall
patchPhase
meta
;
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};
packages.zellij-crate-msrv = crate2nixMsrvPkgs.callPackage ./crate2nix.nix {
inherit
name
src
crate2nix
desktopItems
postInstall
patchPhase
meta
;
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};
# native nixpkgs support - keep supported
packages.zellij-native = (pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage {
inherit
src
name
cargoLock
buildInputs
postInstall
patchPhase
desktopItems
meta
;
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};
# native nixpkgs support - msrv
packages.zellij-msrv =
(pkgs.makeRustPlatform {
cargo = cargoMSRV;
rustc = rustcMSRV;
})
.buildRustPackage {
inherit
src
name
cargoLock
buildInputs
postInstall
patchPhase
desktopItems
meta
;
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
};
packages.plugins-compact = plugins.compact-bar;
packages.plugins-status-bar = plugins.status-bar;
packages.plugins-tab-bar = plugins.tab-bar;
packages.plugins-strider = plugins.strider;
defaultPackage = packages.zellij;
# nix run
apps.zellij = flake-utils.lib.mkApp {drv = packages.zellij;};
defaultApp = apps.zellij;
devShells = {
zellij = pkgs.callPackage ./devShell.nix {
inherit buildInputs;
nativeBuildInputs = nativeBuildInputs ++ devInputs ++ fmtInputs;
};
fmtShell = pkgs.mkShell {
name = "fmt-shell";
nativeBuildInputs = fmtInputs;
};
e2eShell = pkgs.pkgsMusl.mkShell {
name = "e2e-shell";
nativeBuildInputs = [
pkgs.cargo-make
pkgs.pkgsMusl.cargo
];
};
};
devShell = devShells.zellij;
})
// rec {
overlays = {
default = final: prev: rec {
zellij = self.packages.${prev.system}.zellij;
};
nightly = final: prev: rec {
zellij-nightly = self.packages.${prev.system}.zellij;
};
};
}

View File

@ -48,20 +48,6 @@ version `wasm-opt --version` > 97, for it's command `wasm-opt`.
To run `test`, you will need the package `pkg-config` and a version of `openssl`.
<details>
<summary>Should you be a `nix` (linux/macOs) user, you can use the following
commands in order to get set up: (expand)</summary>
- `nix develop`
Download and set up dependencies.
- `nix build`
Build the binary in the `result` directory. (--release)
- `nix run`
Run the binary.
- `cachix use zellij`
Will use our binary cache as a substituter.
</details>
## Running the end-to-end tests
Zellij includes some end-to-end tests which test the whole application as a black-box from the outside.
These tests work by running a docker container which contains the Zellij binary, connecting to it via ssh, sending some commands and comparing the output received against predefined snapshots.

View File

@ -11,7 +11,6 @@
<a href="https://discord.gg/CrUAFH3"><img alt="Discord Chat" src="https://img.shields.io/discord/771367133715628073?color=5865F2&label=discord&style=flat-square"></a>
<a href="https://matrix.to/#/#zellij_general:matrix.org"><img alt="Matrix Chat" src="https://img.shields.io/matrix/zellij_general:matrix.org?color=1d7e64&label=matrix%20chat&style=flat-square&logo=matrix"></a>
<a href="https://zellij.dev/documentation/"><img alt="Zellij documentation" src="https://img.shields.io/badge/zellij-documentation-fc0060?style=flat-square"></a>
<a href="https://builtwithnix.org"><img alt="Built with nix" src="https://img.shields.io/static/v1?label=built%20with&message=nix&color=5277C3&logo=nixos&style=flat-square&logoColor=ffffff"></a>
</p>
<p align="center">

View File

@ -1,101 +0,0 @@
{
"nodes": {
"crate2nix": {
"flake": false,
"locked": {
"lastModified": 1668990393,
"narHash": "sha256-6E+heekdZ1UfCseEQiCafnkRky80BaB6m0+bwIOx2ws=",
"owner": "kolloch",
"repo": "crate2nix",
"rev": "e4414cc2579d6ab11e9542f49eeb302b451bf0e2",
"type": "github"
},
"original": {
"owner": "kolloch",
"repo": "crate2nix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1669542132,
"narHash": "sha256-DRlg++NJAwPh8io3ExBJdNW7Djs3plVI5jgYQ+iXAZQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a115bb9bd56831941be3776c8a94005867f316a7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"crate2nix": "crate2nix",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1669775522,
"narHash": "sha256-6xxGArBqssX38DdHpDoPcPvB/e79uXyQBwpBcaO/BwY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "3158e47f6b85a288d12948aeb9a048e0ed4434d6",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -1,17 +0,0 @@
{
description = "Zellij, a terminal workspace with batteries included";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.inputs.flake-utils.follows = "flake-utils";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
crate2nix.url = "github:kolloch/crate2nix";
crate2nix.flake = false;
};
outputs = {...} @ args: import .nix/zellij.nix args;
}

View File

@ -1,3 +0,0 @@
[formatter.nix]
command = "alejandra"
includes = ["*.nix"]