status-on-console: convert to module

This commit is contained in:
Sean Buckley 2020-12-29 16:21:22 -05:00
parent 40fc860b6e
commit dcb1e17982
2 changed files with 10 additions and 6 deletions

View file

@ -12,8 +12,6 @@ in
scroll-boost = mkEnableOption "Patch libinput scroll speed"; scroll-boost = mkEnableOption "Patch libinput scroll speed";
status-on-console = mkEnableOption "Display Neofetch on system console";
}; };
config = mkMerge [ config = mkMerge [
@ -32,7 +30,6 @@ in
])) ]))
(mkIf cfg.scroll-boost (import ./modules/scroll-boost { })) (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/alacritty.nix
./modules/baseline.nix ./modules/baseline.nix
./modules/cli.nix ./modules/cli.nix
./modules/status-on-console.nix
]; ];
} }

View file

@ -1,5 +1,7 @@
{ pkgs, ... }: { config, pkgs, lib, ... }:
let let
cfg = config.sconfig.status-on-console;
ncfg = pkgs.writeText "neofetch.conf" '' ncfg = pkgs.writeText "neofetch.conf" ''
print_info() { print_info() {
info title info title
@ -33,6 +35,10 @@ let
in in
{ {
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"; environment.etc.issue.source = pkgs.lib.mkForce "/run/issue";
systemd.services."getty@".serviceConfig.ExecStartPre = "-${nscript}"; systemd.services."getty@".serviceConfig.ExecStartPre = "-${nscript}";
};
} }