Skip to content

Commit b58684f

Browse files
Add using ibus-bamboo flake section to README
1 parent 349ae61 commit b58684f

File tree

2 files changed

+125
-1
lines changed

2 files changed

+125
-1
lines changed

README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['Bamb
5151
`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é!
5252

5353
### NixOS
54-
`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.
54+
55+
#### Nixpkgs
56+
57+
`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.
5558

5659
```nix
5760
{
@@ -64,6 +67,65 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['Bamb
6467
}
6568
```
6669

70+
#### Ibus-bamboo flake
71+
72+
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.
73+
74+
Đầ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.
75+
76+
Code ví dụ ở `flake.nix`:
77+
```nix
78+
{
79+
inputs = {
80+
nixpkgs = {
81+
url = "github:nixos/nixpkgs/nixos-24.05";
82+
};
83+
84+
ibus-bamboo = {
85+
url = "github:BambooEngine/ibus-bamboo";
86+
};
87+
};
88+
89+
outputs = {
90+
self,
91+
nixpkgs,
92+
ibus-bamboo,
93+
}@inputs:
94+
let
95+
inherit (self) outputs;
96+
97+
system = "x86_64-linux";
98+
99+
pkgs = import nixpkgs {
100+
inherit system;
101+
config.allowUnfree = true;
102+
};
103+
in
104+
{
105+
overlays = import ./overlays { inherit inputs pkgs system; };
106+
107+
// Some nixos config
108+
}
109+
}
110+
```
111+
112+
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.
113+
114+
Code ví dụ ở `overlays/default.nix`:
115+
```nix
116+
{ inputs, system, ... }:
117+
118+
{
119+
custom-packages = final: prev: {
120+
ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
121+
122+
// Some overlays package code
123+
};
124+
}
125+
```
126+
127+
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.
128+
67129
### Void Linux
68130
`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.
69131

README_EN.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['xkb:
5454
`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!
5555

5656
### NixOS
57+
58+
#### Nixpkgs
59+
5760
`ibus-bamboo` is available on the main Nixpkgs repo. Make sure your NixOS configuration must contain this code to install it.
5861

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

73+
#### Ibus-bamboo flake
74+
75+
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.
76+
77+
First, make sure you have added repo path in your nixos flake config.
78+
79+
Example code at `flake.nix`
80+
```nix
81+
{
82+
inputs = {
83+
nixpkgs = {
84+
url = "github:nixos/nixpkgs/nixos-24.05";
85+
};
86+
87+
ibus-bamboo = {
88+
url = "github:BambooEngine/ibus-bamboo";
89+
};
90+
};
91+
92+
outputs = {
93+
self,
94+
nixpkgs,
95+
ibus-bamboo,
96+
}@inputs:
97+
let
98+
inherit (self) outputs;
99+
100+
system = "x86_64-linux";
101+
102+
pkgs = import nixpkgs {
103+
inherit system;
104+
config.allowUnfree = true;
105+
};
106+
in
107+
{
108+
overlays = import ./overlays { inherit inputs pkgs system; };
109+
110+
// Some nixos config
111+
}
112+
}
113+
```
114+
115+
Next, you need to override value of ibus-bamboo package in Nixpkgs package to ibus-bamboo flake package with overlays.
116+
117+
Example code at `overlays/default.nix`
118+
```nix
119+
{ inputs, system, ... }:
120+
121+
{
122+
custom-packages = final: prev: {
123+
ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
124+
125+
// Some overlays package code
126+
};
127+
}
128+
```
129+
130+
Final step is update flake and switch your system to new config.
131+
70132
### Void Linux
71133
`ibus-bamboo` is available on the main Void Linux repo. You can install it directly.
72134

0 commit comments

Comments
 (0)