commit
3d4704b0b4
@ -1,38 +0,0 @@ |
||||
<!-- |
||||
|
||||
If you are encountering the error |
||||
|
||||
element xref: validity error : IDREF attribute linkend references an unknown ID "opt-home.file._name__.source" |
||||
|
||||
then it means that you are using an old version of Home Manager, such |
||||
as the release-20.03 branch, with a recent version of Nixpkgs, such as |
||||
version 20.09 or master. See https://git.io/JTb6K for more. |
||||
|
||||
In general, please check if there already exists a relevant issue |
||||
before creating a new one. |
||||
|
||||
--> |
||||
|
||||
### Issue description |
||||
|
||||
<!-- |
||||
Please describe the issue. For support and help please use the IRC |
||||
channel #home-manager @ freenode.net instead. |
||||
--> |
||||
|
||||
### Meta |
||||
|
||||
#### Maintainer CC |
||||
|
||||
<!-- |
||||
Please @ people who are in the `meta.maintainers` list of the |
||||
offending module. If in doubt, check `git blame` for whoever last |
||||
touched something. |
||||
--> |
||||
|
||||
#### Technical details |
||||
|
||||
<!-- |
||||
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the |
||||
result. |
||||
--> |
@ -0,0 +1,15 @@ |
||||
--- |
||||
name: Feature request |
||||
about: Ask for a new feature to be added (module, program, etc.) |
||||
title: '' |
||||
labels: feature request |
||||
assignees: rycee, berbiche, sumnerevans |
||||
|
||||
--- |
||||
|
||||
<!-- |
||||
Note: Please search to see if the feature has already been requested |
||||
--> |
||||
|
||||
### Description |
||||
|
@ -0,0 +1,46 @@ |
||||
name: Bug Report |
||||
description: File a bug/issue |
||||
title: 'bug: ' |
||||
labels: [bug, triage] |
||||
|
||||
# We cannot use nix-community/home-manager |
||||
# See https://github.com/dear-github/dear-github/issues/170 |
||||
assignees: [rycee, berbiche, sumnerevans] |
||||
|
||||
body: |
||||
- type: checkboxes |
||||
attributes: |
||||
label: Is there an existing issue for this? |
||||
description: | |
||||
Please search to see if an issue already exists for the bug you encountered. |
||||
options: |
||||
- label: I have searched the existing issues |
||||
required: true |
||||
- type: textarea |
||||
attributes: |
||||
label: Issue description |
||||
description: | |
||||
Please describe the issue. |
||||
|
||||
For support and help please use the IRC channel #home-manager at irc.oftc.net or |
||||
Matrix room <https://matrix.to/#/#hm:rycee.net> instead. |
||||
validations: |
||||
required: false |
||||
- type: textarea |
||||
attributes: |
||||
label: Maintainer CC |
||||
description: | |
||||
Please @ people who are in the `meta.maintainers` list of the offending module. |
||||
If in doubt, check `git blame` for whoever last touched something. |
||||
validations: |
||||
required: false |
||||
- type: textarea |
||||
id: system |
||||
attributes: |
||||
label: System information |
||||
description: | |
||||
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result. |
||||
render: markdown |
||||
validations: |
||||
required: true |
||||
|
@ -0,0 +1,75 @@ |
||||
# Configuration for probot-stale - https://github.com/probot/stale |
||||
daysUntilStale: 90 |
||||
daysUntilClose: 7 |
||||
staleLabel: "status: stale" |
||||
closeComment: false |
||||
issues: |
||||
markComment: | |
||||
<p> |
||||
Thank you for your contribution! |
||||
I marked this issue as stale due to inactivity. |
||||
If this remains inactive for another 7 days, I will close this issue. |
||||
<b>Please read the relevant sections below before commenting.</b> |
||||
</p> |
||||
|
||||
<details> |
||||
<summary><b>If you are the original author of the issue</b></summary> |
||||
<p> |
||||
|
||||
* If this is resolved, please consider closing it so that the maintainers know not to focus on this. |
||||
* If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. |
||||
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue. |
||||
|
||||
</p> |
||||
</details> |
||||
|
||||
<details> |
||||
<summary><b>If you are <i>not</i> the original author of the issue</b></summary> |
||||
<p> |
||||
|
||||
* If you are also experiencing this issue, please add details of your situation to help with the debugging process. |
||||
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue. |
||||
|
||||
</p> |
||||
</details> |
||||
|
||||
<details> |
||||
<summary><b>Memorandum on closing issues</b></summary> |
||||
<p> |
||||
If you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. |
||||
Also, don't be afraid to manually close an issue, even if it holds valuable information. |
||||
</p> |
||||
<p> |
||||
Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! |
||||
Closing obsolete issues is an important way to help maintainers focus their time and effort. |
||||
</p> |
||||
</details> |
||||
pulls: |
||||
markComment: | |
||||
<p> |
||||
Thank you for your contribution! |
||||
I marked this pull request as stale due to inactivity. |
||||
If this remains inactive for another 7 days, I will close this PR. |
||||
<b>Please read the relevant sections below before commenting.</b> |
||||
</p> |
||||
|
||||
<details> |
||||
<summary><b>If you are the original author of the PR</b></summary> |
||||
<p> |
||||
|
||||
* GitHub sometimes doesn't notify people who commented / reviewed a PR previously, when you (force) push commits. *If you have addressed the reviews* you can [officially ask for a review](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from those who commented to you or anyone else. |
||||
* If it is unfinished but you plan to finish it, please mark it as a draft. |
||||
* If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work. |
||||
* To get things rolling again, rebase the PR against the target branch and address valid comments. |
||||
|
||||
</p> |
||||
</details> |
||||
|
||||
<details> |
||||
<summary><b>If you are <i>not</i> the original author of the issue</b></summary> |
||||
<p> |
||||
|
||||
* If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR. |
||||
|
||||
</p> |
||||
</details> |
@ -0,0 +1 @@ |
||||
21.11 |
@ -1 +0,0 @@ |
||||
doc/contributing.adoc |
@ -1 +0,0 @@ |
||||
doc/faq.adoc |
@ -0,0 +1,17 @@ |
||||
.PHONY: all all-tests test format |
||||
NIXPKGS_REV := nixpkgs-unstable
|
||||
NIX_PATH := nixpkgs=https://github.com/NixOS/nixpkgs/archive/${NIXPKGS_REV}.tar.gz
|
||||
|
||||
all: all-tests |
||||
|
||||
all-tests: |
||||
$(MAKE) test TEST=all
|
||||
|
||||
test: |
||||
ifndef TEST |
||||
$(error Use 'make test TEST=<test_name>' to run desired test)
|
||||
endif |
||||
nix-shell --pure tests -I ${NIX_PATH} -A run.${TEST}
|
||||
|
||||
format: |
||||
./format
|
@ -1,24 +1,51 @@ |
||||
{ |
||||
description = "Home Manager for Nix"; |
||||
|
||||
outputs = { self, nixpkgs }: rec { |
||||
nixosModules.home-manager = import ./nixos; |
||||
|
||||
darwinModules.home-manager = import ./nix-darwin; |
||||
|
||||
lib = { |
||||
hm = import ./modules/lib { lib = nixpkgs.lib; }; |
||||
homeManagerConfiguration = { configuration, system, homeDirectory |
||||
, username, extraSpecialArgs ? { } |
||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages |
||||
, check ? true }@args: |
||||
import ./modules { |
||||
inherit pkgs check extraSpecialArgs; |
||||
configuration = { ... }: { |
||||
imports = [ configuration ]; |
||||
home = { inherit homeDirectory username; }; |
||||
outputs = { self, nixpkgs }: |
||||
let |
||||
# List of systems supported by home-manager binary |
||||
supportedSystems = nixpkgs.lib.platforms.unix; |
||||
|
||||
# Function to generate a set based on supported systems |
||||
forAllSystems = f: |
||||
nixpkgs.lib.genAttrs supportedSystems (system: f system); |
||||
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); |
||||
in rec { |
||||
nixosModules.home-manager = import ./nixos; |
||||
nixosModule = self.nixosModules.home-manager; |
||||
|
||||
darwinModules.home-manager = import ./nix-darwin; |
||||
darwinModule = self.darwinModules.home-manager; |
||||
|
||||
packages = forAllSystems (system: |
||||
let docs = import ./docs { pkgs = nixpkgsFor.${system}; }; |
||||
in { |
||||
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { }; |
||||
docs-html = docs.manual.html; |
||||
docs-manpages = docs.manPages; |
||||
docs-json = docs.options.json; |
||||
}); |
||||
|
||||
defaultPackage = |
||||
forAllSystems (system: self.packages.${system}.home-manager); |
||||
|
||||
lib = { |
||||
hm = import ./modules/lib { lib = nixpkgs.lib; }; |
||||
homeManagerConfiguration = { configuration, system, homeDirectory |
||||
, username, extraModules ? [ ], extraSpecialArgs ? { } |
||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages |
||||
, check ? true, stateVersion ? "20.09" }@args: |
||||
assert nixpkgs.lib.versionAtLeast stateVersion "20.09"; |
||||
|
||||
import ./modules { |
||||
inherit pkgs check extraSpecialArgs; |
||||
configuration = { ... }: { |
||||
imports = [ configuration ] ++ extraModules; |
||||
home = { inherit homeDirectory stateVersion username; }; |
||||
nixpkgs = { inherit (pkgs) config overlays; }; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
} |
||||
|
@ -0,0 +1,65 @@ |
||||
#!/bin/env fish |
||||
################################################## |
||||
|
||||
# « home-manager » command-line fish completion |
||||
# |
||||
# © 2021 "Ariel AxionL" <i at axionl dot me> |
||||
# |
||||
# MIT License |
||||
# |
||||
|
||||
################################################## |
||||
|
||||
### Functions |
||||
function __home_manager_generations --description "Get all generations" |
||||
for i in (home-manager generations) |
||||
set -l split (string split " " $i) |
||||
set -l gen_id $split[5] |
||||
set -l gen_datetime $split[1..2] |
||||
set -l gen_hash (string match -r '\w{32}' $i) |
||||
echo $gen_id\t$gen_datetime $gen_hash |
||||
end |
||||
end |
||||
|
||||
|
||||
### SubCommands |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "help" -d "Print home-manager help" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "edit" -d "Open the home configuration in $EDITOR" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "option" -d "Inspect configuration option" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "build" -d "Build configuration into result directory" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "instantiate" -d "Instantiate the configuration and print the resulting derivation" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "switch" -d "Build and activate configuration" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "generations" -d "List all home environment generations" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "packages" -d "List all packages installed in home-manager-path" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "news" -d "Show news entries in a pager" |
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "uninstall" -d "Remove Home Manager" |
||||
|
||||
complete -c home-manager -n "__fish_use_subcommand" -x -a "remove-generations" -d "Remove indicated generations" |
||||
complete -c home-manager -n "__fish_seen_subcommand_from remove-generations" -f -ka '(__home_manager_generations)' |
||||
|
||||
complete -c home-manager -n "__fish_use_subcommand" -x -a "expire-generations" -d "Remove generations older than TIMESTAMP" |
||||
|
||||
### Options |
||||
complete -c home-manager -F -s f -l "file" -d "The home configuration file" |
||||
complete -c home-manager -x -s A -d "Select an expression in the configuration file" |
||||
complete -c home-manager -F -s I -d "Add a path to the Nix expression search path" |
||||
complete -c home-manager -F -l "flake" -d "Use home-manager configuration at specified flake-uri" |
||||
complete -c home-manager -F -s b -d "Move existing files to new path rather than fail" |
||||
complete -c home-manager -f -s v -l "verbose" -d "Verbose output" |
||||
complete -c home-manager -f -s n -l "dry-run" -d "Do a dry run, only prints what actions would be taken" |
||||
complete -c home-manager -f -s h -l "help" -d "Print this help" |
||||
|
||||
complete -c home-manager -x -l "arg" -d "Override inputs passed to home-manager.nix" |
||||
complete -c home-manager -x -l "argstr" -d "Like --arg but the value is a string" |
||||
complete -c home-manager -x -l "cores" -d "Threads per job (e.g. -j argument to make)" |
||||
complete -c home-manager -x -l "debug" |
||||
complete -c home-manager -x -l "impure" |
||||
complete -c home-manager -f -l "keep-failed" -d "Keep temporary directory used by failed builds" |
||||
complete -c home-manager -f -l "keep-going" -d "Keep going in case of failed builds" |
||||
complete -c home-manager -x -s j -l "max-jobs" -d "Max number of build jobs in parallel" |
||||
complete -c home-manager -x -l "option" -d "Set Nix configuration option" |
||||
complete -c home-manager -x -l "builders" -d "Remote builders" |
||||
complete -c home-manager -f -l "show-trace" -d "Print stack trace of evaluation errors" |
||||
complete -c home-manager -f -l "substitute" |
||||
complete -c home-manager -f -l "no-substitute" |
||||
complete -c home-manager -f -l "no-out-link" |
@ -1,42 +1,44 @@ |
||||
{ runCommand, lib, bash, coreutils, findutils, gnused, less |
||||
{ runCommand, lib, bash, callPackage, coreutils, findutils, gnused, less |
||||
# used for pkgs.path for nixos-option |
||||
, pkgs |
||||
|
||||
# Extra path to Home Manager. If set then this path will be tried |
||||
# before `$HOME/.config/nixpkgs/home-manager` and |
||||
# `$HOME/.nixpkgs/home-manager`. |
||||
, path ? null |
||||
}: |
||||
# Extra path to Home Manager. If set then this path will be tried |
||||
# before `$HOME/.config/nixpkgs/home-manager` and |
||||
# `$HOME/.nixpkgs/home-manager`. |
||||
, path ? null }: |
||||
|
||||
let |
||||
|
||||
pathStr = if path == null then "" else path; |
||||
|
||||
in |
||||
nixos-option = pkgs.nixos-option or (callPackage |
||||
(pkgs.path + "/nixos/modules/installer/tools/nixos-option") { }); |
||||
|
||||
runCommand |
||||
"home-manager" |
||||
{ |
||||
preferLocalBuild = true; |
||||
allowSubstitutes = false; |
||||
meta = with lib; { |
||||
description = "A user environment configurator"; |
||||
maintainers = [ maintainers.rycee ]; |
||||
platforms = platforms.unix; |
||||
license = licenses.mit; |
||||
}; |
||||
} |
||||
'' |
||||
install -v -D -m755 ${./home-manager} $out/bin/home-manager |
||||
in runCommand "home-manager" { |
||||
preferLocalBuild = true; |
||||
allowSubstitutes = false; |
||||
meta = with lib; { |
||||
description = "A user environment configurator"; |
||||
maintainers = [ maintainers.rycee ]; |
||||
platforms = platforms.unix; |
||||
license = licenses.mit; |
||||
}; |
||||
} '' |
||||
install -v -D -m755 ${./home-manager} $out/bin/home-manager |
||||
|
||||
substituteInPlace $out/bin/home-manager \ |
||||
--subst-var-by bash "${bash}" \ |
||||
--subst-var-by coreutils "${coreutils}" \ |
||||
--subst-var-by findutils "${findutils}" \ |
||||
--subst-var-by gnused "${gnused}" \ |
||||
--subst-var-by less "${less}" \ |
||||
--subst-var-by HOME_MANAGER_PATH '${pathStr}' |
||||
substituteInPlace $out/bin/home-manager \ |
||||
--subst-var-by bash "${bash}" \ |
||||
--subst-var-by coreutils "${coreutils}" \ |
||||
--subst-var-by findutils "${findutils}" \ |
||||
--subst-var-by gnused "${gnused}" \ |
||||
--subst-var-by less "${less}" \ |
||||
--subst-var-by nixos-option "${nixos-option}" \ |
||||
--subst-var-by HOME_MANAGER_PATH '${pathStr}' |
||||
|
||||
install -D -m755 ${./completion.bash} \ |
||||
$out/share/bash-completion/completions/home-manager |
||||
install -D -m755 ${./completion.zsh} \ |
||||
$out/share/zsh/site-functions/_home-manager |
||||
'' |
||||
install -D -m755 ${./completion.bash} \ |
||||
$out/share/bash-completion/completions/home-manager |
||||
install -D -m755 ${./completion.zsh} \ |
||||
$out/share/zsh/site-functions/_home-manager |
||||
install -D -m755 ${./completion.fish} \ |
||||
$out/share/fish/vendor_completions.d/home-manager.fish |
||||
'' |
||||
|
@ -0,0 +1,106 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; |
||||
let |
||||
|
||||
cfg = config.i18n.inputMethod; |
||||
|
||||
gtk2Cache = pkgs.runCommandLocal "gtk2-immodule.cache" { |
||||
buildInputs = [ pkgs.gtk2 cfg.package ]; |
||||
} '' |
||||
mkdir -p $out/etc/gtk-2.0/ |
||||
GTK_PATH=${cfg.package}/lib/gtk-2.0/ \ |
||||
gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache |
||||
''; |
||||
|
||||
gtk3Cache = pkgs.runCommandLocal "gtk3-immodule.cache" { |
||||
buildInputs = [ pkgs.gtk3 cfg.package ]; |
||||
} '' |
||||
mkdir -p $out/etc/gtk-3.0/ |
||||
GTK_PATH=${cfg.package}/lib/gtk-3.0/ \ |
||||
gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache |
||||
''; |
||||
|
||||
in { |
||||
imports = |
||||
[ ./fcitx.nix ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ]; |
||||
|
||||
options.i18n = { |
||||
inputMethod = { |
||||
enabled = mkOption { |
||||
type = types.nullOr |
||||
(types.enum [ "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]); |
||||
default = null; |
||||
example = "fcitx"; |
||||
description = '' |
||||
Select the enabled input method. Input methods is a software to input |
||||
symbols that are not available on standard input devices. |
||||
</para><para> |
||||
Input methods are specially used to input Chinese, Japanese and Korean |
||||
characters. |
||||
</para><para> |
||||
Currently the following input methods are available in Home Manager: |
||||
|
||||
<variablelist> |
||||
<varlistentry> |
||||
<term><literal>fcitx</literal></term> |
||||
<listitem><para> |
||||
A customizable lightweight input method |
||||
extra input engines can be added using |
||||
<literal>i18n.inputMethod.fcitx.engines</literal>. |
||||
</para></listitem> |
||||
</varlistentry> |
||||
<varlistentry> |
||||
<term><literal>fcitx5</literal></term> |
||||
<listitem><para> |
||||
The next generation of fcitx, |
||||
addons (including engines, dictionaries, skins) can be added using |
||||
<literal>i18n.inputMethod.fcitx5.addons</literal>. |
||||
</para></listitem> |
||||
</varlistentry> |
||||
<varlistentry> |
||||
<term><literal>nabi</literal></term> |
||||
<listitem><para> |
||||
A Korean input method based on XIM. Nabi doesn't support Qt 5. |
||||
</para></listitem> |
||||
</varlistentry> |
||||
<varlistentry> |
||||
<term><literal>uim</literal></term> |
||||
<listitem><para> |
||||
The universal input method, is a library with a XIM bridge. |
||||
uim mainly support Chinese, Japanese and Korean. |
||||
</para></listitem> |
||||
</varlistentry> |
||||
<varlistentry> |
||||
<term><literal>hime</literal></term> |
||||
<listitem><para>An extremely easy-to-use input method framework.</para></listitem> |
||||
</varlistentry> |
||||
<varlistentry> |
||||
<term><literal>kime</literal></term> |
||||
<listitem><para>A Korean IME.</para></listitem> |
||||
</varlistentry> |
||||
</variablelist> |
||||
''; |
||||
}; |
||||
|
||||
package = mkOption { |
||||
internal = true; |
||||
type = types.nullOr types.path; |
||||
default = null; |
||||
description = '' |
||||
The input method method package. |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf (cfg.enabled != null) { |
||||
assertions = [ |
||||
(hm.assertions.assertPlatform "i18n.inputMethod" pkgs platforms.linux) |
||||
]; |
||||
|
||||
home.packages = [ cfg.package gtk2Cache gtk3Cache ]; |
||||
}; |
||||
|
||||
meta.maintainers = with lib; [ hm.maintainers.kranzes ]; |
||||
} |
@ -0,0 +1,50 @@ |
||||
{ 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: |
||||
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: "<literal>${name}</literal>") (attrNames enginesDrv)); |
||||
in "Enabled Fcitx engines. Available engines are: ${engines}."; |
||||
}; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") { |
||||
i18n.inputMethod.package = fcitxPackage; |
||||
|
||||
home.sessionVariables = { |
||||
GTK_IM_MODULE = "fcitx"; |
||||
QT_IM_MODULE = "fcitx"; |
||||
XMODIFIERS = "@im=fcitx"; |
||||
}; |
||||
|
||||
systemd.user.services.fcitx-daemon = { |
||||
Unit = { |
||||
Description = "Fcitx input method editor"; |
||||
PartOf = [ "graphical-session.desktop" ]; |
||||
}; |
||||
Service.ExecStart = "${fcitxPackage}/bin/fcitx"; |
||||
Install.WantedBy = [ "graphical-session.target" ]; |
||||
}; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,42 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
im = config.i18n.inputMethod; |
||||
cfg = im.fcitx5; |
||||
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; }; |
||||
in { |
||||
options = { |
||||
i18n.inputMethod.fcitx5 = { |
||||
addons = mkOption { |
||||
type = with types; listOf package; |
||||
default = [ ]; |
||||
example = literalExpression "with pkgs; [ fcitx5-rime ]"; |
||||
description = '' |
||||
Enabled Fcitx5 addons. |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf (im.enabled == "fcitx5") { |
||||
i18n.inputMethod.package = fcitx5Package; |
||||
|
||||
home.sessionVariables = { |
||||
GTK_IM_MODULE = "fcitx"; |
||||
QT_IM_MODULE = "fcitx"; |
||||
XMODIFIERS = "@im=fcitx"; |
||||
}; |
||||
|
||||
systemd.user.services.fcitx5-daemon = { |
||||
Unit = { |
||||
Description = "Fcitx5 input method editor"; |
||||
PartOf = [ "graphical-session.target" ]; |
||||
}; |
||||
Service.ExecStart = "${fcitx5Package}/bin/fcitx5"; |
||||
Install.WantedBy = [ "graphical-session.target" ]; |
||||
}; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; { |
||||
config = mkIf (config.i18n.inputMethod.enabled == "hime") { |
||||
i18n.inputMethod.package = pkgs.hime; |
||||
|
||||
home.sessionVariables = { |
||||
GTK_IM_MODULE = "hime"; |
||||
QT_IM_MODULE = "hime"; |
||||
XMODIFIERS = "@im=hime"; |
||||
}; |
||||
|
||||
systemd.user.services.hime-daemon = { |
||||
Unit = { |
||||
Description = "Hime input method editor"; |
||||
PartOf = [ "graphical-session.desktop" ]; |
||||
}; |
||||
Service.ExecStart = "${pkgs.hime}/bin/hime"; |
||||
Install.WantedBy = [ "graphical-session.target" ]; |
||||
}; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,58 @@ |
||||
{ config, pkgs, lib, generators, ... }: |
||||
with lib; |
||||
let |
||||
cfg = config.i18n.inputMethod.kime; |
||||
yamlFormat = pkgs.formats.yaml { }; |
||||
in { |
||||
options = { |
||||
i18n.inputMethod.kime = { |
||||
config = mkOption { |
||||
type = yamlFormat.type; |
||||
default = { }; |
||||
example = literalExpression '' |
||||
{ |
||||
daemon = { |
||||
modules = ["Xim" "Indicator"]; |
||||
}; |
||||
|
||||
indicator = { |
||||
icon_color = "White"; |
||||
}; |
||||
|
||||
engine = { |
||||
hangul = { |
||||
layout = "dubeolsik"; |
||||
}; |
||||
}; |
||||
} |
||||
''; |
||||
description = '' |
||||
kime configuration. Refer to |
||||
<link xlink:href="https://github.com/Riey/kime/blob/develop/docs/CONFIGURATION.md"/> |
||||
for details on supported values. |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "kime") { |
||||
i18n.inputMethod.package = pkgs.kime; |
||||
|
||||
home.sessionVariables = { |
||||
GTK_IM_MODULE = "kime"; |
||||
QT_IM_MODULE = "kime"; |
||||
XMODIFIERS = "@im=kime"; |
||||
}; |
||||
|
||||
xdg.configFile."kime/config.yaml".text = |
||||
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config); |
||||
|
||||
systemd.user.services.kime-daemon = { |
||||
Unit = { Description = "Kime input method editor"; }; |
||||
PartOf = [ "graphical-session.target" ]; |
||||
Service.ExecStart = "${pkgs.kime}/bin/kime"; |
||||
Install.WantedBy = [ "graphical-session.target" ]; |
||||
}; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; { |
||||
config = mkIf (config.i18n.inputMethod.enabled == "nabi") { |
||||
i18n.inputMethod.package = pkgs.nabi; |
||||
|
||||
home.sessionVariables = { |
||||
GTK_IM_MODULE = "nabi"; |
||||
QT_IM_MODULE = "nabi"; |
||||
XMODIFIERS = "@im=nabi"; |
||||
}; |
||||
|
||||
systemd.user.services.nabi-daemon = { |
||||
Unit = { |
||||
Description = "Nabi input method editor"; |
||||
PartOf = [ "graphical-session.desktop" ]; |
||||
}; |
||||
Service.ExecStart = "${pkgs.nabi}/bin/nabi"; |
||||
Install.WantedBy = [ "graphical-session.target" ]; |
||||
}; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,45 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let cfg = config.i18n.inputMethod.uim; |
||||
in { |
||||
options = { |
||||
|
||||
i18n.inputMethod.uim = { |
||||
toolbar = mkOption { |
||||
type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ]; |
||||
default = "gtk"; |
||||
example = "gtk-systray"; |
||||
description = '' |
||||
Selected UIM toolbar. |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "uim") { |
||||
i18n.inputMethod.package = pkgs.uim; |
||||
|
||||
home.sessionVariables = { |
||||
GTK_IM_MODULE = "uim"; |
||||
QT_IM_MODULE = "uim"; |
||||
XMODIFIERS = "@im=uim"; |
||||
}; |
||||
|
||||
systemd.user.services.uim-daemon = { |
||||
Unit = { |
||||
Description = "Uim input method editor"; |
||||
PartOf = [ "graphical-session.desktop" ]; |
||||
}; |
||||
Service.ExecStart = toString |
||||
(pkgs.writeShellScript "start-uim-xim-and-uim-toolbar" '' |
||||
${pkgs.uim}/bin/uim-xim & |
||||
${pkgs.uim}/bin/uim-toolbar-${cfg.toolbar} |
||||
''); |
||||
Install.WantedBy = [ "graphical-session.target" ]; |
||||
}; |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,14 @@ |
||||
{ lib }: |
||||
|
||||
{ |
||||
assertPlatform = module: pkgs: platforms: { |
||||
assertion = lib.elem pkgs.stdenv.hostPlatform.system platforms; |
||||
message = let |
||||
platformsStr = lib.concatStringsSep "\n" |
||||
(map (p: " - ${p}") (lib.sort (a: b: a < b) platforms)); |
||||
in '' |
||||
The module ${module} does not support your platform. It only supports |
||||
|
||||
${platformsStr}''; |
||||
}; |
||||
} |
@ -0,0 +1,73 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
|
||||
cfg = config.nixpkgs; |
||||
|
||||
# Copied from nixpkgs.nix. |
||||
isConfig = x: builtins.isAttrs x || builtins.isFunction x; |
||||
|
||||
# Copied from nixpkgs.nix. |
||||
optCall = f: x: if builtins.isFunction f then f x else f; |
||||
|
||||
# Copied from nixpkgs.nix. |
||||
mergeConfig = lhs_: rhs_: |
||||
let |
||||
lhs = optCall lhs_ { inherit pkgs; }; |
||||
rhs = optCall rhs_ { inherit pkgs; }; |
||||
in lhs // rhs // optionalAttrs (lhs ? packageOverrides) { |
||||
packageOverrides = pkgs: |
||||
optCall lhs.packageOverrides pkgs |
||||
// optCall (attrByPath [ "packageOverrides" ] ({ }) rhs) pkgs; |
||||
} // optionalAttrs (lhs ? perlPackageOverrides) { |
||||
perlPackageOverrides = pkgs: |
||||
optCall lhs.perlPackageOverrides pkgs |
||||
// optCall (attrByPath [ "perlPackageOverrides" ] ({ }) rhs) pkgs; |
||||
}; |
||||
|
||||
# Copied from nixpkgs.nix. |
||||
configType = mkOptionType { |
||||
name = "nixpkgs-config"; |
||||
description = "nixpkgs config"; |
||||
check = x: |
||||
let traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false; |
||||
in traceXIfNot isConfig; |
||||
merge = args: fold (def: mergeConfig def.value) { }; |
||||
}; |
||||
|
||||
# Copied from nixpkgs.nix. |
||||
overlayType = mkOptionType { |
||||
name = "nixpkgs-overlay"; |
||||
description = "nixpkgs overlay"; |
||||
check = builtins.isFunction; |
||||
merge = lib.mergeOneOption; |
||||
}; |
||||
|
||||
in { |
||||
meta.maintainers = with maintainers; [ thiagokokada ]; |
||||
|
||||
options.nixpkgs = { |
||||
config = mkOption { |
||||
default = null; |
||||
type = types.nullOr configType; |
||||
visible = false; |
||||
}; |
||||
|
||||
overlays = mkOption { |
||||
default = null; |
||||
type = types.nullOr (types.listOf overlayType); |
||||
visible = false; |
||||
}; |
||||
}; |
||||
|
||||
config = { |
||||
assertions = [{ |
||||
assertion = cfg.config == null || cfg.overlays == null; |
||||
message = '' |
||||
`nixpkgs` options are disabled when `home-manager.useGlobalPkgs` is enabled. |
||||
''; |
||||
}]; |
||||
}; |
||||
} |
@ -0,0 +1,183 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
desktopEntry = { |
||||
options = { |
||||
# Since this module uses the nixpkgs/pkgs/build-support/make-desktopitem function, |
||||
# our options and defaults follow its parameters, with the following exceptions: |
||||
|
||||
# `desktopName` on makeDesktopItem is controlled by `name`. |
||||
# This is what we'd commonly consider the name of the application. |
||||
# `name` on makeDesktopItem is controlled by this module's key in the attrset. |
||||
# This is the file's filename excluding ".desktop". |
||||
|
||||
# `extraEntries` on makeDesktopItem is controlled by `extraConfig`, |
||||
# and `extraDesktopEntries` by `settings`, |
||||
# to match what's commonly used by other home manager modules. |
||||
|
||||
# `startupNotify` on makeDesktopItem asks for "true" or "false" strings, |
||||
# for usability's sake we ask for a boolean. |
||||
|
||||
# `mimeType` and `categories` on makeDesktopItem ask for a string in the format "one;two;three;", |
||||
# for the same reason we ask for a list of strings. |
||||
|
||||
# Descriptions are taken from the desktop entry spec: |
||||
# https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys |
||||
|
||||
type = mkOption { |
||||
description = "The type of the desktop entry."; |
||||
default = "Application"; |
||||
type = types.enum [ "Application" "Link" "Directory" ]; |
||||
}; |
||||
|
||||
exec = mkOption { |
||||
description = "Program to execute, possibly with arguments."; |
||||
type = types.str; |
||||
}; |
||||
|
||||
icon = mkOption { |
||||
description = "Icon to display in file manager, menus, etc."; |
||||
type = types.nullOr types.str; |
||||
default = null; |
||||
}; |
||||
|
||||
comment = mkOption { |
||||
description = "Tooltip for the entry."; |
||||
type = types.nullOr types.str; |
||||
default = null; |
||||
}; |
||||
|
||||
terminal = mkOption { |
||||
description = "Whether the program runs in a terminal window."; |
||||
type = types.bool; |
||||
default = false; |
||||
}; |
||||
|
||||
name = mkOption { |
||||
description = "Specific name of the application."; |
||||
type = types.str; |
||||
}; |
||||
|
||||
genericName = mkOption { |
||||
description = "Generic name of the application."; |
||||
type = types.nullOr types.str; |
||||
default = null; |
||||
}; |
||||
|
||||
mimeType = mkOption { |
||||
description = "The MIME type(s) supported by this application."; |
||||
type = types.nullOr (types.listOf types.str); |
||||
default = null; |
||||
}; |
||||
|
||||
categories = mkOption { |
||||
description = |
||||
"Categories in which the entry should be shown in a menu."; |
||||
type = types.nullOr (types.listOf types.str); |
||||
default = null; |
||||
}; |
||||
|
||||
startupNotify = mkOption { |
||||
description = '' |
||||
If true, it is KNOWN that the application will send a "remove" |
||||
message when started with the <literal>DESKTOP_STARTUP_ID</literal> |
||||
environment variable set. If false, it is KNOWN that the application |
||||
does not work with startup notification at all.''; |
||||
type = types.nullOr types.bool; |
||||
default = null; |
||||
}; |
||||
|
||||
extraConfig = mkOption { |
||||
description = '' |
||||
Extra configuration. Will be appended to the end of the file and |
||||
may thus contain extra sections. |
||||
''; |
||||
type = types.lines; |
||||
default = ""; |
||||
}; |
||||
|
||||
settings = mkOption { |
||||
type = types.attrsOf types.string; |
||||
description = '' |
||||
Extra key-value pairs to add to the <literal>[Desktop Entry]</literal> section. |
||||
This may override other values. |
||||
''; |
||||
default = { }; |
||||
example = literalExpression '' |
||||
{ |
||||
Keywords = "calc;math"; |
||||
DBusActivatable = "false"; |
||||
} |
||||
''; |
||||
}; |
||||
|
||||
fileValidation = mkOption { |
||||
type = types.bool; |
||||
description = "Whether to validate the generated desktop file."; |
||||
default = true; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
#formatting helpers |
||||
ifNotNull = a: a': if a == null then null else a'; |
||||
stringBool = bool: if bool then "true" else "false"; |
||||
semicolonList = list: |
||||
(concatStringsSep ";" list) + ";"; # requires trailing semicolon |
||||
|
||||
#passes config options to makeDesktopItem in expected format |
||||
makeFile = name: config: |
||||
pkgs.makeDesktopItem { |
||||
name = name; |
||||
type = config.type; |
||||
exec = config.exec; |
||||
icon = config.icon; |
||||
comment = config.comment; |
||||
terminal = config.terminal; |
||||
desktopName = config.name; |
||||
genericName = config.genericName; |
||||
mimeType = ifNotNull config.mimeType (semicolonList config.mimeType); |
||||
categories = |
||||
ifNotNull config.categories (semicolonList config.categories); |
||||
startupNotify = |
||||
ifNotNull config.startupNotify (stringBool config.startupNotify); |
||||
extraEntries = config.extraConfig; |
||||
extraDesktopEntries = config.settings; |
||||
}; |
||||
in { |
||||
meta.maintainers = with maintainers; [ cwyc ]; |
||||
|
||||
options.xdg.desktopEntries = mkOption { |
||||
description = '' |
||||
Desktop Entries allow applications to be shown in your desktop environment's app launcher. </para><para> |
||||
You can define entries for programs without entries or override existing entries. </para><para> |
||||
See <link xlink:href="https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys" /> for more information on options. |
||||
''; |
||||
default = { }; |
||||
type = types.attrsOf (types.submodule desktopEntry); |
||||
example = literalExpression '' |
||||
{ |
||||
firefox = { |
||||
name = "Firefox"; |
||||
genericName = "Web Browser"; |
||||
exec = "firefox %U"; |
||||
terminal = false; |
||||
categories = [ "Application" "Network" "WebBrowser" ]; |
||||
mimeType = [ "text/html" "text/xml" ]; |
||||
}; |
||||
} |
||||
''; |
||||
}; |
||||
|
||||
config = mkIf (config.xdg.desktopEntries != { }) { |
||||
assertions = [ |
||||
(hm.assertions.assertPlatform "xdg.desktopEntries" pkgs platforms.linux) |
||||
]; |
||||
|
||||
home.packages = (map hiPrio # we need hiPrio to override existing entries |
||||
(attrsets.mapAttrsToList makeFile config.xdg.desktopEntries)); |
||||
}; |
||||
|
||||
} |
@ -0,0 +1,61 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
|
||||
cfg = config.xdg.systemDirs; |
||||
|
||||
configDirs = concatStringsSep ":" cfg.config; |
||||
|
||||
dataDirs = concatStringsSep ":" cfg.data; |
||||
|
||||
in { |
||||
meta.maintainers = with maintainers; [ tadfisher ]; |
||||
|
||||
options.xdg.systemDirs = { |
||||
config = mkOption { |
||||
type = types.listOf types.str; |
||||
default = [ ]; |
||||
example = literalExpression ''[ "/etc/xdg" ]''; |
||||
description = '' |
||||
Directory names to add to <envar>XDG_CONFIG_DIRS</envar> |
||||
in the user session. |
||||
''; |
||||
}; |
||||
|
||||
data = mkOption { |
||||
type = types.listOf types.str; |
||||
default = [ ]; |
||||
example = literalExpression ''[ "/usr/share" "/usr/local/share" ]''; |
||||
description = '' |
||||
Directory names to add to <envar>XDG_DATA_DIRS</envar> |
||||
in the user session. |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
config = mkMerge [ |
||||
(mkIf (cfg.config != [ ] || cfg.data != [ ]) { |
||||
assertions = [ |
||||
(hm.assertions.assertPlatform "xdg.systemDirs" pkgs platforms.linux) |
||||
]; |
||||
}) |
||||
|
||||
(mkIf (cfg.config != [ ]) { |
||||
home.sessionVariables.XDG_CONFIG_DIRS = |
||||
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; |
||||
|
||||
systemd.user.sessionVariables.XDG_CONFIG_DIRS = |
||||
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; |
||||
}) |
||||
|
||||
(mkIf (cfg.data != [ ]) { |
||||
home.sessionVariables.XDG_DATA_DIRS = |
||||
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"; |
||||
|
||||
systemd.user.sessionVariables.XDG_DATA_DIRS = |
||||
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"; |
||||
}) |
||||
]; |
||||
} |
@ -0,0 +1,90 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
|
||||
cfg = config.programs.atuin; |
||||
|
||||
tomlFormat = pkgs.formats.toml { }; |
||||
|
||||
in { |
||||
meta.maintainers = [ maintainers.hawkw ]; |
||||
|
||||
options.programs.atuin = { |
||||
enable = mkEnableOption "atuin"; |
||||
|
||||
package = mkOption { |
||||
type = types.package; |
||||
default = pkgs.atuin; |
||||
defaultText = literalExpression "pkgs.atuin"; |
||||
description = "The package to use for atuin."; |
||||
}; |
||||
|
||||
enableBashIntegration = mkOption { |
||||
type = types.bool; |
||||
default = true; |
||||
description = '' |
||||
Whether to enable Atuin's Bash integration. This will bind |
||||
<literal>ctrl-r</literal> to open the Atuin history. |
||||
''; |
||||
}; |
||||
|
||||
enableZshIntegration = mkEnableOption "Zsh integration" // { |
||||
default = true; |
||||
description = '' |
||||
Whether to enable Atuin's Zsh integration. |
||||
</para><para> |
||||
If enabled, this will bind <literal>ctrl-r</literal> and the up-arrow |
||||
key to open the Atuin history. |
||||
''; |
||||
}; |
||||
|
||||
settings = mkOption { |
||||
type = with types; |
||||
let |
||||
prim = oneOf [ bool int str ]; |
||||
primOrPrimAttrs = either prim (attrsOf prim); |
||||
entry = either prim (listOf primOrPrimAttrs); |
||||
entryOrAttrsOf = t: either entry (attrsOf t); |
||||
entries = entryOrAttrsOf (entryOrAttrsOf entry); |
||||
in attrsOf entries // { description = "Atuin configuration"; }; |
||||
default = { }; |
||||
example = literalExpression '' |
||||
{ |
||||
auto_sync = true; |
||||
sync_frequency = "5m"; |
||||
sync_address = "https://api.atuin.sh"; |
||||
search_mode = "prefix"; |
||||
} |
||||
''; |
||||
description = '' |
||||
Configuration written to |
||||
<filename>~/.config/atuin/config.toml</filename>. |
||||
</para><para> |
||||
See <link xlink:href="https://github.com/ellie/atuin/blob/main/docs/config.md" /> for the full list |
||||
of options. |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
|
||||
# Always add the configured `atuin` package. |
||||
home.packages = [ cfg.package ]; |
||||
|
||||
# If there are user-provided settings, generate the config file. |
||||
xdg.configFile."atuin/config.toml" = mkIf (cfg.settings != { }) { |
||||
source = tomlFormat.generate "atuin-config" cfg.settings; |
||||
}; |
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration '' |
||||
source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh" |
||||
eval "$(${cfg.package}/bin/atuin init bash)" |
||||
''; |
||||
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' |
||||
eval "$(${cfg.package}/bin/atuin init zsh)" |
||||
''; |
||||
}; |
||||
} |
@ -0,0 +1,66 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
|
||||
cfg = config.programs.bottom; |
||||
|
||||
tomlFormat = pkgs.formats.toml { }; |
||||
|
||||
configDir = if pkgs.stdenv.isDarwin then |
||||
"Library/Application Support" |
||||
else |
||||
config.xdg.configHome; |
||||
|
||||
in { |
||||
options = { |
||||
programs.bottom = { |
||||
enable = mkEnableOption '' |
||||
bottom, a cross-platform graphical process/system monitor with a |
||||
customizable interface''; |
||||
|
||||
package = mkOption { |
||||
type = types.package; |
||||
default = pkgs.bottom; |
||||
defaultText = literalExpression "pkgs.bottom"; |
||||
description = "Package providing <command>bottom</command>."; |
||||
}; |
||||
|
||||
settings = mkOption { |
||||
type = tomlFormat.type; |
||||
default = { }; |
||||
description = '' |
||||
Configuration written to |
||||
<filename>$XDG_CONFIG_HOME/bottom/bottom.toml</filename> on Linux or |
||||
<filename>$HOME/Library/Application Support/bottom/bottom.toml</filename> on Darwin. |
||||
</para><para> |
||||
See <link xlink:href="https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml"/> |
||||
for the default configuration. |
||||
''; |
||||
example = literalExpression '' |
||||
{ |
||||
flags = { |
||||
avg_cpu = true; |
||||
temperature_type = "c"; |
||||
}; |
||||
|
||||
colors = { |
||||
low_battery_color = "red"; |
||||
}; |
||||
} |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
home.packages = [ cfg.package ]; |
||||
|
||||
home.file."${configDir}/bottom/bottom.toml" = mkIf (cfg.settings != { }) { |
||||
source = tomlFormat.generate "bottom.toml" cfg.settings; |
||||
}; |
||||
}; |
||||
|
||||
meta.maintainers = [ maintainers.polykernel ]; |
||||
} |
@ -0,0 +1,36 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
|
||||
cfg = config.programs.exa; |
||||
|
||||
aliases = { |
||||
ls = "${pkgs.exa}/bin/exa"; |
||||
ll = "${pkgs.exa}/bin/exa -l"; |
||||
la = "${pkgs.exa}/bin/exa -a"; |
||||
lt = "${pkgs.exa}/bin/exa --tree"; |
||||
lla = "${pkgs.exa}/bin/exa -la"; |
||||
}; |
||||
|
||||
in { |
||||
meta.maintainers = [ maintainers.kalhauge ]; |
||||
|
||||
options.programs.exa = { |
||||
enable = |
||||
mkEnableOption "exa, a modern replacement for <command>ls</command>"; |
||||
enableAliases = mkEnableOption "recommended exa aliases"; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
home.packages = [ pkgs.exa ]; |
||||
|
||||
programs.bash.shellAliases = mkIf cfg.enableAliases aliases; |
||||
|
||||
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases; |
||||
|
||||
programs.fish.shellAliases = mkIf cfg.enableAliases aliases; |
||||
|
||||
}; |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue