Skip to content

Add system-wise kbd search path - #16642

Merged
abbradar merged 4 commits into
NixOS:stagingfrom
abbradar:kbd-paths
Jul 8, 2016
Merged

abbradar merged 4 commits into
NixOS:stagingfrom
abbradar:kbd-paths

Conversation

@abbradar

@abbradar abbradar commented Jul 1, 2016

Copy link
Copy Markdown
Member
Motivation for this change

This improves usability of custom console fonts, keymaps etc. -- things that are set by kbd package. We now add /run/current-system/sw/share to search path for all its resources -- which means that instead of patching new keymaps into kbd or specifying a console font like this:

i18n.consoleFont = "${pkgs.terminus_font}/share/consolefonts/ter-v16n.psf.gz";

You can do it like this:

environment.systemPackages = [ pkgs.terminus_font ];
i18n.consoleFont = "ter-v16n";
Things done
  • Tested using sandboxing
    (nix.useChroot on NixOS,
    or option build-use-chroot in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@abbradar abbradar added 0.kind: enhancement Add something new or improve an existing system. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 1.severity: mass-rebuild labels Jul 1, 2016
@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @Mayeu, @aszlig and @wkennington to be potential reviewers

@abbradar abbradar changed the title Kbd paths Add system path to kbd search paths Jul 1, 2016
Comment thread pkgs/os-specific/linux/kbd/default.nix Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing patch file?

@edolstra

edolstra commented Jul 1, 2016

Copy link
Copy Markdown
Member

Doesn't this mean that any change to the system path triggers (or should trigger) a reload of systemd-vconsole-setup? That seems undesirable.

@abbradar

abbradar commented Jul 1, 2016

Copy link
Copy Markdown
Member Author

Hm, indeed, sounds not nice. I can instead move console fonts to a dedicated buildEnv-linked path. Where can I add such a path? I consider /run/current-system/kbd now.

@abbradar

abbradar commented Jul 1, 2016

Copy link
Copy Markdown
Member Author

After more investigation, adding it to current-system would require modifying activation/top-level.nix for just kbd (which I don't like). I can also use /etc/kbd or something but I don't like to link to data directories in /etc. Any other ideas?

@abbradar
abbradar force-pushed the kbd-paths branch 2 times, most recently from 5cd1642 to 749a3d3 Compare July 3, 2016 00:36
@abbradar

abbradar commented Jul 3, 2016 •

Copy link
Copy Markdown
Member Author

New changeset:

  1. Use /etc/kbd as the system-wise location for kbd resources;
  2. Add i18n.consolePackages to populate it;
  3. Set current pre-installed keymaps (dvorak and neo) as default for i18n.consolePackages for backwards compatibility. When one sets this new option it's expected from her to also add needed layouts.

Tested with terminus_font in a VM.

EDIT: an example:

  i18n.consolePackages = [ pkgs.terminus_font ];
  i18n.consoleFont = "ter-v20n";

@abbradar abbradar changed the title Add system path to kbd search paths Add system-wise kbd search path Jul 3, 2016
@abbradar

abbradar commented Jul 5, 2016 •

Copy link
Copy Markdown
Member Author

I'm having second thoughts on using /etc for resource files, but will merge in a few days if everyone is ok with it.

EDIT to clarify: it would be cool to have a better idea where to put those, I just don't have any.

@abbradar abbradar mentioned this pull request Jul 7, 2016
4 of 7 tasks
Comment thread nixos/modules/tasks/kbd.nix Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use environment.etc."vconsole.conf".source = vconsoleConf. The list syntax is basically obsolete.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

@abbradar
abbradar merged commit c89843b into NixOS:staging Jul 8, 2016
abbradar added a commit that referenced this pull request Jul 8, 2016
@Profpatsch

Copy link
Copy Markdown
Member

@abbradar
This completely killed neo (and the kbd build).

I’m not sure how you tested it, but meh, it seems not enough. :(

@abbradar

Copy link
Copy Markdown
Member Author

Hm, I've tested it in a VM with Dvorak layout enabled. Let me see...

@Profpatsch

Profpatsch commented Jul 18, 2016 •

Copy link
Copy Markdown
Member

Dvorak layout

Would be nice to have 1st class support for neo as well (that’s how it was intended, after all).
It’s very nice to be able to just use a sane keyboard layout (that is standardized) with loadkeys.

@abbradar

Copy link
Copy Markdown
Member Author

Of course, it was just an example. I have an idea of what happens -- stay tuned for a fix. And I'm very sorry for this problem!

@Profpatsch

Copy link
Copy Markdown
Member

And I'm very sorry for this problem!

No problem. Move fast and break things!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants