setting up media server

This commit is contained in:
Matt Nish-Lapidus 2025-03-10 13:52:39 -04:00
parent 3475d9bfaf
commit d2e7573bea
8 changed files with 269 additions and 587 deletions

View file

@ -1,5 +1,112 @@
{ config, lib, pkgs, ... }:
{
config.facter.reportPath = ./facter.json;
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "media-server"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "America/Toronto";
# Define a user account. Don't forget to set a password with passwd.
users.users.media = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "audio" "video" "network" "networkmanager" ]; # Enable sudo for the user.
packages = with pkgs; [
tree
];
};
environment.systemPackages = with pkgs; [
wget
curl
];
fonts = {
enableDefaultPackages = true;
fontDir.enable = true;
fontconfig = {
enable = true;
useEmbeddedBitmaps = true;
};
powerManagement = {
enable = true;
};
hardware = {
amdgpu.initrd.enable = true;
enableAllFirmware = true;
uinput.enable = true;
};
services.power-profiles-daemon = {
enable = true;
package = pkgs.power-profiles-daemon;
};
# enable the OpenSSH daemon.
services.openssh.enable = true;
programs.ssh.startAgent = true;
services.resolved = {
enable = true;
extraConfig = ''
LLMNR=no
ReadEtcHosts=no
DNSSEC=no
'';
};
services.avahi = {
enable = true;
publish.enable = true;
publish.userServices = true;
openFirewall = true;
nssmdns4 = true;
};
services.samba = {
enable = true;
package = pkgs.sambaFull;
openFirewall = true;
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
# enable fish and launch it from bash for interactive shells
programs.fish.enable = true;
environment.pathsToLink = [ "/share/fish" ];
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
programs.git.enable = true;
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.05"; # Did you read the comment?
}