File tree Expand file tree Collapse file tree 4 files changed +40
-29
lines changed
Expand file tree Collapse file tree 4 files changed +40
-29
lines changed Original file line number Diff line number Diff line change @@ -95,31 +95,34 @@ Code ví dụ ở `flake.nix`:
9595 inherit (self) outputs;
9696
9797 system = "x86_64-linux";
98-
99- pkgs = import nixpkgs {
100- inherit system;
101- config.allowUnfree = true;
102- };
10398 in
10499 {
105- overlays = import ./overlays { inherit inputs pkgs system; };
100+ nixosConfigurations = {
101+ nixos = nixpkgs.lib.nixosSystem {
102+ specialArgs = { inherit inputs outputs system; };
106103
107- # Some nixos config
104+ # Some nixos config
105+ };
106+ };
108107 }
109108}
110109```
111110
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.
111+ Tiếp theo bạn hãy tạo biến và thêm nó vào ` ibus.engines `
113112
114- Code ví dụ ở ` overlays/default .nix` :
113+ Code ví dụ ở ` input-method .nix` :
115114``` nix
116115{ inputs, system, ... }:
117116
117+ let
118+ bamboo = inputs.ibus-bamboo.packages."${system}".default;
119+ in
118120{
119- custom-packages = final: prev: {
120- ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
121-
122- # Some overlays package code
121+ i18n.inputMethod = {
122+ enabled = "ibus";
123+ ibus.engines = [
124+ bamboo
125+ ];
123126 };
124127}
125128```
Original file line number Diff line number Diff line change @@ -98,31 +98,35 @@ Example code at `flake.nix`
9898 inherit (self) outputs;
9999
100100 system = "x86_64-linux";
101-
102- pkgs = import nixpkgs {
103- inherit system;
104- config.allowUnfree = true;
105- };
106101 in
107102 {
108- overlays = import ./overlays { inherit inputs pkgs system; };
103+ nixosConfigurations = {
104+ nixos = nixpkgs.lib.nixosSystem {
105+ specialArgs = { inherit inputs outputs system; };
109106
110- # Some nixos config
107+ # Some nixos config
108+ };
109+ };
111110 }
112111}
112+ }
113113```
114114
115- Next, you need to override value of ibus-bamboo package in Nixpkgs package to ibus-bamboo flake package with overlays.
115+ Next, you need to declare a variable and add it to ` ibus.engines `
116116
117- Example code at ` overlays/default .nix`
117+ Example code at ` input-method .nix`
118118``` nix
119119{ inputs, system, ... }:
120120
121+ let
122+ bamboo = inputs.ibus-bamboo.packages."${system}".default;
123+ in
121124{
122- custom-packages = final: prev: {
123- ibus-bamboo = inputs.ibus-bamboo.packages."${system}".default;
124-
125- # Some overlays package code
125+ i18n.inputMethod = {
126+ enabled = "ibus";
127+ ibus.engines = [
128+ bamboo
129+ ];
126130 };
127131}
128132```
Original file line number Diff line number Diff line change 4545 makeFlags = [
4646 "PREFIX=${ placeholder "out" } "
4747 ] ;
48+
49+ meta = {
50+ isIbusEngine = true ;
51+ } ;
4852 } ;
4953 }
5054 ) ;
You can’t perform that action at this time.
0 commit comments