Compare commits
3 Commits
721b6e0ab8
...
15d9a39349
Author | SHA1 | Date | |
---|---|---|---|
15d9a39349
|
|||
c589766673
|
|||
24f943410a
|
20
flake.lock
generated
20
flake.lock
generated
@@ -490,11 +490,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1722372011,
|
||||
"narHash": "sha256-B2xRiC3NEJy/82ugtareBkRqEkPGpMyjaLxaR8LBxNs=",
|
||||
"lastModified": 1722519197,
|
||||
"narHash": "sha256-VEdJmVU2eLFtLqCjTYJd1J7+Go8idAcZoT11IewFiRg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cf05eeada35e122770c5c14add958790fcfcbef5",
|
||||
"rev": "05405724efa137a0b899cce5ab4dde463b4fd30b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -541,11 +541,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722626928,
|
||||
"narHash": "sha256-qr1ylMvSPC7DviCbGtcd4WtbfMcQQY0eAWI1c1YiR0Q=",
|
||||
"lastModified": 1722693897,
|
||||
"narHash": "sha256-Gpa3Gf60AqshNJKUP5mAmVImFFQ6BsWG+zbqx0JGFD4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "0f74ec3c3768a42cba04d8d84b65c62c815f804e",
|
||||
"rev": "b17a2666bcf400cf245528d143597d1480e298f8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -576,11 +576,11 @@
|
||||
"secrets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1720459643,
|
||||
"narHash": "sha256-X71/NplPXPe9pCvrd9ELpnYBEYtju4+x3LA7S5I1GXM=",
|
||||
"lastModified": 1722712220,
|
||||
"narHash": "sha256-gEmbk/DROfVZ+v/BAZHDloHzS0KdqIzxtW7z9g2eH4Y=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "f8d68b934f4380ecbc6365b4ef7f7c632833d1aa",
|
||||
"revCount": 21,
|
||||
"rev": "dfe0e95be5ef539bf28602ff47beeea26cc4d1b8",
|
||||
"revCount": 22,
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
||||
},
|
||||
|
@@ -104,6 +104,7 @@
|
||||
mail = mkNixosSystem { system = "x86_64-linux"; name = "mail"; };
|
||||
odyssey = mkNixosSystem { system = "x86_64-linux"; name = "odyssey"; };
|
||||
pi = mkNixosSystem { system = "aarch64-linux"; name = "pi"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; };
|
||||
skycam = mkNixosSystem { system = "aarch64-linux"; name = "skycam"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; };
|
||||
vps1 = mkNixosSystem { system = "x86_64-linux"; name = "vps1"; };
|
||||
};
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
time.timeZone = "Europe/London";
|
||||
@@ -15,7 +15,7 @@
|
||||
LC_TELEPHONE = "en_GB.UTF-8";
|
||||
LC_TIME = "en_GB.UTF-8";
|
||||
};
|
||||
|
||||
|
||||
console.keyMap = "uk";
|
||||
|
||||
security.sudo.execWheelOnly = true;
|
||||
|
22
hosts/skycam/README.md
Normal file
22
hosts/skycam/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Skycam
|
||||
|
||||
## Overview
|
||||
Raspberry Pi 4-based webcam
|
||||
|
||||
## Specs
|
||||
* SoC - Broadcom BCM2711
|
||||
* CPU - ARM Cortex-A72 @ 1.8 GHz
|
||||
* Memory - 8 GB LPDDR4
|
||||
|
||||
### Disks
|
||||
Device | Partitions _(filesystem, usage)_
|
||||
--- | ---
|
||||
SD card | `/dev/mmcblk0` (ext4, NixOS Root)
|
||||
|
||||
### Networks
|
||||
- DHCP on `10.0.1.0/24` subnet.
|
||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `pi.mesh.vimium.net`.
|
||||
|
||||
## Devices and connections
|
||||
- Camera Module 3 with wide-angle lens
|
||||
|
71
hosts/skycam/default.nix
Normal file
71
hosts/skycam/default.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../server.nix
|
||||
];
|
||||
|
||||
hardware = {
|
||||
raspberry-pi."4" = {
|
||||
apply-overlays-dtmerge.enable = true;
|
||||
audio.enable = false;
|
||||
fkms-3d.enable = true; # VideoCore with 512 MB CMA reservation
|
||||
tc358743.enable = true; # HDMI-to-CSI-2 converter
|
||||
xhci.enable = false;
|
||||
};
|
||||
firmware = with pkgs; [
|
||||
firmwareLinuxNonfree
|
||||
wireless-regdb
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostId = "731d1660";
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
allowedUDPPorts = [ 8080 ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.ustreamer = {
|
||||
enable = true;
|
||||
description = "uStreamer service";
|
||||
unitConfig = {
|
||||
Type = "simple";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStartPre = ''${pkgs.v4l-utils}/bin/v4l2-ctl \
|
||||
--device=/dev/video0 \
|
||||
--fix-edid-checksums \
|
||||
--info-edid
|
||||
'';
|
||||
ExecStart = ''${pkgs.unstable.ustreamer}/bin/ustreamer \
|
||||
--device=/dev/video0 \
|
||||
--resolution=1280x720 \
|
||||
--format=uyvy \
|
||||
--encoder=m2m-image \
|
||||
--workers=3 \
|
||||
--persistent \
|
||||
--dv-timings \
|
||||
--drop-same-frames=30 \
|
||||
--host=0.0.0.0 \
|
||||
--port=8080
|
||||
'';
|
||||
};
|
||||
wantedBy = [ "network-online.target" ];
|
||||
confinement.mode = "chroot-only";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
neovim
|
||||
libraspberrypi
|
||||
raspberrypi-eeprom
|
||||
v4l-utils
|
||||
unstable.ustreamer
|
||||
];
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
}
|
28
hosts/skycam/hardware-configuration.nix
Normal file
28
hosts/skycam/hardware-configuration.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ config, lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
supportedFilesystems = lib.mkForce [ "f2fs" "vfat xfs" ];
|
||||
tmp.cleanOnBoot = true;
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: super: {
|
||||
makeModulesClosure = x:
|
||||
super.makeModulesClosure (x // { allowMissing = true; });
|
||||
})
|
||||
];
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/NIXOS_SD";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user