va a ciapa i ratt
This commit is contained in:
parent
fac91af11a
commit
8346c9f02c
43 changed files with 909 additions and 446 deletions
|
@ -6,12 +6,16 @@
|
|||
config,
|
||||
...
|
||||
}: {
|
||||
imports = fleetModules [
|
||||
"common"
|
||||
"ssh"
|
||||
"ccr"
|
||||
"wireguard-client"
|
||||
];
|
||||
imports =
|
||||
fleetModules [
|
||||
"common"
|
||||
"ssh"
|
||||
"ccr"
|
||||
"wireguard-client"
|
||||
]
|
||||
++ [
|
||||
./disko.nix
|
||||
];
|
||||
|
||||
ccr.enable = true;
|
||||
|
||||
|
@ -26,64 +30,62 @@
|
|||
generic-extlinux-compatible.enable = true;
|
||||
};
|
||||
|
||||
disko = import ./disko.nix {};
|
||||
|
||||
fileSystems."/mnt/film" = {
|
||||
device = "//ccr.ydns.eu/film";
|
||||
fsType = "cifs";
|
||||
options = let
|
||||
credentials = pkgs.writeText "credentials" ''
|
||||
username=guest
|
||||
password=
|
||||
'';
|
||||
in ["credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"];
|
||||
};
|
||||
fileSystems."/mnt/archivio" = {
|
||||
device = "//ccr.ydns.eu/archivio";
|
||||
fsType = "cifs";
|
||||
options = let
|
||||
credentials = pkgs.writeText "credentials" ''
|
||||
username=guest
|
||||
password=
|
||||
'';
|
||||
in ["credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"];
|
||||
};
|
||||
# fileSystems."/mnt/film" = {
|
||||
# device = "//ccr.ydns.eu/film";
|
||||
# fsType = "cifs";
|
||||
# options = let
|
||||
# credentials = pkgs.writeText "credentials" ''
|
||||
# username=guest
|
||||
# password=
|
||||
# '';
|
||||
# in ["credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"];
|
||||
# };
|
||||
# fileSystems."/mnt/archivio" = {
|
||||
# device = "//ccr.ydns.eu/archivio";
|
||||
# fsType = "cifs";
|
||||
# options = let
|
||||
# credentials = pkgs.writeText "credentials" ''
|
||||
# username=guest
|
||||
# password=
|
||||
# '';
|
||||
# in ["credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"];
|
||||
# };
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
kodi-rock5b
|
||||
# kodi-rock5b
|
||||
cifs-utils
|
||||
];
|
||||
|
||||
users.extraUsers.kodi = {
|
||||
isNormalUser = true;
|
||||
uid = 1002;
|
||||
extraGroups = ["video" "input"];
|
||||
};
|
||||
# users.extraUsers.kodi = {
|
||||
# isNormalUser = true;
|
||||
# uid = 1002;
|
||||
# extraGroups = ["video" "input"];
|
||||
# };
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
8080 # kodi control
|
||||
80
|
||||
];
|
||||
# networking.firewall.allowedTCPPorts = [
|
||||
# 8080 # kodi control
|
||||
# 80
|
||||
# ];
|
||||
|
||||
programs.bash.loginShellInit = ''
|
||||
[[ "$(tty)" == '/dev/tty1' ]] && \
|
||||
[[ "$(whoami)" == 'kodi' ]] && \
|
||||
${pkgs.kodi-rock5b}/bin/kodi-standalone
|
||||
# programs.bash.loginShellInit = ''
|
||||
# [[ "$(tty)" == '/dev/tty1' ]] && \
|
||||
# [[ "$(whoami)" == 'kodi' ]] && \
|
||||
# ${pkgs.kodi-rock5b}/bin/kodi-standalone
|
||||
|
||||
'';
|
||||
# '';
|
||||
|
||||
# Waiting for https://github.com/NixOS/nixpkgs/issues/140304
|
||||
services.getty = let
|
||||
script = pkgs.writeText "login-program.sh" ''
|
||||
if [[ "$(tty)" == '/dev/tty1' ]]; then
|
||||
${pkgs.shadow}/bin/login -f kodi;
|
||||
else
|
||||
${pkgs.shadow}/bin/login;
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
loginProgram = "${pkgs.bash}/bin/sh";
|
||||
loginOptions = toString script;
|
||||
extraArgs = ["--skip-login"];
|
||||
};
|
||||
# services.getty = let
|
||||
# script = pkgs.writeText "login-program.sh" ''
|
||||
# if [[ "$(tty)" == '/dev/tty1' ]]; then
|
||||
# ${pkgs.shadow}/bin/login -f kodi;
|
||||
# else
|
||||
# ${pkgs.shadow}/bin/login;
|
||||
# fi
|
||||
# '';
|
||||
# in {
|
||||
# loginProgram = "${pkgs.bash}/bin/sh";
|
||||
# loginOptions = toString script;
|
||||
# extraArgs = ["--skip-login"];
|
||||
# };
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
{emmc ? "/dev/mmcblk0", ...}: {
|
||||
devices = {
|
||||
let
|
||||
emmc = "/dev/mmcblk0";
|
||||
hd1 = "/dev/disk/by-id/ata-WDC_WD10EADS-22M2B0_WD-WCAV52709550";
|
||||
hd2 = "/dev/disk/by-id/ata-WDC_WD10EADX-22TDHB0_WD-WCAV5V359530";
|
||||
# old_hd = "/dev/disk/by-id/ata-WDC_WD5000AAKX-08U6AA0_WD-WCC2E5TR40FU";
|
||||
in {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
emmc = {
|
||||
type = "disk";
|
||||
|
@ -9,14 +14,12 @@
|
|||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
start = "32.8kB";
|
||||
end = "12.6MB";
|
||||
name = "uboot";
|
||||
bootable = true;
|
||||
}
|
||||
{
|
||||
type = "partition";
|
||||
name = "NIXOS_ROOTFS";
|
||||
start = "13.6MB";
|
||||
end = "100%";
|
||||
|
@ -30,6 +33,63 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
# hd1 = {
|
||||
# type = "disk";
|
||||
# device = hd1;
|
||||
# content = {
|
||||
# type = "table";
|
||||
# format = "gpt";
|
||||
# partitions = [
|
||||
# {
|
||||
# name = "primary";
|
||||
# start = "0";
|
||||
# end = "100%";
|
||||
# content = {
|
||||
# type = "lvm_pv";
|
||||
# vg = "pool";
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
# hd2 = {
|
||||
# type = "disk";
|
||||
# device = hd2;
|
||||
# content = {
|
||||
# type = "table";
|
||||
# format = "gpt";
|
||||
# partitions = [
|
||||
# {
|
||||
# name = "primary";
|
||||
# start = "0";
|
||||
# end = "100%";
|
||||
# content = {
|
||||
# type = "lvm_pv";
|
||||
# vg = "pool";
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# lvm_vg = {
|
||||
# pool = {
|
||||
# type = "lvm_vg";
|
||||
# lvs = {
|
||||
# root = {
|
||||
# size = "100M";
|
||||
# lvm_type = "mirror";
|
||||
# content = {
|
||||
# type = "filesystem";
|
||||
# format = "ext4";
|
||||
# mountpoint = "/mnt/raid";
|
||||
# mountOptions = [
|
||||
# "defaults"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue