mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
environment.motd: add option
This commit is contained in:
parent
a99c1e0416
commit
ffac515cfb
3 changed files with 56 additions and 40 deletions
|
|
@ -19,6 +19,8 @@
|
|||
* In an effort to reduce the number of arguments to `lib.nixOnDroidConfiguration`
|
||||
function in flake configurations, `system` is now inferred from `pkgs.system`
|
||||
and `config` and `extraModules` are now combined into `modules`
|
||||
* Add option `environment.motd` to edit the startup message that is printed in
|
||||
every shell
|
||||
|
||||
## Release 22.05
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ writeText "login-inner" ''
|
|||
|
||||
set -eo pipefail
|
||||
|
||||
${lib.optionalString (config.environment.motd != null) ''
|
||||
if [ "$#" -eq 0 ]; then # if script is called from within nix-on-droid app
|
||||
echo "Welcome to Nix-on-Droid!"
|
||||
echo "If nothing works, open an issue at https://github.com/t184256/nix-on-droid/issues or try the rescue shell."
|
||||
echo "${lib.removeSuffix "\n" config.environment.motd}"
|
||||
fi
|
||||
''}
|
||||
|
||||
${lib.optionalString config.build.initialBuild ''
|
||||
if [ -e /etc/UNINTIALISED ]; then
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
|
|
@ -49,7 +49,19 @@ in
|
|||
|
||||
options = {
|
||||
|
||||
environment.sessionVariables = mkOption {
|
||||
environment = {
|
||||
motd = mkOption {
|
||||
default = ''
|
||||
Welcome to Nix-on-Droid!
|
||||
If nothing works, open an issue at https://github.com/t184256/nix-on-droid/issues or try the rescue shell.
|
||||
'';
|
||||
type = types.nullOr types.lines;
|
||||
description = ''
|
||||
Text to show on every new shell created by nix-on-droid.
|
||||
'';
|
||||
};
|
||||
|
||||
sessionVariables = mkOption {
|
||||
default = { };
|
||||
type = types.attrs;
|
||||
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
|
||||
|
|
@ -85,6 +97,7 @@ in
|
|||
</programlisting>
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue