feat: extract tuigreet and workstation modules
This commit is contained in:
39
modules/nixos/tuigreet.nix
Normal file
39
modules/nixos/tuigreet.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.tuigreet;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
tuigreet = {
|
||||
enable = lib.mkEnableOption "greetd with tuigreet";
|
||||
|
||||
command = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Session command to launch";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
useTextGreeter = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = builtins.toString (
|
||||
pkgs.writeShellScript "tuigreet-session" ''
|
||||
${pkgs.util-linux}/bin/setterm --blank 1 --powersave powerdown --powerdown 1
|
||||
exec ${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd ${cfg.command}
|
||||
''
|
||||
);
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
32
modules/nixos/workstation.nix
Normal file
32
modules/nixos/workstation.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.workstation;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
workstation = {
|
||||
enable = lib.mkEnableOption "workstation utilities";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
logDriver = "json-file";
|
||||
};
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "both";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
smartmontools
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user