nix/void.nix

114 lines
2.8 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";
extraConfig = ''
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
# bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# gui for configuration
services.blueman.enable = true;
hardware.bluetooth.settings = {
General = {
# support for modern headsetes
Enable = "Source,Sink,Media,Socket";
# show battery level
Experimental = true;
};
};
# bluetooth mpris play-pause media control
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
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";
};
};
}