From dcb1e1798248ad1a6f793e41ebd09fac03c3af46 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Tue, 29 Dec 2020 16:21:22 -0500 Subject: [PATCH] status-on-console: convert to module --- default.nix | 4 +--- .../default.nix => status-on-console.nix} | 12 +++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) rename modules/{status-on-console/default.nix => status-on-console.nix} (68%) diff --git a/default.nix b/default.nix index 71a5d0c..6871d88 100644 --- a/default.nix +++ b/default.nix @@ -12,8 +12,6 @@ in scroll-boost = mkEnableOption "Patch libinput scroll speed"; - status-on-console = mkEnableOption "Display Neofetch on system console"; - }; config = mkMerge [ @@ -32,7 +30,6 @@ in ])) (mkIf cfg.scroll-boost (import ./modules/scroll-boost { })) - (mkIf cfg.status-on-console (import ./modules/status-on-console { inherit pkgs; })) ]; @@ -40,5 +37,6 @@ in ./modules/alacritty.nix ./modules/baseline.nix ./modules/cli.nix + ./modules/status-on-console.nix ]; } diff --git a/modules/status-on-console/default.nix b/modules/status-on-console.nix similarity index 68% rename from modules/status-on-console/default.nix rename to modules/status-on-console.nix index c5aee7f..0b14ebf 100644 --- a/modules/status-on-console/default.nix +++ b/modules/status-on-console.nix @@ -1,5 +1,7 @@ -{ pkgs, ... }: +{ config, pkgs, lib, ... }: let + cfg = config.sconfig.status-on-console; + ncfg = pkgs.writeText "neofetch.conf" '' print_info() { info title @@ -33,6 +35,10 @@ let in { - environment.etc.issue.source = pkgs.lib.mkForce "/run/issue"; - systemd.services."getty@".serviceConfig.ExecStartPre = "-${nscript}"; + options.sconfig.status-on-console = lib.mkEnableOption "Display Neofetch on system console"; + + config = lib.mkIf cfg { + environment.etc.issue.source = pkgs.lib.mkForce "/run/issue"; + systemd.services."getty@".serviceConfig.ExecStartPre = "-${nscript}"; + }; }