Merge master into staging-next

This commit is contained in:
github-actions[bot] 2023-03-25 06:05:24 +00:00 committed by GitHub
commit 6a3acb9982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 17120 additions and 957 deletions

View File

@ -12,7 +12,7 @@ jobs:
tf-providers:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR, for peter-evans/create-or-update-comment to create or update comment
pull-requests: write # for peter-evans/create-pull-request to create a PR
if: github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master
runs-on: ubuntu-latest
steps:
@ -36,6 +36,12 @@ jobs:
--argstr keep-going true \
--argstr max-workers 2 \
--argstr path terraform-providers
- name: get failed updates
run: |
echo 'FAILED<<EOF' >> $GITHUB_ENV
git ls-files --others >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# cleanup logs of failed updates so they aren't included in the PR
- name: clean repo
run: |
git clean -f
@ -47,10 +53,16 @@ jobs:
https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}
These providers failed to update:
```
${{ env.FAILED }}
```
Check that all providers build with:
```
@ofborg build terraform.full
```
If there is more than ten commits in the PR `ofborg` won't build it automatically and you will need to use the above command.
branch: terraform-providers-update
delete-branch: false
title: ${{ steps.setup.outputs.title }}

View File

@ -51,6 +51,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- [opensearch](https://opensearch.org), a search server alternative to Elasticsearch. Available as [services.opensearch](options.html#opt-services.opensearch.enable).
- [authelia](https://www.authelia.com/), is an open-source authentication and authorization server. Available under [services.authelia](options.html#opt-services.authelia.enable).
- [goeland](https://github.com/slurdge/goeland), an alternative to rss2email written in golang with many filters. Available as [services.goeland](#opt-services.goeland.enable).
- [alertmanager-irc-relay](https://github.com/google/alertmanager-irc-relay), a Prometheus Alertmanager IRC Relay. Available as [services.prometheus.alertmanagerIrcRelay](options.html#opt-services.prometheus.alertmanagerIrcRelay.enable).
@ -160,6 +162,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- Nebula now runs as a system user and group created for each nebula network, using the `CAP_NET_ADMIN` ambient capability on launch rather than starting as root. Ensure that any files each Nebula instance needs to access are owned by the correct user and group, by default `nebula-${networkName}`.
- The `i18n.inputMethod.fcitx` option has been replaced with `i18n.inputMethod.fcitx5` because fcitx 4 `pkgs.fcitx` has been removed.
- In `mastodon` it is now necessary to specify location of file with `PostgreSQL` database password. In `services.mastodon.database.passwordFile` parameter default value `/var/lib/mastodon/secrets/db-password` has been changed to `null`.
- The `--target-host` and `--build-host` options of `nixos-rebuild` no longer treat the `localhost` value specially to build on/deploy to local machine, omit the relevant flag.

View File

@ -9,7 +9,7 @@ than there are keys on the keyboard.
The following input methods are available in NixOS:
- IBus: The intelligent input bus.
- Fcitx: A customizable lightweight input method.
- Fcitx5: The next generation of fcitx, addons (including engines, dictionaries, skins) can be added using `i18n.inputMethod.fcitx5.addons`.
- Nabi: A Korean input method based on XIM.
- Uim: The universal input method, is a library with a XIM bridge.
- Hime: An extremely easy-to-use input method framework.
@ -67,38 +67,40 @@ application in the Nix store. The `glib` packages must
match exactly. If they do not, uninstalling and reinstalling the
application is a likely fix.
## Fcitx {#module-services-input-methods-fcitx}
## Fcitx5 {#module-services-input-methods-fcitx}
Fcitx is an input method framework with extension support. It has three
Fcitx5 is an input method framework with extension support. It has three
built-in Input Method Engine, Pinyin, QuWei and Table-based input methods.
The following snippet can be used to configure Fcitx:
```
i18n.inputMethod = {
enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [ mozc hangul m17n ];
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-hangul fcitx5-m17n ];
};
```
`i18n.inputMethod.fcitx.engines` is optional and can be
used to add extra Fcitx engines.
`i18n.inputMethod.fcitx5.addons` is optional and can be
used to add extra Fcitx5 addons.
Available extra Fcitx engines are:
Available extra Fcitx5 addons are:
- Anthy (`fcitx-engines.anthy`): Anthy is a system for
- Anthy (`fcitx5-anthy`): Anthy is a system for
Japanese input method. It converts Hiragana text to Kana Kanji mixed text.
- Chewing (`fcitx-engines.chewing`): Chewing is an
- Chewing (`fcitx5-chewing`): Chewing is an
intelligent Zhuyin input method. It is one of the most popular input
methods among Traditional Chinese Unix users.
- Hangul (`fcitx-engines.hangul`): Korean input method.
- Unikey (`fcitx-engines.unikey`): Vietnamese input method.
- m17n (`fcitx-engines.m17n`): m17n is an input method that
- Hangul (`fcitx5-hangul`): Korean input method.
- Unikey (`fcitx5-unikey`): Vietnamese input method.
- m17n (`fcitx5-m17n`): m17n is an input method that
uses input methods and corresponding icons in the m17n database.
- mozc (`fcitx-engines.mozc`): A Japanese input method from
- mozc (`fcitx5-mozc`): A Japanese input method from
Google.
- table-others (`fcitx-engines.table-others`): Various
- table-others (`fcitx5-table-other`): Various
table-based input methods.
- chinese-addons (`fcitx5-chinese-addons`): Various chinese input methods.
- rime (`fcitx5-rime`): RIME support for fcitx5.
## Nabi {#module-services-input-methods-nabi}

View File

@ -29,9 +29,9 @@ in
options.i18n = {
inputMethod = {
enabled = mkOption {
type = types.nullOr (types.enum [ "ibus" "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]);
type = types.nullOr (types.enum [ "ibus" "fcitx5" "nabi" "uim" "hime" "kime" ]);
default = null;
example = "fcitx";
example = "fcitx5";
description = lib.mdDoc ''
Select the enabled input method. Input methods is a software to input symbols that are not available on standard input devices.
@ -40,7 +40,6 @@ in
Currently the following input methods are available in NixOS:
- ibus: The intelligent input bus, extra input engines can be added using `i18n.inputMethod.ibus.engines`.
- fcitx: A customizable lightweight input method, extra input engines can be added using `i18n.inputMethod.fcitx.engines`.
- fcitx5: The next generation of fcitx, addons (including engines, dictionaries, skins) can be added using `i18n.inputMethod.fcitx5.addons`.
- nabi: A Korean input method based on XIM. Nabi doesn't support Qt 5.
- uim: The universal input method, is a library with a XIM bridge. uim mainly support Chinese, Japanese and Korean.

View File

@ -1,46 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.fcitx;
fcitxPackage = pkgs.fcitx.override { plugins = cfg.engines; };
fcitxEngine = types.package // {
name = "fcitx-engine";
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isFcitxEngine"] false x);
};
in
{
options = {
i18n.inputMethod.fcitx = {
engines = mkOption {
type = with types; listOf fcitxEngine;
default = [];
example = literalExpression "with pkgs.fcitx-engines; [ mozc hangul ]";
description =
let
enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;
engines = concatStringsSep ", "
(map (name: "`${name}`") (attrNames enginesDrv));
in
lib.mdDoc "Enabled Fcitx engines. Available engines are: ${engines}.";
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
i18n.inputMethod.package = fcitxPackage;
environment.variables = {
GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
};
services.xserver.displayManager.sessionCommands = "${fcitxPackage}/bin/fcitx";
};
# uses attributes of the linked package
meta.buildDocsInSandbox = false;
}

View File

@ -103,7 +103,6 @@
./hardware/xone.nix
./hardware/xpadneo.nix
./i18n/input-method/default.nix
./i18n/input-method/fcitx.nix
./i18n/input-method/fcitx5.nix
./i18n/input-method/hime.nix
./i18n/input-method/ibus.nix
@ -1211,6 +1210,7 @@
./services/web-apps/zabbix.nix
./services/web-servers/agate.nix
./services/web-servers/apache-httpd/default.nix
./services/web-servers/authelia.nix
./services/web-servers/caddy/default.nix
./services/web-servers/darkhttpd.nix
./services/web-servers/fcgiwrap.nix

View File

@ -107,6 +107,8 @@ with lib;
(mkRemovedOptionModule [ "services" "riak" ] "The corresponding package was removed from nixpkgs.")
(mkRemovedOptionModule [ "services" "cryptpad" ] "The corresponding package was removed from nixpkgs.")
(mkRemovedOptionModule [ "i18n" "inputMethod" "fcitx" ] "The fcitx module has been removed. Plesae use fcitx5 instead")
# Do NOT add any option renames here, see top of the file
];
}

View File

@ -0,0 +1,401 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.services.authelia;
format = pkgs.formats.yaml { };
configFile = format.generate "config.yml" cfg.settings;
autheliaOpts = with lib; { name, ... }: {
options = {
enable = mkEnableOption (mdDoc "Authelia instance");
name = mkOption {
type = types.str;
default = name;
description = mdDoc ''
Name is used as a suffix for the service name, user, and group.
By default it takes the value you use for `<instance>` in:
{option}`services.authelia.<instance>`
'';
};
package = mkOption {
default = pkgs.authelia;
type = types.package;
defaultText = literalExpression "pkgs.authelia";
description = mdDoc "Authelia derivation to use.";
};
user = mkOption {
default = "authelia-${name}";
type = types.str;
description = mdDoc "The name of the user for this authelia instance.";
};
group = mkOption {
default = "authelia-${name}";
type = types.str;
description = mdDoc "The name of the group for this authelia instance.";
};
secrets = mkOption {
description = mdDoc ''
It is recommended you keep your secrets separate from the configuration.
It's especially important to keep the raw secrets out of your nix configuration,
as the values will be preserved in your nix store.
This attribute allows you to configure the location of secret files to be loaded at runtime.
https://www.authelia.com/configuration/methods/secrets/
'';
default = { };
type = types.submodule {
options = {
manual = mkOption {
default = false;
example = true;
description = mdDoc ''
Configuring authelia's secret files via the secrets attribute set
is intended to be convenient and help catch cases where values are required
to run at all.
If a user wants to set these values themselves and bypass the validation they can set this value to true.
'';
type = types.bool;
};
# required
jwtSecretFile = mkOption {
type = types.nullOr types.path;
default = null;
description = mdDoc ''
Path to your JWT secret used during identity verificaiton.
'';
};
oidcIssuerPrivateKeyFile = mkOption {
type = types.nullOr types.path;
default = null;
description = mdDoc ''
Path to your private key file used to encrypt OIDC JWTs.
'';
};
oidcHmacSecretFile = mkOption {
type = types.nullOr types.path;
default = null;
description = mdDoc ''
Path to your HMAC secret used to sign OIDC JWTs.
'';
};
sessionSecretFile = mkOption {
type = types.nullOr types.path;
default = null;
description = mdDoc ''
Path to your session secret. Only used when redis is used as session storage.
'';
};
# required
storageEncryptionKeyFile = mkOption {
type = types.nullOr types.path;
default = null;
description = mdDoc ''
Path to your storage encryption key.
'';
};
};
};
};
environmentVariables = mkOption {
type = types.attrsOf types.str;
description = mdDoc ''
Additional environment variables to provide to authelia.
If you are providing secrets please consider the options under {option}`services.authelia.<instance>.secrets`
or make sure you use the `_FILE` suffix.
If you provide the raw secret rather than the location of a secret file that secret will be preserved in the nix store.
For more details: https://www.authelia.com/configuration/methods/secrets/
'';
default = { };
};
settings = mkOption {
description = mdDoc ''
Your Authelia config.yml as a Nix attribute set.
There are several values that are defined and documented in nix such as `default_2fa_method`,
but additional items can also be included.
https://github.com/authelia/authelia/blob/master/config.template.yml
'';
default = { };
example = ''
{
theme = "light";
default_2fa_method = "totp";
log.level = "debug";
server.disable_healthcheck = true;
}
'';
type = types.submodule {
freeformType = format.type;
options = {
theme = mkOption {
type = types.enum [ "light" "dark" "grey" "auto" ];
default = "light";
example = "dark";
description = mdDoc "The theme to display.";
};
default_2fa_method = mkOption {
type = types.enum [ "" "totp" "webauthn" "mobile_push" ];
default = "";
example = "webauthn";
description = mdDoc ''
Default 2FA method for new users and fallback for preferred but disabled methods.
'';
};
server = {
host = mkOption {
type = types.str;
default = "localhost";
example = "0.0.0.0";
description = mdDoc "The address to listen on.";
};
port = mkOption {
type = types.port;
default = 9091;
description = mdDoc "The port to listen on.";
};
};
log = {
level = mkOption {
type = types.enum [ "info" "debug" "trace" ];
default = "debug";
example = "info";
description = mdDoc "Level of verbosity for logs: info, debug, trace.";
};
format = mkOption {
type = types.enum [ "json" "text" ];
default = "json";
example = "text";
description = mdDoc "Format the logs are written as.";
};
file_path = mkOption {
type = types.nullOr types.path;
default = null;
example = "/var/log/authelia/authelia.log";
description = mdDoc "File path where the logs will be written. If not set logs are written to stdout.";
};
keep_stdout = mkOption {
type = types.bool;
default = false;
example = true;
description = mdDoc "Whether to also log to stdout when a `file_path` is defined.";
};
};
telemetry = {
metrics = {
enabled = mkOption {
type = types.bool;
default = false;
example = true;
description = mdDoc "Enable Metrics.";
};
address = mkOption {
type = types.str;
default = "tcp://127.0.0.1:9959";
example = "tcp://0.0.0.0:8888";
description = mdDoc "The address to listen on for metrics. This should be on a different port to the main `server.port` value.";
};
};
};
};
};
};
settingsFiles = mkOption {
type = types.listOf types.path;
default = [ ];
example = [ "/etc/authelia/config.yml" "/etc/authelia/access-control.yml" "/etc/authelia/config/" ];
description = mdDoc ''
Here you can provide authelia with configuration files or directories.
It is possible to give authelia multiple files and use the nix generated configuration
file set via {option}`services.authelia.<instance>.settings`.
'';
};
};
};
in
{
options.services.authelia.instances = with lib; mkOption {
default = { };
type = types.attrsOf (types.submodule autheliaOpts);
description = mdDoc ''
Multi-domain protection currently requires multiple instances of Authelia.
If you don't require multiple instances of Authelia you can define just the one.
https://www.authelia.com/roadmap/active/multi-domain-protection/
'';
example = ''
{
main = {
enable = true;
secrets.storageEncryptionKeyFile = "/etc/authelia/storageEncryptionKeyFile";
secrets.jwtSecretFile = "/etc/authelia/jwtSecretFile";
settings = {
theme = "light";
default_2fa_method = "totp";
log.level = "debug";
server.disable_healthcheck = true;
};
};
preprod = {
enable = false;
secrets.storageEncryptionKeyFile = "/mnt/pre-prod/authelia/storageEncryptionKeyFile";
secrets.jwtSecretFile = "/mnt/pre-prod/jwtSecretFile";
settings = {
theme = "dark";
default_2fa_method = "webauthn";
server.host = "0.0.0.0";
};
};
test.enable = true;
test.secrets.manual = true;
test.settings.theme = "grey";
test.settings.server.disable_healthcheck = true;
test.settingsFiles = [ "/mnt/test/authelia" "/mnt/test-authelia.conf" ];
};
}
'';
};
config =
let
mkInstanceServiceConfig = instance:
let
execCommand = "${instance.package}/bin/authelia";
configFile = format.generate "config.yml" instance.settings;
configArg = "--config ${builtins.concatStringsSep "," (lib.concatLists [[configFile] instance.settingsFiles])}";
in
{
description = "Authelia authentication and authorization server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
environment =
(lib.filterAttrs (_: v: v != null) {
AUTHELIA_JWT_SECRET_FILE = instance.secrets.jwtSecretFile;
AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE = instance.secrets.storageEncryptionKeyFile;
AUTHELIA_SESSION_SECRET_FILE = instance.secrets.sessionSecretFile;
AUTHELIA_IDENTITY_PROVIDERS_OIDC_ISSUER_PRIVATE_KEY_FILE = instance.secrets.oidcIssuerPrivateKeyFile;
AUTHELIA_IDENTITY_PROVIDERS_OIDC_HMAC_SECRET_FILE = instance.secrets.oidcHmacSecretFile;
})
// instance.environmentVariables;
preStart = "${execCommand} ${configArg} validate-config";
serviceConfig = {
User = instance.user;
Group = instance.group;
ExecStart = "${execCommand} ${configArg}";
Restart = "always";
RestartSec = "5s";
StateDirectory = "authelia-${instance.name}";
StateDirectoryMode = "0700";
# Security options:
AmbientCapabilities = "";
CapabilityBoundingSet = "";
DeviceAllow = "";
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateTmp = true;
PrivateDevices = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = "read-only";
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "noaccess";
ProtectSystem = "strict";
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallErrorNumber = "EPERM";
SystemCallFilter = [
"@system-service"
"~@cpu-emulation"
"~@debug"
"~@keyring"
"~@memlock"
"~@obsolete"
"~@privileged"
"~@setuid"
];
};
};
mkInstanceUsersConfig = instance: {
groups."authelia-${instance.name}" =
lib.mkIf (instance.group == "authelia-${instance.name}") {
name = "authelia-${instance.name}";
};
users."authelia-${instance.name}" =
lib.mkIf (instance.user == "authelia-${instance.name}") {
name = "authelia-${instance.name}";
isSystemUser = true;
group = instance.group;
};
};
instances = lib.attrValues cfg.instances;
in
{
assertions = lib.flatten (lib.flip lib.mapAttrsToList cfg.instances (name: instance:
[
{
assertion = instance.secrets.manual || (instance.secrets.jwtSecretFile != null && instance.secrets.storageEncryptionKeyFile != null);
message = ''
Authelia requires a JWT Secret and a Storage Encryption Key to work.
Either set them like so:
services.authelia.${name}.secrets.jwtSecretFile = /my/path/to/jwtsecret;
services.authelia.${name}.secrets.storageEncryptionKeyFile = /my/path/to/encryptionkey;
Or set services.authelia.${name}.secrets.manual = true and provide them yourself via
environmentVariables or settingsFiles.
Do not include raw secrets in nix settings.
'';
}
]
));
systemd.services = lib.mkMerge
(map
(instance: lib.mkIf instance.enable {
"authelia-${instance.name}" = mkInstanceServiceConfig instance;
})
instances);
users = lib.mkMerge
(map
(instance: lib.mkIf instance.enable (mkInstanceUsersConfig instance))
instances);
};
}

View File

@ -85,6 +85,7 @@ in {
atop = handleTest ./atop.nix {};
atuin = handleTest ./atuin.nix {};
auth-mysql = handleTest ./auth-mysql.nix {};
authelia = handleTest ./authelia.nix {};
avahi = handleTest ./avahi.nix {};
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
babeld = handleTest ./babeld.nix {};
@ -217,7 +218,7 @@ in {
extra-python-packages = handleTest ./extra-python-packages.nix {};
evcc = handleTest ./evcc.nix {};
fancontrol = handleTest ./fancontrol.nix {};
fcitx = handleTest ./fcitx {};
fcitx5 = handleTest ./fcitx5 {};
fenics = handleTest ./fenics.nix {};
ferm = handleTest ./ferm.nix {};
firefox = handleTest ./firefox.nix { firefoxPackage = pkgs.firefox; };

169
nixos/tests/authelia.nix Normal file
View File

@ -0,0 +1,169 @@
# Test Authelia as an auth server for Traefik as a reverse proxy of a local web service
import ./make-test-python.nix ({ pkgs, ... }: {
name = "authelia";
meta.maintainers = with lib.maintainers; [ jk ];
nodes = {
authelia = { config, pkgs, lib, ... }: {
services.authelia.instances.testing = {
enable = true;
secrets.storageEncryptionKeyFile = "/etc/authelia/storageEncryptionKeyFile";
secrets.jwtSecretFile = "/etc/authelia/jwtSecretFile";
settings = {
authentication_backend.file.path = "/etc/authelia/users_database.yml";
access_control.default_policy = "one_factor";
session.domain = "example.com";
storage.local.path = "/tmp/db.sqlite3";
notifier.filesystem.filename = "/tmp/notifications.txt";
};
};
# These should not be set from nix but through other means to not leak the secret!
# This is purely for testing purposes!
environment.etc."authelia/storageEncryptionKeyFile" = {
mode = "0400";
user = "authelia-testing";
text = "you_must_generate_a_random_string_of_more_than_twenty_chars_and_configure_this";
};
environment.etc."authelia/jwtSecretFile" = {
mode = "0400";
user = "authelia-testing";
text = "a_very_important_secret";
};
environment.etc."authelia/users_database.yml" = {
mode = "0400";
user = "authelia-testing";
text = ''
users:
bob:
disabled: false
displayname: bob
# password of password
password: $argon2id$v=19$m=65536,t=3,p=4$2ohUAfh9yetl+utr4tLcCQ$AsXx0VlwjvNnCsa70u4HKZvFkC8Gwajr2pHGKcND/xs
email: bob@jim.com
groups:
- admin
- dev
'';
};
services.traefik = {
enable = true;
dynamicConfigOptions = {
tls.certificates =
let
certDir = pkgs.runCommand "selfSignedCerts" { buildInputs = [ pkgs.openssl ]; } ''
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=example.com/CN=auth.example.com/CN=static.example.com' -days 36500
mkdir -p $out
cp key.pem cert.pem $out
'';
in
[{
certFile = "${certDir}/cert.pem";
keyFile = "${certDir}/key.pem";
}];
http.middlewares.authelia.forwardAuth = {
address = "http://localhost:9091/api/verify?rd=https%3A%2F%2Fauth.example.com%2F";
trustForwardHeader = true;
authResponseHeaders = [
"Remote-User"
"Remote-Groups"
"Remote-Email"
"Remote-Name"
];
};
http.middlewares.authelia-basic.forwardAuth = {
address = "http://localhost:9091/api/verify?auth=basic";
trustForwardHeader = true;
authResponseHeaders = [
"Remote-User"
"Remote-Groups"
"Remote-Email"
"Remote-Name"
];
};
http.routers.simplehttp = {
rule = "Host(`static.example.com`)";
tls = true;
entryPoints = "web";
service = "simplehttp";
};
http.routers.simplehttp-basic-auth = {
rule = "Host(`static-basic-auth.example.com`)";
tls = true;
entryPoints = "web";
service = "simplehttp";
middlewares = [ "authelia-basic@file" ];
};
http.services.simplehttp = {
loadBalancer.servers = [{
url = "http://localhost:8000";
}];
};
http.routers.authelia = {
rule = "Host(`auth.example.com`)";
tls = true;
entryPoints = "web";
service = "authelia@file";
};
http.services.authelia = {
loadBalancer.servers = [{
url = "http://localhost:9091";
}];
};
};
staticConfigOptions = {
global = {
checkNewVersion = false;
sendAnonymousUsage = false;
};
entryPoints.web.address = ":443";
};
};
systemd.services.simplehttp =
let fakeWebPageDir = pkgs.writeTextDir "index.html" "hello"; in
{
script = "${pkgs.python3}/bin/python -m http.server --directory ${fakeWebPageDir} 8000";
serviceConfig.Type = "simple";
wantedBy = [ "multi-user.target" ];
};
};
};
testScript = ''
start_all()
authelia.wait_for_unit("simplehttp.service")
authelia.wait_for_unit("traefik.service")
authelia.wait_for_unit("authelia-testing.service")
authelia.wait_for_open_port(443)
authelia.wait_for_unit("multi-user.target")
with subtest("Check for authelia"):
# expect the login page
assert "Login - Authelia", "could not reach authelia" in \
authelia.succeed("curl --insecure -sSf -H Host:auth.example.com https://authelia:443/")
with subtest("Check contacting basic http server via traefik with https works"):
assert "hello", "could not reach raw static site" in \
authelia.succeed("curl --insecure -sSf -H Host:static.example.com https://authelia:443/")
with subtest("Test traefik and authelia"):
with subtest("No details fail"):
authelia.fail("curl --insecure -sSf -H Host:static-basic-auth.example.com https://authelia:443/")
with subtest("Incorrect details fail"):
authelia.fail("curl --insecure -sSf -u 'bob:wordpass' -H Host:static-basic-auth.example.com https://authelia:443/")
authelia.fail("curl --insecure -sSf -u 'alice:password' -H Host:static-basic-auth.example.com https://authelia:443/")
with subtest("Correct details pass"):
assert "hello", "could not reach authed static site with valid credentials" in \
authelia.succeed("curl --insecure -sSf -u 'bob:password' -H Host:static-basic-auth.example.com https://authelia:443/")
'';
})

View File

@ -1,12 +0,0 @@
[Hotkey]
SwitchKey=Disabled
IMSwitchHotkey=ALT_SHIFT
TimeInterval=240
[Program]
DelayStart=5
[Output]
[Appearance]

View File

@ -1,4 +0,0 @@
[Profile]
IMName=zhengma-large
EnabledIMList=fcitx-keyboard-us:True,zhengma-large:True,m17n_sa_harvard-kyoto:True
PreeditStringInClientWindow=False

11
nixos/tests/fcitx5/config Normal file
View File

@ -0,0 +1,11 @@
[Hotkey]
EnumerateSkipFirst=False
[Hotkey/TriggerKeys]
0=Control+space
[Hotkey/EnumerateForwardKeys]
0=Alt+Shift_L
[Hotkey/EnumerateBackwardKeys]
0=Alt+Shift_R

View File

@ -1,64 +1,48 @@
import ../make-test-python.nix (
import ../make-test-python.nix ({ pkgs, ... }:
# copy_from_host works only for store paths
rec {
name = "fcitx5";
nodes.machine = { pkgs, ... }:
{
pkgs, ...
}:
# copy_from_host works only for store paths
rec {
name = "fcitx";
meta.broken = true; # takes hours to time out since October 2021
nodes.machine =
{
pkgs,
...
}:
{
imports = [
../common/user-account.nix
];
imports = [
../common/user-account.nix
];
environment.systemPackages = [
# To avoid clashing with xfce4-terminal
pkgs.alacritty
];
environment.systemPackages = [
# To avoid clashing with xfce4-terminal
pkgs.alacritty
];
services.xserver = {
enable = true;
displayManager = {
lightdm.enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver =
{
enable = true;
desktopManager.xfce.enable = true;
};
displayManager = {
lightdm.enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = [
pkgs.fcitx5-m17n
pkgs.fcitx5-chinese-addons
];
};
};
desktopManager.xfce.enable = true;
};
i18n = {
inputMethod = {
enabled = "fcitx";
fcitx.engines = [
pkgs.fcitx-engines.m17n
pkgs.fcitx-engines.table-extra
];
};
};
}
;
testScript = { nodes, ... }:
let
user = nodes.machine.config.users.users.alice;
userName = user.name;
userHome = user.home;
xauth = "${userHome}/.Xauthority";
fcitx_confdir = "${userHome}/.config/fcitx";
in
''
testScript = { nodes, ... }:
let
user = nodes.machine.users.users.alice;
xauth = "${user.home}/.Xauthority";
fcitx_confdir = "${user.home}/.config/fcitx5";
in
''
# We need config files before login session
# So copy first thing
@ -75,13 +59,13 @@ import ../make-test-python.nix (
start_all()
machine.wait_for_file("${xauth}")
machine.wait_for_file("${xauth}}")
machine.succeed("xauth merge ${xauth}")
machine.sleep(5)
machine.succeed("su - ${userName} -c 'alacritty&'")
machine.succeed("su - ${userName} -c 'fcitx&'")
machine.succeed("su - ${user.name} -c 'alacritty&'")
machine.succeed("su - ${user.name} -c 'fcitx5&'")
machine.sleep(10)
### Type on terminal
@ -109,8 +93,10 @@ import ../make-test-python.nix (
machine.send_key("ctrl-spc")
machine.sleep(1)
### Default zhengma, enter 一下
machine.send_chars("a2")
### Default wubi, enter 一下
machine.send_chars("gggh")
machine.sleep(1)
machine.send_key("\n")
machine.sleep(1)
### Switch to Harvard Kyoto
@ -134,9 +120,8 @@ import ../make-test-python.nix (
machine.screenshot("terminal_chars")
### Verify that file contents are as expected
file_content = machine.succeed("cat ${userHome}/fcitx_test.out")
file_content = machine.succeed("cat ${user.home}/fcitx_test.out")
assert file_content == "\n"
''
;
}
)
;
})

View File

@ -0,0 +1,15 @@
[Groups/0]
Name=NixOS_test
Default Layout=us
DefaultIM=wbx
[Groups/0/Items/0]
Name=wbx
Layout=us
[Groups/0/Items/1]
Name=m17n_sa_harvard-kyoto
Layout=us
[GroupOrder]
0=NixOS_test

View File

@ -128,11 +128,11 @@
"vendorHash": null
},
"azurerm": {
"hash": "sha256-Sv9e48+2rV3t9dmg6COWfrxnfMaxS9xJAPN1sEPen60=",
"hash": "sha256-pt+lff+kdiFmYRFpCjF/Ok7Uq6wWGcMZRZJe1Lh+K8s=",
"homepage": "https://registry.terraform.io/providers/hashicorp/azurerm",
"owner": "hashicorp",
"repo": "terraform-provider-azurerm",
"rev": "v3.48.0",
"rev": "v3.49.0",
"spdx": "MPL-2.0",
"vendorHash": null
},
@ -765,11 +765,11 @@
"vendorHash": null
},
"newrelic": {
"hash": "sha256-2MbzXcdtP4O+zWGhBCp+uryVJmZoA2kXDe8AH3vZ0zA=",
"hash": "sha256-Ibc53R68QOGGcFFXkMZXCPFo6H8nvQ5VYq/DXdLnBEA=",
"homepage": "https://registry.terraform.io/providers/newrelic/newrelic",
"owner": "newrelic",
"repo": "terraform-provider-newrelic",
"rev": "v3.18.0",
"rev": "v3.18.1",
"spdx": "MPL-2.0",
"vendorHash": "sha256-dEbJTeHWhfR+8o/s4fi4I0sio1uuh6OIzJhVF5Rup04="
},
@ -838,13 +838,13 @@
"vendorHash": null
},
"opennebula": {
"hash": "sha256-r8z5rpSvjNSDuvcRLtnOUFnBFFNAlcvfCbmW6LLHP5E=",
"hash": "sha256-Y1rNhXnHgwpKPgN5iZxH0ChHUBOj36K3XnSOkObj10g=",
"homepage": "https://registry.terraform.io/providers/OpenNebula/opennebula",
"owner": "OpenNebula",
"repo": "terraform-provider-opennebula",
"rev": "v1.1.1",
"rev": "v1.2.0",
"spdx": "MPL-2.0",
"vendorHash": "sha256-zKtBDnvlQHe+q0OZUMUGu1gNsx2wIrIoArtJrt0VaBk="
"vendorHash": "sha256-W7UGOtyFsIMXPqFDnde2XlzU7klR7Fs00mSuJ9ID20A="
},
"openstack": {
"hash": "sha256-UGs2Os7cWSd69ekzyoDLwzJxhGgUJbDJyrCIc6ipcwY=",
@ -874,11 +874,11 @@
"vendorHash": null
},
"ovh": {
"hash": "sha256-d/G2o1G0cdb5shSv1WG7YBbhNift2sKjUd/Cz9XgvJ8=",
"hash": "sha256-ePF3lojT4Dit3n4oI/74u3372gsSW8B1FQfEPhdfmz4=",
"homepage": "https://registry.terraform.io/providers/ovh/ovh",
"owner": "ovh",
"repo": "terraform-provider-ovh",
"rev": "v0.28.1",
"rev": "v0.29.0",
"spdx": "MPL-2.0",
"vendorHash": null
},
@ -1099,11 +1099,11 @@
"vendorHash": "sha256-GkmUKSnqkabwGCl22/90529BWb0oJaIJHYHlS/h3KNY="
},
"tencentcloud": {
"hash": "sha256-E1L/xL+8xqNlJamklpgqq9HwdypRIh3jHTdkJtN+WVU=",
"hash": "sha256-N6x3CKpLL62lc+V038740EGBicjroc07KhkvyCYgn24=",
"homepage": "https://registry.terraform.io/providers/tencentcloudstack/tencentcloud",
"owner": "tencentcloudstack",
"repo": "terraform-provider-tencentcloud",
"rev": "v1.79.17",
"rev": "v1.79.18",
"spdx": "MPL-2.0",
"vendorHash": null
},

View File

@ -3,7 +3,7 @@
, harfbuzz #substituting glyphs with opentype fonts
, fribidi, m17n_lib #bidi and encoding
, openssl, libssh2 #build-in ssh
, fcitx, ibus, uim #IME
, fcitx5, fcitx5-gtk, ibus, uim #IME
, wrapGAppsHook #color picker in mlconfig
, Cocoa #Darwin
}:
@ -37,7 +37,8 @@ stdenv.mkDerivation rec {
vte
m17n_lib
fcitx
fcitx5
fcitx5-gtk
ibus
] ++ lib.optionals (stdenv.system != "aarch64-linux") [
# FIXME Currently broken on aarch64-linux

View File

@ -57,6 +57,7 @@ rustPlatform.buildRustPackage rec {
description = "Very resource-friendly and feature-rich replacement for i3status";
homepage = "https://github.com/greshake/i3status-rust";
license = licenses.gpl3Only;
mainProgram = "i3status-rs";
maintainers = with maintainers; [ backuitist globin ];
platforms = platforms.linux;
};

View File

@ -17,13 +17,13 @@
stdenv.mkDerivation rec {
pname = "libdeltachat";
version = "1.111.0";
version = "1.112.0";
src = fetchFromGitHub {
owner = "deltachat";
repo = "deltachat-core-rust";
rev = "v${version}";
hash = "sha256-Fj5qrvlhty03+rxFqajdNoKFI+7qEHmKBXOLy3EonJ8=";
hash = "sha256-byUQQu+lzqTVufEHoeSd9hrDBWj92JCokzetdRITRns=";
};
patches = [
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-5s4onnL5aX4jFxEZWDU9xK6wSdTg7ZJZirxKTiImy38=";
hash = "sha256-j0Cz1tl6N1JuKt2io+uoqUo/cL/VRVVasJ0CU3X1xtw=";
};
nativeBuildInputs = [

View File

@ -4,6 +4,7 @@
, meson
, ninja
, pkg-config
, libdrm
, libGL
, gst_all_1
, nv-codec-headers-11
@ -13,13 +14,13 @@
stdenv.mkDerivation rec {
pname = "nvidia-vaapi-driver";
version = "0.0.8";
version = "0.0.9";
src = fetchFromGitHub {
owner = "elFarto";
repo = pname;
rev = "v${version}";
sha256 = "sha256-RMFkClaWoFNeSglV5otS/rzI6JNQMiAHDzH3DoEHA5I=";
sha256 = "sha256-mQtprgm6QonYiMUPPIcCbWxPQ/b2XuQiOkROZNPYaQk=";
};
nativeBuildInputs = [
@ -30,6 +31,7 @@ stdenv.mkDerivation rec {
];
buildInputs = [
libdrm
libGL
gst_all_1.gstreamer
gst_all_1.gst-plugins-bad
@ -44,6 +46,7 @@ stdenv.mkDerivation rec {
meta = with lib;{
homepage = "https://github.com/elFarto/nvidia-vaapi-driver";
description = "A VA-API implemention using NVIDIA's NVDEC";
changelog = "https://github.com/elFarto/nvidia-vaapi-driver/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers;[ nickcao ];
};

View File

@ -0,0 +1,13 @@
diff --git a/vite.config.ts b/vite.config.ts
index 659ba3e1..1f0afa5c 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -37,7 +37,7 @@ export default defineConfig(({ mode }) => {
base: "./",
build: {
sourcemap,
- outDir: "../internal/server/public_html",
+ outDir: "dist",
emptyOutDir: true,
assetsDir: "static",
rollupOptions: {

View File

@ -0,0 +1,76 @@
{ lib, fetchFromGitHub, buildGoModule, installShellFiles, callPackage }:
let
inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src vendorHash;
web = callPackage ./web.nix { };
in
buildGoModule rec {
inherit pname version src vendorHash;
nativeBuildInputs = [ installShellFiles ];
postPatch = ''
cp -r ${web}/share/authelia-web/* internal/server/public_html
'';
subPackages = [ "cmd/authelia" ];
ldflags =
let
p = "github.com/authelia/authelia/v${lib.versions.major version}/internal/utils";
in
[
"-s"
"-w"
"-X ${p}.BuildTag=v${version}"
"-X '${p}.BuildState=tagged clean'"
"-X ${p}.BuildBranch=v${version}"
"-X ${p}.BuildExtra=nixpkgs"
];
# several tests with networking and several that want chromium
doCheck = false;
postInstall = ''
mkdir -p $out/etc/authelia
cp config.template.yml $out/etc/authelia
installShellCompletion --cmd authelia \
--bash <($out/bin/authelia completion bash) \
--fish <($out/bin/authelia completion fish) \
--zsh <($out/bin/authelia completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/authelia --help
$out/bin/authelia --version | grep "v${version}"
$out/bin/authelia build-info | grep 'v${version}\|nixpkgs'
runHook postInstallCheck
'';
passthru = {
# if overriding replace the postPatch to put your web UI output in internal/server/public_html
inherit web;
updateScript = ./update.sh;
};
meta = with lib; {
homepage = "https://www.authelia.com/";
changelog = "https://github.com/authelia/authelia/releases/tag/v${version}";
description = "A Single Sign-On Multi-Factor portal for web apps";
longDescription = ''
Authelia is an open-source authentication and authorization server
providing two-factor authentication and single sign-on (SSO) for your
applications via a web portal. It acts as a companion for reverse proxies
like nginx, Traefik, caddy or HAProxy to let them know whether requests
should either be allowed or redirected to Authelia's portal for
authentication.
'';
license = licenses.asl20;
maintainers = with maintainers; [ jk raitobezarius dit7ya ];
};
}

16137
pkgs/servers/authelia/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
{ fetchFromGitHub }:
rec {
pname = "authelia";
version = "4.37.5";
src = fetchFromGitHub {
owner = "authelia";
repo = "authelia";
rev = "v${version}";
hash = "sha256-xsdBnyPHFIimhp2rcudWqvVR36WN4vBXbxRmvgqMcDw=";
};
vendorHash = "sha256-mzGE/T/2TT4+7uc2axTqG3aeLMnt1r9Ya7Zj2jIkw/w=";
npmDepsHash = "sha256-MGs6UAxT5QZd8S3AO75mxuCb6U0UdRkGEjenOVj+Oqs=";
}

85
pkgs/servers/authelia/update.sh Executable file
View File

@ -0,0 +1,85 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=./. -i bash -p coreutils gnused curl nix jq nodePackages.npm
set -euo pipefail
DRV_DIR="$(dirname "${BASH_SOURCE[0]}")"
DRV_DIR=$(realpath "$DRV_DIR")
NIXPKGS_ROOT="$DRV_DIR/../../.."
NIXPKGS_ROOT=$(realpath "$NIXPKGS_ROOT")
instantiateClean() {
nix-instantiate --eval --strict -E "with import ./. {}; $1" | cut -d\" -f2
}
fetchNewSha() {
set +eo pipefail
nix-build -A "$1" 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g'
set -eo pipefail
}
replace() {
sed -i "s@$1@$2@g" "$3"
}
grab_version() {
instantiateClean "authelia.version"
}
# provide a github token so you don't get rate limited
# if you use gh cli you can use:
# `export GITHUB_TOKEN="$(cat ~/.config/gh/config.yml | yq '.hosts."github.com".oauth_token' -r)"`
# or just set your token by hand:
# `read -s -p "Enter your token: " GITHUB_TOKEN; export GITHUB_TOKEN`
# (we use read so it doesn't show in our shell history and in secret mode so the token you paste isn't visible)
if [ -z "${GITHUB_TOKEN:-}" ]; then
echo "no GITHUB_TOKEN provided - you could meet API request limiting" >&2
fi
OLD_VERSION=$(instantiateClean "authelia.version")
LATEST_TAG=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} --silent https://api.github.com/repos/authelia/authelia/releases/latest | jq -r '.tag_name')
NEW_VERSION=$(echo ${LATEST_TAG} | sed 's/^v//')
if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then
echo "already up to date"
exit
fi
TMP_HASH="sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
echo "New version $NEW_VERSION"
replace "$OLD_VERSION" "$NEW_VERSION" "$DRV_DIR/sources.nix"
OLD_SRC_HASH="$(instantiateClean authelia.src.outputHash)"
echo "Old src hash $OLD_SRC_HASH"
replace "$OLD_SRC_HASH" "$TMP_HASH" "$DRV_DIR/sources.nix"
NEW_SRC_HASH="$(fetchNewSha authelia.src)"
echo "New src hash $NEW_SRC_HASH"
replace "$TMP_HASH" "$NEW_SRC_HASH" "$DRV_DIR/sources.nix"
# after updating src the next focus is the web dependencies
# build package-lock.json since authelia uses pnpm
WEB_DIR=$(mktemp -d)
clean_up() {
rm -rf "$WEB_DIR"
}
trap clean_up EXIT
# OLD_PWD=$PWD
# cd $WEB_DIR
# OUT=$(nix-build -E "with import $NIXPKGS_ROOT {}; authelia.src" --no-out-link)
# cp -r $OUT/web/package.json .
# npm install --package-lock-only --legacy-peer-deps --ignore-scripts
# mv package-lock.json "$DRV_DIR/"
# cd $OLD_PWD
OLD_NPM_DEPS_HASH="$(instantiateClean authelia.web.npmDepsHash)"
echo "Old npm deps hash $OLD_NPM_DEPS_HASH"
replace "$OLD_NPM_DEPS_HASH" "$TMP_HASH" "$DRV_DIR/sources.nix"
NEW_NPM_DEPS_HASH="$(fetchNewSha authelia.web)"
echo "New npm deps hash $NEW_NPM_DEPS_HASH"
replace "$TMP_HASH" "$NEW_NPM_DEPS_HASH" "$DRV_DIR/sources.nix"
clean_up
OLD_GO_VENDOR_HASH="$(instantiateClean authelia.vendorHash)"
echo "Old go vendor hash $OLD_GO_VENDOR_HASH"
replace "$OLD_GO_VENDOR_HASH" "$TMP_HASH" "$DRV_DIR/sources.nix"
NEW_GO_VENDOR_HASH="$(fetchNewSha authelia.go-modules)"
echo "New go vendor hash $NEW_GO_VENDOR_HASH"
replace "$TMP_HASH" "$NEW_GO_VENDOR_HASH" "$DRV_DIR/sources.nix"

View File

@ -0,0 +1,30 @@
{ buildNpmPackage, fetchFromGitHub }:
let
inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src npmDepsHash;
in
buildNpmPackage {
pname = "${pname}-web";
inherit src version npmDepsHash;
sourceRoot = "source/web";
patches = [
./change-web-out-dir.patch
];
postPatch = ''
cp ${./package-lock.json} ./package-lock.json
'';
npmFlags = [ "--legacy-peer-deps" ];
installPhase = ''
runHook preInstall
mkdir -p $out/share
mv dist $out/share/authelia-web
runHook postInstall
'';
}

View File

@ -1,28 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, anthy, gettext, pkg-config }:
stdenv.mkDerivation rec {
pname = "fcitx-anthy";
version = "0.2.4";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-anthy/${pname}-${version}.tar.xz";
sha256 = "sha256-Hxhs2RXuFf/bhczcQ3+Zj+gI3+Z4BEfIzMIfUOUNX7M=";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx anthy gettext ];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
description = "Fcitx Wrapper for anthy";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,32 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, gettext, libchewing, pkg-config }:
stdenv.mkDerivation rec {
pname = "fcitx-chewing";
version = "0.2.3";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-chewing/${pname}-${version}.tar.xz";
sha256 = "1w5smp5zvjx681cp1znjypyr9sw5x6v0wnsk8a7ncwxi9q9wf4xk";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx gettext libchewing ];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace data/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-chewing";
downloadPage = "http://download.fcitx-im.org/fcitx-chewing/";
description = "Fcitx engine for chewing";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,29 +0,0 @@
{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, gettext, curl }:
stdenv.mkDerivation rec {
pname = "fcitx-cloudpinyin";
version = "0.3.7";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-cloudpinyin/${pname}-${version}.tar.xz";
sha256 = "0ai347wv3qdjzcbh0j9hdjpzwvh2kk57324xbxq37nzagrdgg5x0";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx gettext curl ];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace po/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
description = "A standalone module for fcitx that uses web API to provide better pinyin result";
homepage = "https://github.com/fcitx/fcitx-cloudpinyin";
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}

View File

@ -1,31 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, libhangul, gettext, pkg-config }:
stdenv.mkDerivation rec {
pname = "fcitx-hangul";
version = "0.3.1";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-hangul/${pname}-${version}.tar.xz";
sha256 = "0ds4071ljq620w7vnprm2jl8zqqkw7qsxvzbjapqak4jarczvmbd";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx libhangul gettext ];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace data/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-hangul";
downloadPage = "http://download.fcitx-im.org/fcitx-hangul/";
description = "Fcitx Wrapper for hangul";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,16 +0,0 @@
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -9,12 +9,7 @@ char* FcitxLibPinyinGetSysPath(LIBPINYIN_LANGUAGE_TYPE type)
#ifdef LIBPINYIN_TOOLS_FOUND
if (type == LPLT_Simplified) {
#endif
- /* portable detect here */
- if (getenv("FCITXDIR")) {
- syspath = fcitx_utils_get_fcitx_path_with_filename("datadir", "libpinyin/data");
- } else {
- syspath = strdup(LIBPINYIN_PKGDATADIR "/data");
- }
+ syspath = strdup(LIBPINYIN_PKGDATADIR "/data");
#ifdef LIBPINYIN_TOOLS_FOUND
}
else {

View File

@ -1,55 +0,0 @@
{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, gettext, libpinyin, glib, pcre, dbus, qtwebengine, qtbase, fcitx-qt5 }:
stdenv.mkDerivation rec {
pname = "fcitx-libpinyin";
version = "0.5.4";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-libpinyin/${pname}-${version}.tar.xz";
sha256 = "1wvsc21imbgq3chlxfw4aycmkb2vi1bkjj9frvhga2m5b5pq82k5";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx-qt5 qtbase qtwebengine.dev fcitx gettext libpinyin glib pcre dbus ];
# With a typical installation via NixOS option i18n.inputMethod.fcitx.engines,
# the FCITXDIR environment variable is set to $out of fcitx-with-plugins,
# which leads to an incorrect path for pinyin data.
#
# It is impossible or difficult to fix this issue without patching. We want
# FCITXDIR to point into libpinyin, which is currently not symlinked within
# fcitx-with-plugins (only fcitx-libpinyin is symlinked). Also, FCITXDIR
# doesn't accept multiple directories.
patches = [ ./datapath.patch ];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace data/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace dictmanager/cmake_install.cmake \
--replace ${fcitx} $out
'';
preBuild = let
ZHUYIN_DATA_FILE_NAME = "model.text.20161206.tar.gz";
store_path = fetchurl {
url = "https://download.fcitx-im.org/data/${ZHUYIN_DATA_FILE_NAME}";
sha256 = "017p11si1b7bkwx36xaybq5a9icq1pd7x1jbymqw92akfgjj8w2w";
};
in
''
cp -rv ${store_path} $NIX_BUILD_TOP/$name/data/${ZHUYIN_DATA_FILE_NAME}
'';
dontWrapQtApps = true;
meta = with lib; {
isFcitxEngine = true;
description = "Fcitx Wrapper for libpinyin, Library to deal with pinyin";
homepage = "https://github.com/fcitx/fcitx-libpinyin";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ericsagnes ];
platforms = platforms.linux;
};
}

View File

@ -1,30 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, gettext, m17n_lib, m17n_db, pkg-config }:
stdenv.mkDerivation rec {
pname = "fcitx-m17n";
version = "0.2.4";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-m17n/${pname}-${version}.tar.xz";
sha256 = "15s52h979xz967f8lm0r0qkplig2w3wjck1ymndbg9kvj25ib0ng";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx gettext m17n_lib m17n_db ];
preInstall = ''
substituteInPlace im/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-m17n";
downloadPage = "http://download.fcitx-im.org/fcitx-table-other/";
description = "Fcitx wrapper for m17n";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,113 +0,0 @@
{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, gyp, which, ninja,
python, pkg-config, protobuf, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese,
fcitx, gettext }:
let
japanese_usage_dictionary = fetchFromGitHub {
owner = "hiroyuki-komatsu";
repo = "japanese-usage-dictionary";
rev = "e5b3425575734c323e1d947009dd74709437b684";
sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm";
};
icons = fetchurl {
url = "http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz";
sha256 = "10bdjn481jsh32vll7r756l392anz44h6207vjqwby3rplk31np1";
};
in clangStdenv.mkDerivation rec {
pname = "fcitx-mozc";
version = "2.23.2815.102";
src = fetchFromGitHub {
owner = "google";
repo = "mozc";
rev = "afb03ddfe72dde4cf2409863a3bfea160f7a66d8";
sha256 = "0w2dy2j9x5nc7x3g95j17r3m60vbfyn5j617h7js9xryv33yzpgx";
};
nativeBuildInputs = [ gyp which ninja python pkg-config qt5.wrapQtAppsHook ];
buildInputs = [ protobuf gtk2 zinnia qt5.qtbase libxcb fcitx gettext ];
postUnpack = ''
rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/
ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary
tar -xzf ${icons} -C $sourceRoot/src
'';
patch_version = "${version}.1";
patches = [
(fetchpatch rec {
name = "fcitx-mozc-${patch_version}.patch";
url = "https://download.fcitx-im.org/fcitx-mozc/${name}";
sha256 = "0a8q3vzcbai1ccdrl6qdb81gvbw8aby4lqkl6qs9hg68p6zg42hg";
})
# https://github.com/google/mozc/pull/444 - fix for gcc8 STL
(fetchpatch {
url = "https://github.com/google/mozc/commit/82d38f929882a9c62289b179c6fe41efed249987.patch";
sha256 = "07cja1b7qfsd3i76nscf1zwiav74h7d6h2g9g2w4bs3h1mc9jwla";
})
# Support dates after 2019
(fetchpatch {
url = "https://salsa.debian.org/debian/mozc/-/raw/master/debian/patches/add_support_new_japanese_era.patch";
sha256 = "1dsiiglrmm8i8shn2hv0j2b8pv6miysjrimj4569h606j4lwmcw2";
})
];
postPatch = ''
substituteInPlace src/unix/fcitx/mozc.conf \
--replace "/usr/share/fcitx/mozc/icon/mozc.png" "mozc"
'';
configurePhase = ''
export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_fcitx5=0 zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model"
cd src && python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc
'';
buildPhase = ''
PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \
server/server.gyp:mozc_server \
gui/gui.gyp:mozc_tool \
unix/fcitx/fcitx.gyp:fcitx-mozc
'';
installPhase = ''
install -d $out/share/licenses/fcitx-mozc
head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx-mozc/LICENSE
install -m 644 data/installer/*.html $out/share/licenses/fcitx-mozc/
install -d $out/share/doc/mozc
install -m 644 data/installer/*.html $out/share/doc/mozc/
install -D -m 755 out_linux/Release/mozc_server $out/lib/mozc/mozc_server
install -m 755 out_linux/Release/mozc_tool $out/lib/mozc/mozc_tool
wrapQtApp $out/lib/mozc/mozc_tool
install -D -m 755 out_linux/Release/fcitx-mozc.so $out/lib/fcitx/fcitx-mozc.so
install -D -m 644 unix/fcitx/fcitx-mozc.conf $out/share/fcitx/addon/fcitx-mozc.conf
install -D -m 644 unix/fcitx/mozc.conf $out/share/fcitx/inputmethod/mozc.conf
install -d $out/share/doc/mozc
for mofile in out_linux/Release/gen/unix/fcitx/po/*.mo
do
filename=`basename $mofile`
lang=$filename.mo
install -D -m 644 "$mofile" "$out/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo"
done
install -d $out/share/fcitx/imicon
install -m 644 fcitx-mozc-icons/mozc.png $out/share/fcitx/imicon/mozc.png
install -d $out/share/fcitx/mozc/icon
install -m 644 fcitx-mozc-icons/*.png $out/share/fcitx/mozc/icon/
'';
meta = with lib; {
isFcitxEngine = true;
description = "Fcitx engine for Google japanese input method";
homepage = "https://github.com/google/mozc";
downloadPage = "http://download.fcitx-im.org/fcitx-mozc/";
license = licenses.free;
platforms = platforms.linux;
maintainers = with maintainers; [ gebner ericsagnes ];
};
}

View File

@ -1,37 +0,0 @@
{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, librime, brise, hicolor-icon-theme }:
stdenv.mkDerivation rec {
pname = "fcitx-rime";
version = "0.3.2";
src = fetchurl {
url = "https://download.fcitx-im.org/fcitx-rime/${pname}-${version}.tar.xz";
sha256 = "0bd8snfa6jr8dhnm0s0z021iryh5pbaf7p15rhkgbigw2pssczpr";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx librime brise hicolor-icon-theme ];
# cmake cannont automatically find our nonstandard brise install location
cmakeFlags = [ "-DRIME_DATA_DIR=${brise}/share/rime-data" ];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace data/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-rime";
downloadPage = "https://download.fcitx-im.org/fcitx-rime/";
description = "Rime support for Fcitx";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ sifmelcara ];
# this package is deprecated, please use fcitx5 instead.
# and it cannot be built with the new version of librime
broken = true;
};
}

View File

@ -1,42 +0,0 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, fcitx, libskk, skk-dicts }:
stdenv.mkDerivation {
pname = "fcitx-skk";
version = "0.1.4";
src = fetchFromGitHub {
owner = "fcitx";
repo = "fcitx-skk";
rev = "f66d0f56a40ff833edbfa68a4be4eaa2e93d0e3d";
sha256 = "1yl2syqrk212h26vzzkwl19fyp71inqmsli9411h4n2hbcp6m916";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx libskk skk-dicts ];
cmakeFlags = [ "-DSKK_DEFAULT_PATH=${skk-dicts}/share/SKK-JISYO.combined"
"-DENABLE_QT=FALSE"
];
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace po/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace data/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
description = "A SKK style input method engine for fcitx";
longDescription = ''
Fcitx-skk is an input method engine for fcitx. It is based on libskk and thus
provides basic features of SKK Japanese input method such as kana-to-kanji conversion,
new word registration, completion, numeric conversion, abbrev mode, kuten input,
hankaku-katakana input, and re-conversion.
'';
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ yuriaisaka ];
};
}

View File

@ -1,30 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, gettext }:
stdenv.mkDerivation rec {
pname = "fcitx-table-extra";
version = "0.3.8";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-table-extra/${pname}-${version}.tar.xz";
sha256 = "c91bb19c1a7b53c5339bf2f75ae83839020d337990f237a8b9bc0f4416c120ef";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ fcitx gettext ];
preInstall = ''
substituteInPlace tables/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-table-extra";
downloadPage = "http://download.fcitx-im.org/fcitx-table-extra/";
description = "Provides extra table for Fcitx, including Boshiamy, Zhengma, Cangjie, and Quick";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ linc01n ];
};
}

View File

@ -1,30 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, gettext }:
stdenv.mkDerivation rec {
pname = "fcitx-table-other";
version = "0.2.4";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-table-other/${pname}-${version}.tar.xz";
sha256 = "1di60lr6l5k2sdwi3yrc0hl89j2k0yipayrsn803vd040w1fgfhq";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ fcitx gettext ];
preInstall = ''
substituteInPlace tables/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-table-other";
downloadPage = "http://download.fcitx-im.org/fcitx-table-other/";
description = "Provides some other tables for Fcitx";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,34 +0,0 @@
{ lib, stdenv, fetchurl, cmake, fcitx, gettext, pkg-config }:
stdenv.mkDerivation rec {
pname = "fcitx-unikey";
version = "0.2.5";
src = fetchurl {
url = "http://download.fcitx-im.org/fcitx-unikey/${pname}-${version}.tar.xz";
sha256 = "063vc29v7ycaai98v3z4q319sv9sm91my17pmhblw1vifxnw02wf";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fcitx gettext ];
env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
preInstall = ''
substituteInPlace src/cmake_install.cmake \
--replace ${fcitx} $out
substituteInPlace data/cmake_install.cmake \
--replace ${fcitx} $out
'';
meta = with lib; {
isFcitxEngine = true;
homepage = "https://github.com/fcitx/fcitx-unikey";
downloadPage = "http://download.fcitx-im.org/fcitx-table-other/";
description = "Fcitx wrapper for unikey";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,11 +0,0 @@
{ callPackage, plugins ? [] }:
let
unwrapped = callPackage ./unwrapped.nix { };
wrapped = callPackage ./wrapper.nix {
plugins = plugins;
fcitx = unwrapped;
};
in if plugins == []
then unwrapped
else wrapped

View File

@ -1,34 +0,0 @@
{ lib, stdenv, fetchurl, makeWrapper, pkg-config, cmake, fcitx, gtk3, isocodes, gnome }:
stdenv.mkDerivation rec {
pname = "fcitx-configtool";
version = "0.4.10";
meta = with lib; {
description = "GTK-based config tool for Fcitx";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ cdepillabout ];
};
src = fetchurl {
url = "https://download.fcitx-im.org/fcitx-configtool/fcitx-configtool-${version}.tar.xz";
sha256 = "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w";
};
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
buildInputs = [ fcitx isocodes gtk3 gnome.adwaita-icon-theme ];
# Patch paths to `fcitx-remote`
prePatch = ''
for f in gtk{3,}/config_widget.c; do
substituteInPlace $f \
--replace 'EXEC_PREFIX "/bin/fcitx-remote"' '"${fcitx}/bin/fcitx-remote"'
done
'';
preFixup = ''
wrapProgram $out/bin/fcitx-config-gtk3 \
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS";
'';
}

View File

@ -1,38 +0,0 @@
{ lib, mkDerivation, fetchFromGitLab
, cmake
, extra-cmake-modules
, fcitx
, pkg-config
, qtbase
}:
mkDerivation rec {
pname = "fcitx-qt5";
version = "1.2.3";
src = fetchFromGitLab {
owner = "fcitx";
repo = pname;
rev = version;
sha256 = "0860v3rxsh054wkkbawvyin5mk0flp4cwfcpmcpq147lvdm5lq2i";
};
nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ];
buildInputs = [ fcitx qtbase ];
preConfigure = ''
substituteInPlace platforminputcontext/CMakeLists.txt \
--replace \$"{CMAKE_INSTALL_QTPLUGINDIR}" $out/${qtbase.qtPluginPrefix}
substituteInPlace quickphrase-editor/CMakeLists.txt \
--replace \$"{FCITX4_ADDON_INSTALL_DIR}" $out/lib/fcitx
'';
meta = with lib; {
homepage = "https://gitlab.com/fcitx/fcitx-qt5";
description = "Qt5 IM Module for Fcitx";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,42 +0,0 @@
diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake
index 7c182e6a..5537595e 100644
--- a/cmake/FindEnchant.cmake
+++ b/cmake/FindEnchant.cmake
@@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
find_package(PkgConfig)
-pkg_check_modules(PC_ENCHANT enchant)
+pkg_check_modules(PC_ENCHANT enchant-2)
find_path(ENCHANT_INCLUDE_DIR
NAMES enchant.h
@@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR
PATH_SUFFIXES "enchant")
find_library(ENCHANT_LIBRARIES
- NAMES enchant
+ NAMES enchant-2
HINTS ${PC_ENCHANT_LIBRARY_DIRS})
if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
@@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
- #include <enchant/enchant.h>
+ #include <enchant-2/enchant.h>
EnchantBroker *enchant_broker_init();
char **enchant_dict_suggest(EnchantDict *dict, const char *str,
@@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
endif()
+if(ENCHANT_API_COMPATIBLE)
+ set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES})
+endif(ENCHANT_API_COMPATIBLE)
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES
ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE)

View File

@ -1,105 +0,0 @@
{ lib, stdenv, fetchurl, pkg-config, cmake, intltool, gettext
, libxml2, enchant2, isocodes, icu, libpthreadstubs
, pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
, dbus, gtk2, gtk3, qt4, extra-cmake-modules
, xkeyboard_config, pcre, libuuid, xorg, makeWrapper
, withPinyin ? true
, fetchFromGitLab
}:
let
# releases at http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz
# contains all data but if we want to compile from source, we need to
# fetch them ourselves
# to update the urls and where to unpack these, look into the
# src/module/*/data/CMakeLists.txt files
# fcitx_download tgt_name url output)
dicts = let SPELL_EN_DICT_VER="20121020"; in fetchurl {
url = "http://download.fcitx-im.org/data/en_dict-${SPELL_EN_DICT_VER}.tar.gz";
sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4";
};
table = fetchurl {
url = "http://download.fcitx-im.org/data/table.tar.gz";
sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1";
};
pystroke-data = let PY_STROKE_VER="20121124"; in fetchurl {
url = "http://download.fcitx-im.org/data/py_stroke-${PY_STROKE_VER}.tar.gz";
sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf";
};
pytable-data = let PY_TABLE_VER="20121124"; in fetchurl {
url = "http://download.fcitx-im.org/data/py_table-${PY_TABLE_VER}.tar.gz";
sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522";
};
pinyin-data = fetchurl {
url = "http://download.fcitx-im.org/data/pinyin.tar.gz";
sha256 = "1qfq5dy4czvd1lvdnxzyaiir9x8b1m46jjny11y0i33m9ar2jf2q";
};
in
stdenv.mkDerivation rec {
pname = "fcitx";
version = "4.2.9.6";
src = fetchFromGitLab {
owner = "fcitx";
repo = "fcitx";
rev = version;
sha256 = "0j5vaf930lb21gx4h7z6mksh1fazqw32gajjjkyir94wbmml9n3s";
};
# put data at the correct locations else cmake tries to fetch them,
# which fails in sandboxed mode
prePatch = ''
cp ${dicts} src/module/spell/dict/$(stripHash ${dicts})
cp ${table} src/im/table/data/$(stripHash ${table})
''
+ lib.optionalString withPinyin ''
cp ${pystroke-data} src/module/pinyin-enhance/data/$(stripHash ${pystroke-data})
cp ${pytable-data} src/module/pinyin-enhance/data/$(stripHash ${pytable-data})
cp ${pinyin-data} src/im/pinyin/data/$(stripHash ${pinyin-data})
''
;
patches = [ ./find-enchant-lib.patch ];
postPatch = ''
substituteInPlace src/frontend/qt/CMakeLists.txt \
--replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
patchShebangs cmake/
'';
postInstall = ''
wrapProgram $out/bin/fcitx \
--prefix PATH : "${xorg.xmodmap}/bin"
'';
nativeBuildInputs = [ cmake extra-cmake-modules intltool pkg-config pcre makeWrapper ];
buildInputs = [
xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile
libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid
];
cmakeFlags = [
"-DENABLE_QT_IM_MODULE=ON"
"-DENABLE_GTK2_IM_MODULE=ON"
"-DENABLE_GTK3_IM_MODULE=ON"
"-DENABLE_GIR=OFF"
"-DENABLE_OPENCC=OFF"
"-DENABLE_PRESAGE=OFF"
"-DENABLE_XDGAUTOSTART=OFF"
"-DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"}"
"-DENABLE_TABLE=ON"
"-DENABLE_SPELL=ON"
"-DENABLE_QT_GUI=ON"
"-DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml'"
];
meta = with lib; {
homepage = "https://github.com/fcitx/fcitx";
description = "A Flexible Input Method Framework";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ];
};
}

View File

@ -1,14 +0,0 @@
{ symlinkJoin, fcitx, fcitx-configtool, makeWrapper, plugins, libsForQt5 }:
symlinkJoin {
name = "fcitx-with-plugins-${fcitx.version}";
paths = [ fcitx fcitx-configtool libsForQt5.fcitx-qt5 ] ++ plugins;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/fcitx \
--set FCITXDIR "$out/"
'';
}

View File

@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchFromGitHub,
zig,
testers,
zf,
}:
stdenv.mkDerivation rec {
pname = "zf";
version = "0.8.0";
src = fetchFromGitHub {
owner = "natecraddock";
repo = pname;
rev = "refs/tags/${version}";
fetchSubmodules = true;
hash = "sha256-MzlSU5x2lb6PJZ/iNAi2aebfuClBprlfHMIG/4OPmuc=";
};
nativeBuildInputs = [ zig ];
dontConfigure = true;
preBuild = ''
export HOME=$TMPDIR
'';
installPhase = ''
runHook preInstall
zig build -Drelease-safe -Dcpu=baseline --prefix $out install
runHook postInstall
'';
passthru.tests.version = testers.testVersion {package = zf;};
meta = with lib; {
homepage = "https://github.com/natecraddock/zf";
description = "A commandline fuzzy finder that prioritizes matches on filenames";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ dit7ya mmlb ];
};
}

View File

@ -8,24 +8,26 @@
buildGoModule rec {
pname = "sing-box";
version = "1.1.7";
version = "1.2.0";
src = fetchFromGitHub {
owner = "SagerNet";
repo = pname;
rev = "v${version}";
hash = "sha256-jovUK535vZeCgnnW+9/gjXwCkNLMXdiCJwWqFKCubcU=";
hash = "sha256-4ww2AlDoFZASRMq05a92FSzl8rrtu3xO4vjvGWYn9rA=";
};
vendorHash = "sha256-WYMCsFX5/4H+Bc0KcxcPMjfz2wEXz3V4D0sww15AgvE=";
vendorHash = "sha256-fj6W4+YTJpemNgdfIvnUy82sPU99Uh18nCou/7cjF1o=";
tags = [
"with_quic"
"with_grpc"
"with_dhcp"
"with_wireguard"
"with_shadowsocksr"
"with_ech"
"with_utls"
"with_reality_server"
"with_acme"
"with_clash_api"
"with_v2ray_api"

View File

@ -511,6 +511,10 @@ mapAliases ({
fuse2fs = if stdenv.isLinux then e2fsprogs.fuse2fs else null; # Added 2022-03-27 preserve, reason: convenience, arch has a package named fuse2fs too.
fwupdate = throw "fwupdate was merged into fwupd"; # Added 2020-05-19
fcitx = throw "fcitx4 is deprecated, please use fcitx5 instead."; # Added 2023-03-13
fcitx-engines = throw "fcitx4 is deprecated, please use fcitx5 instead."; # Added 2023-03-13
fcitx-configtools = throw "fcitx4 is deprecated, please use fcitx5 instead."; # Added 2023-03-13
### G ###
g4py = python3Packages.geant4; # Added 2020-06-06

View File

@ -2830,6 +2830,8 @@ with pkgs;
wrapGAppsHook4 = wrapGAppsHook.override { gtk3 = gtk4; };
};
authelia = callPackage ../servers/authelia { };
autoflake = with python3.pkgs; toPythonApplication autoflake;
autospotting = callPackage ../applications/misc/autospotting { };
@ -7296,43 +7298,6 @@ with pkgs;
fatsort = callPackage ../tools/filesystems/fatsort { };
fcitx = callPackage ../tools/inputmethods/fcitx {
plugins = [];
};
fcitx-engines = recurseIntoAttrs {
anthy = callPackage ../tools/inputmethods/fcitx-engines/fcitx-anthy { };
chewing = callPackage ../tools/inputmethods/fcitx-engines/fcitx-chewing { };
hangul = callPackage ../tools/inputmethods/fcitx-engines/fcitx-hangul { };
unikey = callPackage ../tools/inputmethods/fcitx-engines/fcitx-unikey { };
rime = callPackage ../tools/inputmethods/fcitx-engines/fcitx-rime { };
m17n = callPackage ../tools/inputmethods/fcitx-engines/fcitx-m17n { };
mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc {
python = python2;
inherit (python2Packages) gyp;
protobuf = pkgs.protobuf3_8.overrideDerivation (_: { stdenv = clangStdenv; });
};
table-extra = callPackage ../tools/inputmethods/fcitx-engines/fcitx-table-extra { };
table-other = callPackage ../tools/inputmethods/fcitx-engines/fcitx-table-other { };
cloudpinyin = callPackage ../tools/inputmethods/fcitx-engines/fcitx-cloudpinyin { };
libpinyin = libsForQt5.callPackage ../tools/inputmethods/fcitx-engines/fcitx-libpinyin { };
skk = callPackage ../tools/inputmethods/fcitx-engines/fcitx-skk { };
};
fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };
chewing-editor = libsForQt5.callPackage ../applications/misc/chewing-editor { };
fcitx5 = libsForQt5.callPackage ../tools/inputmethods/fcitx5 { };
@ -39673,4 +39638,6 @@ with pkgs;
udict = callPackage ../applications/misc/udict { };
duden = callPackage ../applications/misc/duden { };
zf = callPackage ../tools/misc/zf { };
}

View File

@ -80,8 +80,6 @@ in (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdParty // kdeGea
drumstick = callPackage ../development/libraries/drumstick { };
fcitx-qt5 = callPackage ../tools/inputmethods/fcitx/fcitx-qt5.nix { };
fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { };
qgpgme = callPackage ../development/libraries/gpgme { };