aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/ru/rust-motd
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/ru/rust-motd')
-rw-r--r--modules/by-name/ru/rust-motd/module.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/by-name/ru/rust-motd/module.nix b/modules/by-name/ru/rust-motd/module.nix
index a6998f4..7f3b44f 100644
--- a/modules/by-name/ru/rust-motd/module.nix
+++ b/modules/by-name/ru/rust-motd/module.nix
@@ -19,6 +19,13 @@
|| v.openssh.authorizedKeys.keyFiles != []
);
userList = builtins.mapAttrs (n: v: 2) (lib.filterAttrs pred config.users.users);
+
+ bannerFile =
+ pkgs.runCommandNoCCLocal "banner-file" {
+ nativeBuildInputs = [pkgs.figlet];
+ } ''
+ echo "${config.system.name}" | figlet -f slant > "$out"
+ '';
in {
options.vhack.rust-motd = {
enable = lib.mkEnableOption "rust-motd";
@@ -49,10 +56,8 @@ in {
banner = {
color = "red";
- command = "${pkgs.hostname}/bin/hostname | ${pkgs.figlet}/bin/figlet -f slant";
- # if you don't want a dependency on figlet, you can generate your
- # banner however you want, put it in a file, and then use something like:
- # command = "cat banner.txt"
+ # Avoid some runtime dependencies.
+ command = "cat ${bannerFile}";
};
uptime = {