diff --git a/configs/user.nix b/configs/user.nix index 5a2d2a5..344c106 100644 --- a/configs/user.nix +++ b/configs/user.nix @@ -16,6 +16,7 @@ home-manager.useGlobalPkgs = true; home-manager.users.alex = { pkgs, ... }: { + home.enableNixpkgsReleaseCheck = false; home.packages = [ pkgs.cryfs ]; @@ -52,12 +53,6 @@ matchBlocks."homeserver" = { hostname = "192.168.1.100"; - # remoteForwards = [ { - # bind.address = "127.0.0.1"; - # bind.port = 52698; - # host.address = "127.0.0.1"; - # host.port = 52698; - # } ]; }; }; diff --git a/machine/homeserver.nix b/machine/homeserver.nix index 77abb23..68db217 100644 --- a/machine/homeserver.nix +++ b/machine/homeserver.nix @@ -21,8 +21,6 @@ networking.useDHCP = false; networking.interfaces.enp3s0.useDHCP = true; - # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ snapraid mergerfs @@ -33,25 +31,51 @@ docker-compose ]; - systemd.mounts = [ - { - requires = [ - "mnt-disk1.mount" - "mnt-disk2.mount" - "mnt-disk3.mount" - ]; - after = [ - "mnt-disk1.mount" - "mnt-disk2.mount" - "mnt-disk3.mount" - ]; - what = "/mnt/disk1:/mnt/disk2:/mnt/disk3"; - where = "/mnt/storage"; - type = "fuse.mergerfs"; - options = "defaults,allow_other,use_ino,fsname=mergerfs,minfreespace=50G,func.getattr=newest,noforget"; - wantedBy = [ "multi-user.target" ]; - } - ]; + systemd = { + mounts = [ + { + requires = [ + "mnt-disk1.mount" + "mnt-disk2.mount" + "mnt-disk3.mount" + ]; + after = [ + "mnt-disk1.mount" + "mnt-disk2.mount" + "mnt-disk3.mount" + ]; + what = "/mnt/disk1:/mnt/disk2:/mnt/disk3"; + where = "/mnt/storage"; + type = "fuse.mergerfs"; + options = "defaults,allow_other,use_ino,fsname=mergerfs,minfreespace=50G,func.getattr=newest,noforget"; + wantedBy = [ "multi-user.target" ]; + } + ]; + + services.snapraid-sync = { + #enable = true; + description = "Snapraid Sync and Diff"; + serviceConfig = { + Type = "oneshot"; + User = "alex"; + # ExecStart="/home/alex/snapraid-sync"; + }; + path = [pkgs.bash pkgs.snapraid pkgs.curl pkgs.smartmontools pkgs.hdparm]; + + script = '' + /home/alex/snapraid-sync + ''; + }; + + timers.snapraid-sync = { + #enable = true; + wantedBy = ["timers.target"]; + timerConfig = { + OnCalendar = "Mon-Sun, 23:00"; + # Unit = "snapraid-sync.service"; + }; + }; + }; powerManagement.powerUpCommands = '' ${pkgs.hdparm}/sbin/hdparm -S 241 /dev/disk/by-uuid/0301db98-264f-4b18-9423-15691063f73d @@ -64,30 +88,6 @@ ${pkgs.hdparm}/sbin/hdparm -y /dev/disk/by-uuid/6cce037c-d2d4-4940-bb69-6d2b84fd41aa ''; - systemd.services.snapraid-sync = { - #enable = true; - description = "Snapraid Sync and Diff"; - serviceConfig = { - Type = "oneshot"; - User = "alex"; - # ExecStart="/home/alex/snapraid-sync"; - }; - path = [pkgs.bash pkgs.snapraid pkgs.curl pkgs.smartmontools pkgs.hdparm]; - - script = '' - /home/alex/snapraid-sync - ''; - }; - - systemd.timers.snapraid-sync = { - #enable = true; - wantedBy = ["timers.target"]; - timerConfig = { - OnCalendar = "Mon-Sun, 23:00"; - # Unit = "snapraid-sync.service"; - }; - }; - nixpkgs.config.packageOverrides = pkgs: { vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; }; @@ -110,44 +110,46 @@ # }; - services.netdata.enable = true; + services = { + netdata.enable = true; - services.jellyfin = { - enable = true; - user = "alex"; - group = "users"; - }; + jellyfin = { + enable = true; + user = "alex"; + group = "users"; + }; - services.samba = { - enable = true; - securityType = "user"; - extraConfig = '' - workgroup = WORKGROUP - server string = server - netbios name = server - security = user - guest account = nobody - map to guest = bad user - logging = systemd - max log size = 50 - ''; - shares = { - storage = { - path = "/mnt/storage"; - browseable = "yes"; - "read only" = "no"; - "guest ok" = "no"; - "create mask" = "0644"; - "directory mask" = "0755"; - }; + samba = { + enable = true; + securityType = "user"; + extraConfig = '' + workgroup = WORKGROUP + server string = server + netbios name = server + security = user + guest account = nobody + map to guest = bad user + logging = systemd + max log size = 50 + ''; + shares = { + storage = { + path = "/mnt/storage"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + }; - ssdstorage = { - path = "/mnt/ssdstorage"; - browseable = "yes"; - "read only" = "no"; - "guest ok" = "no"; - "create mask" = "0644"; - "directory mask" = "0755"; + ssdstorage = { + path = "/mnt/ssdstorage"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + }; }; }; };