Skip to content

Commit

Permalink
Add using ibus-bamboo flake section to README
Browse files Browse the repository at this point in the history
  • Loading branch information
goatastronaut0212 committed Jan 9, 2025
1 parent 349ae61 commit 004153f
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 1 deletion.
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['Bamb
`ibus-bamboo` hiện đã có mặt trên [AUR](https://aur.archlinux.org/packages/ibus-bamboo). Đừng quên để lại 1 vote cho các maintainer để 1 ngày không xa nó được vào kho repo chính thức của Arch nhé!

### NixOS
`ibus-bamboo` đã có mặt trên repo chính của Nixpkgs. Để cài đặt hãy chắc chắn rằng code sau đã có trong file cấu hình NixOS của bạn.

#### Nixpkgs

`ibus-bamboo` đã có mặt trên repo chính của Nixpkgs. Để cài đặt hãy chắc chắn rằng code sau đã có trong file cấu hình NixOS của bạn.

```nix
{
Expand All @@ -64,6 +67,65 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['Bamb
}
```

#### Ibus-bamboo flake

Nếu bạn không thích sử dụng package từ Nixpkgs, bạn có thể sử dụng bản mới nhất flake từ repo ibus-bamboo. Lưu ý rằng phương pháp này chỉ hoạt động với flake.

Đầu tiên hãy chắc chắn rằng bạn đã thêm repo path vào trong nixos flake của bạn.

Code ví dụ ở `flake.nix`:
```nix
{
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-24.05";
};
ibus-bamboo = {
url = "github:BambooEngine/ibus-bamboo";
};
};
outputs = {
self,
nixpkgs,
ibus-bamboo,
}@inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
overlays = import ./overlays { inherit inputs pkgs system; };
# Some nixos config
}
}
```

Tiếp bạn hãy ghi đè giá trị package ibus-bamboo của Nixpkgs thành package default trong ibus-bamboo repo flake với overlays.

Code ví dụ ở `overlays/default.nix`:
```nix
{ inputs, system, ... }:
{
custom-packages = final: prev: {
ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
# Some overlays package code
};
}
```

Bước cuối cùng là cập nhập lại flake và chuyển đổi hệ thống sang cấu hình mới là xong.

### Void Linux
`ibus-bamboo` đã có mặt trên repo chính của Void Linux. Các bạn có thể cài đặt trực tiếp.

Expand Down
62 changes: 62 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['xkb:
`ibus-bamboo` is now available on the [AUR](https://aur.archlinux.org/packages/ibus-bamboo). Don't forget to leave a vote for the maintainers so that one day it can be included in the official Arch repository!

### NixOS

#### Nixpkgs

`ibus-bamboo` is available on the main Nixpkgs repo. Make sure your NixOS configuration must contain this code to install it.

```nix
Expand All @@ -67,6 +70,65 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['xkb:
}
```

#### Ibus-bamboo flake

If you don't like to use package from Nixpkgs, you can use latest version flake package from Ibus-bamboo repo. Note that this approach only work for flake.

First, make sure you have added repo path in your nixos flake config.

Example code at `flake.nix`
```nix
{
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-24.05";
};
ibus-bamboo = {
url = "github:BambooEngine/ibus-bamboo";
};
};
outputs = {
self,
nixpkgs,
ibus-bamboo,
}@inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
overlays = import ./overlays { inherit inputs pkgs system; };
# Some nixos config
}
}
```

Next, you need to override value of ibus-bamboo package in Nixpkgs package to ibus-bamboo flake package with overlays.

Example code at `overlays/default.nix`
```nix
{ inputs, system, ... }:
{
custom-packages = final: prev: {
ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
# Some overlays package code
};
}
```

Final step is update flake and switch your system to new config.

### Void Linux
`ibus-bamboo` is available on the main Void Linux repo. You can install it directly.

Expand Down

0 comments on commit 004153f

Please sign in to comment.