2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2010-03-11 17:02:57 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2021-01-17 20:14:59 +00:00
|
|
|
gnu = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2010-03-11 17:02:57 +00:00
|
|
|
default = false;
|
2016-12-16 16:58:40 +00:00
|
|
|
description = ''
|
|
|
|
When enabled, GNU software is chosen by default whenever a there is
|
|
|
|
a choice between GNU and non-GNU software (e.g., GNU lsh
|
|
|
|
vs. OpenSSH).
|
|
|
|
'';
|
2010-03-11 17:02:57 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-17 20:14:59 +00:00
|
|
|
config = lib.mkIf config.gnu {
|
2010-03-11 17:02:57 +00:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs;
|
|
|
|
# TODO: Adjust `requiredPackages' from `system-path.nix'.
|
|
|
|
# TODO: Add Inetutils once it has the new `ifconfig'.
|
2012-04-24 13:54:42 +01:00
|
|
|
[ parted
|
|
|
|
#fdisk # XXX: GNU fdisk currently fails to build and it's redundant
|
|
|
|
# with the `parted' command.
|
2010-03-11 17:02:57 +00:00
|
|
|
nano zile
|
|
|
|
texinfo # for the stand-alone Info reader
|
2011-01-29 23:07:06 +00:00
|
|
|
]
|
2021-01-17 20:14:59 +00:00
|
|
|
++ lib.optional (!stdenv.isAarch32) grub2;
|
2010-03-11 17:02:57 +00:00
|
|
|
|
2011-01-29 23:07:06 +00:00
|
|
|
|
|
|
|
# GNU GRUB, where available.
|
treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.
The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:
```
ISA: ARMv8 {-A, -R, -M}
/ \
Mode: Aarch32 Aarch64
| / \
Encoding: A64 A32 T32
```
At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.
The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.
[1]: https://developer.arm.com/products/architecture/a-profile
2018-03-20 02:41:06 +00:00
|
|
|
boot.loader.grub.enable = !pkgs.stdenv.isAarch32;
|
2010-03-11 17:02:57 +00:00
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
|
2016-08-23 16:32:41 +01:00
|
|
|
# GNU lsh.
|
|
|
|
services.openssh.enable = false;
|
|
|
|
services.lshd.enable = true;
|
|
|
|
programs.ssh.startAgent = false;
|
|
|
|
services.xserver.startGnuPGAgent = true;
|
|
|
|
|
2010-03-11 17:02:57 +00:00
|
|
|
# TODO: GNU dico.
|
|
|
|
# TODO: GNU Inetutils' inetd.
|
|
|
|
# TODO: GNU Pies.
|
|
|
|
};
|
|
|
|
}
|