mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 02:37:09 +00:00
programs-info: add module and run install-info on system packages.
Fixes #25
This commit is contained in:
parent
cee2bb93cc
commit
d5596d5df2
3 changed files with 43 additions and 2 deletions
|
@ -47,6 +47,7 @@ let
|
|||
./modules/programs/bash.nix
|
||||
./modules/programs/fish.nix
|
||||
./modules/programs/man.nix
|
||||
./modules/programs/info
|
||||
./modules/programs/nix-script.nix
|
||||
./modules/programs/tmux.nix
|
||||
./modules/programs/vim.nix
|
||||
|
|
|
@ -43,6 +43,12 @@ in {
|
|||
description = "A list of profiles used to setup the global environment.";
|
||||
};
|
||||
|
||||
environment.postBuild = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Commands to execute when building the global environment.";
|
||||
};
|
||||
|
||||
environment.extraOutputsToInstall = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
|
@ -125,7 +131,6 @@ in {
|
|||
environment.pathsToLink =
|
||||
[ "/bin"
|
||||
"/lib"
|
||||
"/share/info"
|
||||
"/share/locale"
|
||||
];
|
||||
|
||||
|
@ -146,7 +151,7 @@ in {
|
|||
system.path = pkgs.buildEnv {
|
||||
name = "system-path";
|
||||
paths = cfg.systemPackages;
|
||||
inherit (cfg) pathsToLink extraOutputsToInstall;
|
||||
inherit (cfg) postBuild pathsToLink extraOutputsToInstall;
|
||||
};
|
||||
|
||||
system.build.setEnvironment = concatStringsSep "\n" exportVariables;
|
||||
|
|
35
modules/programs/info/default.nix
Normal file
35
modules/programs/info/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.info;
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
programs.info.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable info pages and the <command>info</command> command.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.texinfoInteractive ];
|
||||
|
||||
environment.pathsToLink = [ "/info" "/share/info" ];
|
||||
environment.extraOutputsToInstall = [ "info" ];
|
||||
|
||||
environment.postBuild = ''
|
||||
if test -w $out/share/info; then
|
||||
shopt -s nullglob
|
||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||
${pkgs.texinfoInteractive}/bin/install-info $i $out/share/info/dir
|
||||
done
|
||||
fi
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue