setting up media server
This commit is contained in:
parent
2a695ab10e
commit
90d1eaa2be
1 changed files with 85 additions and 57 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, inputs, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
|
@ -6,7 +6,34 @@
|
||||||
./hardware-configuration.nix
|
./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.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
@ -42,76 +69,77 @@
|
||||||
useEmbeddedBitmaps = true;
|
useEmbeddedBitmaps = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement = {
|
powerManagement = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
amdgpu.initrd.enable = true;
|
amdgpu.initrd.enable = true;
|
||||||
enableAllFirmware = true;
|
enableAllFirmware = true;
|
||||||
uinput.enable = true;
|
uinput.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.power-profiles-daemon = {
|
services.power-profiles-daemon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.power-profiles-daemon;
|
package = pkgs.power-profiles-daemon;
|
||||||
};
|
};
|
||||||
|
|
||||||
# enable the OpenSSH daemon.
|
# enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
programs.ssh.startAgent = true;
|
programs.ssh.startAgent = true;
|
||||||
|
|
||||||
services.resolved = {
|
services.resolved = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
LLMNR=no
|
LLMNR=no
|
||||||
ReadEtcHosts=no
|
ReadEtcHosts=no
|
||||||
DNSSEC=no
|
DNSSEC=no
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
services.avahi = {
|
services.avahi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
publish.enable = true;
|
publish.enable = true;
|
||||||
publish.userServices = true;
|
publish.userServices = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
nssmdns4 = true;
|
nssmdns4 = true;
|
||||||
};
|
};
|
||||||
services.samba = {
|
services.samba = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.sambaFull;
|
package = pkgs.sambaFull;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
services.samba-wsdd = {
|
services.samba-wsdd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# enable fish and launch it from bash for interactive shells
|
# enable fish and launch it from bash for interactive shells
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
environment.pathsToLink = [ "/share/fish" ];
|
environment.pathsToLink = [ "/share/fish" ];
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||||
then
|
then
|
||||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||||
fi
|
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?
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue