feat: adjust overlays

This commit is contained in:
ryan4yin
2023-05-21 11:44:45 +08:00
parent a2daad2719
commit 58d4005e4f
24 changed files with 64 additions and 77 deletions

View File

@@ -3,6 +3,7 @@
{
imports = [
./fcitx5
./hyprland
# ./i3
./programs

15
home/fcitx5/default.nix Normal file
View File

@@ -0,0 +1,15 @@
{pkgs, config, ... }: {
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
# for flypy chinese input method
fcitx5-rime
# needed enable rime using configtool after installed
fcitx5-configtool
fcitx5-chinese-addons
# fcitx5-mozc # japanese input method
fcitx5-gtk # gtk im module
];
};
}

View File

@@ -6,35 +6,26 @@
{ config, pkgs, home-manager, nur, ... } @ args:
{
imports =
[
({pkgs, config, ... }: {
config = {
# use it as an overlay
nixpkgs.overlays = [
args.nixpkgs-wayland.overlay
];
};
})
imports = [
# This adds a nur configuration option.
# Use `config.nur.repos.<user>.<package-name>` in NixOS Module for packages from the NUR.
nur.nixosModules.nur
# This adds a nur configuration option.
# Use `config.nur.repos.<user>.<package-name>` in NixOS Module for packages from the NUR.
nur.nixosModules.nur
./cifs-mount.nix
# Include the results of the hardware scan.
./hardware-configuration.nix
./cifs-mount.nix
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/fhs-fonts.nix
../../modules/hyprland.nix
#../../modules/i3.nix
../../modules/nur-packages.nix
../../modules/system.nix
../../modules/user_group.nix
../../modules/fcitx5
../../modules/fhs-fonts.nix
../../modules/hyprland.nix
#../../modules/i3.nix
../../modules/nur-packages.nix
../../modules/system.nix
../../modules/user_group.nix
../../secrets
];
../../secrets
];
nixpkgs.overlays = import ../../overlays args;
# Bootloader.
boot.loader = {

View File

@@ -5,34 +5,25 @@
{ config, pkgs, home-manager, nur, ... } @args:
{
imports =
[
({pkgs, config, ... }: {
config = {
# use it as an overlay
nixpkgs.overlays = [
args.nixpkgs-wayland.overlay
];
};
})
imports = [
# This adds a nur configuration option.
# Use `config.nur.repos.<user>.<package-name>` in NixOS Module for packages from the NUR.
nur.nixosModules.nur
# This adds a nur configuration option.
# Use `config.nur.repos.<user>.<package-name>` in NixOS Module for packages from the NUR.
nur.nixosModules.nur
# Include the results of the hardware scan.
./hardware-configuration.nix
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/fhs-fonts.nix
../../modules/hyprland.nix
#../../modules/i3.nix
../../modules/nur-packages.nix
../../modules/system.nix
../../modules/user_group.nix
../../modules/fcitx5
../../modules/fhs-fonts.nix
../../modules/hyprland.nix
#../../modules/i3.nix
../../modules/nur-packages.nix
../../modules/system.nix
../../modules/user_group.nix
../../secrets
];
../../secrets
];
nixpkgs.overlays = import ../../overlays args;
# Bootloader.
boot.loader = {

View File

@@ -1,28 +0,0 @@
{ config, pkgs, ... }:
# related issues: https://github.com/hyprwm/Hyprland/discussions/421
{
# 为了不使用默认的 rime-data改用我自定义的小鹤音形数据这里需要 override
# 参考 https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
nixpkgs.overlays = [
(self: super: {
# 小鹤音形配置,配置来自 flypy.com 官方网盘的鼠须管配置压缩包「小鹤音形“鼠须管”for macOS.zip」
# 我仅修改了 default.yaml 文件,将其中的半角括号改为了直角括号「 与 」。
rime-data = ./rime-data-flypy;
fcitx5-rime = super.fcitx5-rime.override { rimeDataPkgs = [ ./rime-data-flypy ]; };
})
];
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
# for flypy chinese input method
fcitx5-rime
# needed enable rime using configtool after installed
fcitx5-configtool
fcitx5-chinese-addons
# fcitx5-mozc # japanese input method
fcitx5-gtk # gtk im module
];
};
}

7
overlays/default.nix Normal file
View File

@@ -0,0 +1,7 @@
args:
# execute and import all overlay files in the current directory with the given args
builtins.map
(f: (import (./. + "/${f}") args)) # execute and import the overlay file
(builtins.filter # find all overlay files in the current directory
(f: f != "default.nix")
(builtins.attrNames (builtins.readDir ./.)))

View File

@@ -0,0 +1,10 @@
# 为了不使用默认的 rime-data改用我自定义的小鹤音形数据这里需要 override
# 参考 https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
{...}:
(self: super: {
# 小鹤音形配置,配置来自 flypy.com 官方网盘的鼠须管配置压缩包「小鹤音形“鼠须管”for macOS.zip」
# 我仅修改了 default.yaml 文件,将其中的半角括号改为了直角括号「 与 」。
rime-data = ./rime-data-flypy;
fcitx5-rime = super.fcitx5-rime.override { rimeDataPkgs = [ ./rime-data-flypy ]; };
})