Skip to content

Commit

Permalink
Merge pull request #553 from goatastronaut0212/master
Browse files Browse the repository at this point in the history
Update README and nix flake to use as ibus engine
  • Loading branch information
goatastronaut0212 authored Jan 14, 2025
2 parents d11cc41 + da802a3 commit f82e9c4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 29 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,34 @@ Code ví dụ ở `flake.nix`:
inherit (self) outputs;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
overlays = import ./overlays { inherit inputs pkgs system; };
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs system; };
# Some nixos config
# 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.
Tiếp theo bạn hãy tạo biến và thêm nó vào `ibus.engines`

Code ví dụ ở `overlays/default.nix`:
Code ví dụ ở `input-method.nix`:
```nix
{ inputs, system, ... }:
let
bamboo = inputs.ibus-bamboo.packages."${system}".default;
in
{
custom-packages = final: prev: {
ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
# Some overlays package code
i18n.inputMethod = {
enabled = "ibus";
ibus.engines = [
bamboo
];
};
}
```
Expand Down
30 changes: 17 additions & 13 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,35 @@ Example code at `flake.nix`
inherit (self) outputs;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
overlays = import ./overlays { inherit inputs pkgs system; };
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs system; };
# Some nixos config
# Some nixos config
};
};
}
}
}
```

Next, you need to override value of ibus-bamboo package in Nixpkgs package to ibus-bamboo flake package with overlays.
Next, you need to declare a variable and add it to `ibus.engines`

Example code at `overlays/default.nix`
Example code at `input-method.nix`
```nix
{ inputs, system, ... }:
let
bamboo = inputs.ibus-bamboo.packages."${system}".default;
in
{
custom-packages = final: prev: {
ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
# Some overlays package code
i18n.inputMethod = {
enabled = "ibus";
ibus.engines = [
bamboo
];
};
}
```
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
makeFlags = [
"PREFIX=${placeholder "out"}"
];

meta = {
isIbusEngine = true;
};
};
}
);
Expand Down

0 comments on commit f82e9c4

Please sign in to comment.