nixos-config/hosts/media-server/configuration.nix

142 lines
3.3 KiB
Nix
Raw Normal View History

2025-03-10 13:57:20 -04:00
{ config, lib, inputs, pkgs, ... }:
2025-02-20 16:23:09 -05:00
{
2025-03-10 13:52:39 -04:00
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
2025-03-10 13:57:20 -04:00
nixpkgs = {
config = {
allowUnfree = true;
};
};
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
substituters = [
"https://nix-community.cachix.org"
"https://cache.garnix.io"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
registry = {
emenel-templates.flake = inputs.emenel-templates;
};
channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead.
};
2025-03-10 13:52:39 -04:00
# 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; [
2025-03-10 14:00:45 -04:00
wezterm
2025-03-10 13:52:39 -04:00
];
};
environment.systemPackages = with pkgs; [
wget
curl
];
fonts = {
enableDefaultPackages = true;
fontDir.enable = true;
fontconfig = {
enable = true;
useEmbeddedBitmaps = true;
};
2025-03-10 13:59:58 -04:00
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
powerManagement = {
enable = true;
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
hardware = {
amdgpu.initrd.enable = true;
enableAllFirmware = true;
uinput.enable = true;
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
services.power-profiles-daemon = {
enable = true;
package = pkgs.power-profiles-daemon;
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
# enable the OpenSSH daemon.
services.openssh.enable = true;
programs.ssh.startAgent = true;
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
services.resolved = {
enable = true;
extraConfig = ''
2025-03-10 13:52:39 -04:00
LLMNR=no
ReadEtcHosts=no
DNSSEC=no
'';
2025-03-10 13:59:58 -04:00
};
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;
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
# enable fish and launch it from bash for interactive shells
programs.fish.enable = true;
environment.pathsToLink = [ "/share/fish" ];
programs.bash = {
interactiveShellInit = ''
2025-03-10 13:52:39 -04:00
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
'';
2025-03-10 13:59:58 -04:00
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
programs.git = {
enable = true;
};
2025-03-10 13:52:39 -04:00
2025-03-10 13:59:58 -04:00
# 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?
2025-03-10 13:52:39 -04:00
2025-02-20 16:23:09 -05:00
}