nix/void.nix

92 lines
2.2 KiB
Nix
Raw Normal View History

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration-void.nix
./common.nix
];
networking.hostName = "void"; # Define your hostname.
services.samba = {
enable = true;
openFirewall = true;
securityType = "user";
2024-12-11 17:23:34 +01:00
settings.global = {
workgroup = "WORKGROUP";
"server string" = "void";
"netbios name" = "void";
security = "user";
"hosts allow" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
"log level" = 4;
#"smb encrypt" = "mandatory";
};
shares."Music" = {
path = "/pile/Music";
browsable = "yes";
"read only" = "yes";
"guest ok" = "no";
"read list" = "@music";
};
};
users.users.music = {
group = "music";
isNormalUser = true;
};
# enqble i2c-dev kernel module for control of backlight in external monitor
# https://discourse.nixos.org/t/how-to-enable-ddc-brightness-control-i2c-permissions/20800/3
boot.extraModulePackages = [
config.boot.kernelPackages.ddcci-driver
];
boot.kernelModules = ["i2c-dev" "ddcci_backlight"];
hardware.i2c.enable = true;
# package for controlling brightness on external monitor
environment.systemPackages = [
pkgs.ddcutil
];
2024-11-09 16:52:19 +01:00
# mount external drive
fileSystems."/external".label = "external";
2024-11-17 16:42:31 +01:00
2024-11-09 18:16:00 +01:00
# backup
services.borgbackup.jobs."external" = {
paths = [
"/home"
"/var"
"/pile"
];
exclude = [
"/home/*/.local/share/Steam"
"**/*cache"
"**/*Cache"
"**/*trash"
"**/*Trash"
"/home/*/.mozilla/firefox"
"/home/*/GOG Games"
"**/target"
"**/result"
];
repo = "/external/voidbackup";
encryption = {
mode = "repokey-blake2";
passCommand = "cat /root/borgbackup/passphrase";
};
compression = "auto,lzma";
startAt = "daily";
persistentTimer = true;
};
systemd.services."borgbackup-job-external" = {
unitConfig = {
RequiresMountsFor = "/external";
Requires = "external.mount";
};
};
}