From 90d1eaa2be9a0bb903ce47c02180bee3ba470b93 Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Mon, 10 Mar 2025 13:57:20 -0400 Subject: [PATCH] setting up media server --- hosts/media-server/configuration.nix | 142 ++++++++++++++++----------- 1 file changed, 85 insertions(+), 57 deletions(-) diff --git a/hosts/media-server/configuration.nix b/hosts/media-server/configuration.nix index ee2a743..4b30e62 100644 --- a/hosts/media-server/configuration.nix +++ b/hosts/media-server/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, inputs, pkgs, ... }: { imports = @@ -6,7 +6,34 @@ ./hardware-configuration.nix ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + 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. + }; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; @@ -42,76 +69,77 @@ useEmbeddedBitmaps = true; }; - powerManagement = { - enable = true; - }; + powerManagement = { + enable = true; + }; - hardware = { - amdgpu.initrd.enable = true; - enableAllFirmware = true; - uinput.enable = true; - }; + hardware = { + amdgpu.initrd.enable = true; + enableAllFirmware = true; + uinput.enable = true; + }; - services.power-profiles-daemon = { - enable = true; - package = pkgs.power-profiles-daemon; - }; + services.power-profiles-daemon = { + enable = true; + package = pkgs.power-profiles-daemon; + }; - # enable the OpenSSH daemon. - services.openssh.enable = true; - programs.ssh.startAgent = true; + # enable the OpenSSH daemon. + services.openssh.enable = true; + programs.ssh.startAgent = true; - services.resolved = { - enable = true; - extraConfig = '' + 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; - }; + }; + 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 = '' + # 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; + userEmail = "matt@emenel.ca"; + userName = "Matt Nish-Lapidus"; + ignores = [ + ".DS_Store" + ]; + }; + + + # 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? + }; - - - programs.git = { - enable = true; - userEmail = "matt@emenel.ca"; - userName = "Matt Nish-Lapidus"; - ignores = [ - ".DS_Store" - ]; - }; - - - # 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? - }