summaryrefslogtreecommitdiff
path: root/configuration.nix
diff options
context:
space:
mode:
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix101
1 files changed, 97 insertions, 4 deletions
diff --git a/configuration.nix b/configuration.nix
index a37e896..507184a 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -21,6 +21,8 @@
boot.zfs.extraPools = [ "pool" ];
services.zfs.autoScrub.enable = true;
+ boot.kernelModules = [ "snd-aloop" ];
+
networking.hostName = "vandoorn-server"; # Define your hostname.
networking.hostId = "0f647db6";
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
@@ -57,16 +59,22 @@
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
+
users.users.nick = {
isNormalUser = true;
group = "nick";
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
};
+
users.users.casey = {
isNormalUser = true;
};
+ users.users.guest = {
+ isNormalUser = true;
+ };
+
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
@@ -77,12 +85,17 @@
wget
inetutils
vim
+ librespot
+ pv
+ alsa-utils
+ ncmpcpp
fast-cli
lm_sensors
lshw
iotop
dstat
bottom
+ btop
duf
ripgrep
fzy
@@ -104,6 +117,7 @@
cgit
rclone
p7zip
+ mpc
];
# Some programs need SUID wrappers, can be configured further or are
@@ -129,6 +143,13 @@
548 # AFP
80 # nginx
631 # printing
+ 2049 # nfs
+ 6600 # mpd
+ 1704 # snapcast audio
+ 1705 # snapcast control
+ 1780 # snapcast web ui
+ 8081 # myMPD
+ 8080 # yMPD
];
networking.firewall.allowPing = true;
@@ -139,11 +160,11 @@
settings = {
"home" = {
path = "/mnt/pool/home";
- "valid users" = "nick guest";
+ "valid users" = "nick";
};
"media-libraries" = {
path = "/mnt/pool/media/libraries";
- "valid users" = "nick guest";
+ "valid users" = "nick";
};
};
};
@@ -194,13 +215,23 @@
"valid users" = [
"nick"
"casey"
- "guest"
];
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
+ media-libraries-public = {
+ path = "/mnt/pool/media/libraries";
+ browseable = "yes";
+ "valid users" = [
+ "guest"
+ ];
+ "read only" = "yes";
+ "guest ok" = "no";
+ "create mask" = "0644";
+ "directory mask" = "0755";
+ };
home = {
path = "/mnt/pool/home";
browseable = "yes";
@@ -227,7 +258,7 @@
browseable = "yes";
"valid users" = [
"nick"
- "guest"
+ "casey"
];
"read only" = "no";
"guest ok" = "no";
@@ -378,6 +409,68 @@
};
};
+ fileSystems."/export/home" = {
+ device = "/mnt/pool/home";
+ options = [ "bind" ];
+ };
+
+ services.nfs.server.enable = true;
+ services.nfs.server.exports = ''
+ /export 192.168.0.0/24(rw,no_subtree_check)
+ /export/home 192.168.0.0/24(rw,no_hide,insecure,no_subtree_check)
+ '';
+
+ services.mpd = {
+ enable = true;
+ musicDirectory = "/mnt/pool/media/libraries/music";
+
+ network.listenAddress = "any";
+ extraConfig = ''
+ audio_output {
+ type "alsa"
+ name "snapcast"
+ device "hw:0,0,0"
+ format "48000:16:2"
+ enabled "yes"
+ mixer_type "software"
+ }
+ '';
+ };
+
+ services.mympd = {
+ enable = true;
+ settings = {
+ http_port = 8081;
+ };
+ };
+ services.ympd.enable = true;
+
+ users.extraGroups.audio.members = [ "snapserver" ];
+
+ services.snapserver = {
+ enable = true;
+ codec = "flac";
+
+ streams = {
+ mpd = {
+ type = "alsa";
+ location = "";
+ sampleFormat = "48000:16:2";
+ query = {
+ device = "hw:0,1,0";
+ };
+ };
+ line_in = {
+ type = "alsa";
+ location = "";
+ sampleFormat = "48000:16:2";
+ query = {
+ device = "hw:1,0,0";
+ };
+ };
+ };
+ };
+
nixpkgs.config.allowUnfree = true;
# This value determines the NixOS release from which the default