Commit 966c6160 authored by Samuel Laurén's avatar Samuel Laurén
Browse files

Initial commit

parents
{ config, pkgs, lib, ... }:
{
nix.maxJobs = lib.mkDefault 2;
fileSystems."/" =
{ device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
boot = {
initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "sd_mod" ];
kernelModules = [ ];
extraModulePackages = [ ];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
};
swapDevices = [ { device = "/dev/disks/by-label/swap"; } ];
powerManagement.enable = false;
networking = {
interfaces.enp9s0.macAddress = "00:1c:c0:c8:71:69";
hostName = "coffeecam";
wireless.enable = false;
};
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "fi";
defaultLocale = "en_US.UTF-8";
};
time.timeZone = "Europe/Helsinki";
environment.systemPackages = with pkgs; [
git
ffmpeg
dejavu_fonts
];
programs.bash.enableCompletion = true;
services.openssh = {
enable = true;
passwordAuthentication = false;
};
users.extraUsers.coffeecam = {
isNormalUser = true;
uid = 1000;
};
users.users.coffeecam.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAe0DzM/LknI0iCLYukQNOr4auToVmePbIHYkHm8BupC"
];
systemd.user.services.coffeecam = {
description = "CoffeeCam transmission";
serviceConfig = {
ExecStart = lib.replaceString ["\n"] [" "] ''
ffmpeg
-y
-r 15
-s 640x480
-f video4linux2
-i /dev/v4l/by-id/usb-Generic_USB2.0_PC_CAMERA-video-index0
-pix_fmt yuv420p
-vcodec mpeg4
-r 15
-f rtp_mpegts
-vf 'hflip,rotate=PI/2/180*70,drawtext=fontsize=15:fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:rate=1/2:text=%{localtime}:fontsize=11:fontcolor='white':boxcolor=0x00000099:box=1:x=320-text_w/2:y=480-text_h'
-threads 2
-r 15 rtp://130.232.103.36:2222
-r 15
-f image2
-r 1/5
-qscale:v 4
-updatefirst 1
-vf "hflip,rotate=PI/2/180*70"
/dev/shm/img.jpg
'';
Restart = "on-failure";
};
wantedBy = [ "default.target" ];
};
system.stateVersion = "17.09";
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment