examples: init

This commit is contained in:
matthewcroughan 2022-07-13 07:45:04 +01:00
parent d04dbc0feb
commit c58d08725f
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
let
welcomeMessage = "visionfive-nix";
xtermWelcomeScript = pkgs.writeScript "xterm-visionfive-welcome.sh" ''
${pkgs.figlet}/bin/figlet -c ${welcomeMessage}
${pkgs.neofetch}/bin/neofetch
sh
'';
in
{
hardware.opengl.enable = true;
services.cage = {
enable = true;
user = "default";
program = "${pkgs.xterm}/bin/xterm -fa 'Monospace' -fs 14 -bg black -fg white -e sh -c '${xtermWelcomeScript}'";
};
}

View File

@ -0,0 +1,10 @@
{
programs = {
sway.enable = true;
bash.loginShellInit = ''
if [[ "$(tty)" == /dev/tty1 ]]; then
exec sway &> /dev/null
fi
'';
};
}

18
examples/mosquitto.nix Normal file
View File

@ -0,0 +1,18 @@
{
networking.firewall.allowedTCPPorts = [ 1883 ];
services.mosquitto = {
enable = true;
settings.max_keepalive = 300;
listeners = [
{
port = 1883;
omitPasswordAuth = true;
users = {};
settings = {
allow_anonymous = true;
};
acl = [ "topic readwrite #" ];
}
];
};
}