From 0009556141e6471986fdef0f219db66213c42a96 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Thu, 9 Mar 2023 22:09:59 +0100 Subject: [PATCH] Loki: fix mounting paths --- loki/configuration.nix | 386 +++++++++++++++----------------- loki/hardware-configuration.nix | 100 ++------- 2 files changed, 208 insertions(+), 278 deletions(-) diff --git a/loki/configuration.nix b/loki/configuration.nix index 1758a80..f43781c 100644 --- a/loki/configuration.nix +++ b/loki/configuration.nix @@ -122,53 +122,53 @@ with lib; { enable = true; discovery = true; }; - samba = { - enable = true; - enableNmbd = true; - enableWinbindd = true; - nsswins = true; - extraConfig = '' - workgroup = WORKGROUP - load printers = no - smb encrypt = required - ''; - shares = - let - common = { - "public" = "no"; - "writeable" = "yes"; - "create mask" = "0700"; - "directory mask" = "2700"; - "browseable" = "yes"; - "guest ok" = "no"; - "read only" = "no"; - "force group" = "users"; - }; - in - { - bertof = recursiveUpdate common { - path = "/home/bertof/"; - comment = "Bertof samba share"; - "force user" = "bertof"; - "valid users" = "bertof"; - }; - tiziano = recursiveUpdate common { - path = "/home/tiziano/"; - comment = "Tiziano samba share"; - "force user" = "tiziano"; - "valid users" = "tiziano"; - }; - condiviso = recursiveUpdate common { - path = "/mnt/raid0/condiviso"; - comment = "Samba share condiviso"; - "valid users" = "bertof tiziano"; - "create mask" = "0770"; - "directory mask" = "2770"; - "force create mode" = "0660"; - "force directory mode" = "2770"; - }; - }; - }; + # samba = { + # enable = true; + # enableNmbd = true; + # enableWinbindd = true; + # nsswins = true; + # extraConfig = '' + # workgroup = WORKGROUP + # load printers = no + # smb encrypt = required + # ''; + # shares = + # let + # common = { + # "public" = "no"; + # "writeable" = "yes"; + # "create mask" = "0700"; + # "directory mask" = "2700"; + # "browseable" = "yes"; + # "guest ok" = "no"; + # "read only" = "no"; + # "force group" = "users"; + # }; + # in + # { + # bertof = recursiveUpdate common { + # path = "/home/bertof/"; + # comment = "Bertof samba share"; + # "force user" = "bertof"; + # "valid users" = "bertof"; + # }; + # tiziano = recursiveUpdate common { + # path = "/home/tiziano/"; + # comment = "Tiziano samba share"; + # "force user" = "tiziano"; + # "valid users" = "tiziano"; + # }; + # condiviso = recursiveUpdate common { + # path = "/mnt/raid0/condiviso"; + # comment = "Samba share condiviso"; + # "valid users" = "bertof tiziano"; + # "create mask" = "0770"; + # "directory mask" = "2770"; + # "force create mode" = "0660"; + # "force directory mode" = "2770"; + # }; + # }; + # }; smartd.enable = true; sonarr = { enable = true; @@ -176,15 +176,15 @@ with lib; { group = "users"; }; thermald.enable = true; - transmission = { - enable = true; - openFirewall = true; - group = "users"; - settings = { - download-dir = "/mnt/raid0/condiviso/Scaricati/Torrent"; - incomplete-dir = "/mnt/raid0/condiviso/Scaricati/Torrent/.incomplete"; - }; - }; + # transmission = { + # enable = true; + # openFirewall = true; + # group = "users"; + # settings = { + # download-dir = "/mnt/raid0/condiviso/Scaricati/Torrent"; + # incomplete-dir = "/mnt/raid0/condiviso/Scaricati/Torrent/.incomplete"; + # }; + # }; xserver = { # enable = true; # videoDrivers = [ "nvidia" ]; @@ -250,47 +250,33 @@ with lib; { in { bertof_raid0 = { - subvolume = "/home/bertof/raid0"; + subvolume = "/home/bertof/"; extraConfig = '' ALLOW_USERS="bertof" ${commonExtraConfig} ''; }; tiziano_raid0 = { - subvolume = "/home/tiziano/raid0"; + subvolume = "/home/tiziano/"; extraConfig = '' ALLOW_USERS="tiziano" ${commonExtraConfig} ''; }; - bertof_raid1 = { - subvolume = "/home/bertof/raid1"; - extraConfig = '' - ALLOW_USERS="bertof" - ${commonExtraConfig} - ''; - }; - tiziano_raid1 = { - subvolume = "/home/tiziano/raid1"; - extraConfig = '' - ALLOW_USERS="tiziano" - ${commonExtraConfig} - ''; - }; - condiviso_raid0 = { - subvolume = "/mnt/raid0/condiviso"; - extraConfig = '' - ALLOW_USERS="bertof tiziano" - ${commonExtraConfig} - ''; - }; - condiviso_raid1 = { - subvolume = "/mnt/raid1/condiviso"; - extraConfig = '' - ALLOW_USERS="bertof tiziano" - ${commonExtraConfig} - ''; - }; + # condiviso_raid0 = { + # subvolume = "/mnt/raid0/condiviso"; + # extraConfig = '' + # ALLOW_USERS="bertof tiziano" + # ${commonExtraConfig} + # ''; + # }; + # condiviso_raid1 = { + # subvolume = "/mnt/raid1/condiviso"; + # extraConfig = '' + # ALLOW_USERS="bertof tiziano" + # ${commonExtraConfig} + # ''; + # }; }; }; @@ -332,125 +318,125 @@ with lib; { # }; }; - services.home-assistant = { - enable = true; - # openFirewall = true; - config = { - default_config = { }; + # services.home-assistant = { + # enable = true; + # # openFirewall = true; + # config = { + # default_config = { }; - homeassistant = { - name = "Casa"; - latitude = "!secret home-latitude"; - longitude = "!secret home-longitude"; - elevation = 17; - unit_system = "metric"; - time_zone = "Europe/Rome"; - external_url = "https://home-assistant.bertof.net"; - }; + # homeassistant = { + # name = "Casa"; + # latitude = "!secret home-latitude"; + # longitude = "!secret home-longitude"; + # elevation = 17; + # unit_system = "metric"; + # time_zone = "Europe/Rome"; + # external_url = "https://home-assistant.bertof.net"; + # }; - http = { - use_x_forwarded_for = true; - trusted_proxies = [ "172.23.4.159" "::1" "127.0.0.1" ]; - }; + # http = { + # use_x_forwarded_for = true; + # trusted_proxies = [ "172.23.4.159" "::1" "127.0.0.1" ]; + # }; - automation = "!include automations.yaml"; - scene = "!include scenes.yaml"; + # automation = "!include automations.yaml"; + # scene = "!include scenes.yaml"; - cloud = { }; - config = { }; - device_tracker = [{ - platform = "bluetooth_tracker"; - request_rssi = true; - }]; - esphome = { }; - frontend = { }; - # google_assistant = { project_id = "light-cathode-372118"; }; - history = { }; - logbook = { }; - # logger.default = "debug"; - logger.default = "info"; - "map" = { }; - mobile_app = { }; - recorder.purge_keep_days = 30; - shopping_list = { }; - sun = { }; - system_health = { }; - tts = [{ - platform = "google_translate"; - language = "it"; - # tld = "it"; - }]; - }; - configDir = "/var/lib/hass"; - configWritable = true; - extraPackages = ps: with ps; [ securetar ]; - extraComponents = [ - "default_config" + # cloud = { }; + # config = { }; + # device_tracker = [{ + # platform = "bluetooth_tracker"; + # request_rssi = true; + # }]; + # esphome = { }; + # frontend = { }; + # # google_assistant = { project_id = "light-cathode-372118"; }; + # history = { }; + # logbook = { }; + # # logger.default = "debug"; + # logger.default = "info"; + # "map" = { }; + # mobile_app = { }; + # recorder.purge_keep_days = 30; + # shopping_list = { }; + # sun = { }; + # system_health = { }; + # tts = [{ + # platform = "google_translate"; + # language = "it"; + # # tld = "it"; + # }]; + # }; + # configDir = "/var/lib/hass"; + # configWritable = true; + # extraPackages = ps: with ps; [ securetar ]; + # extraComponents = [ + # "default_config" - "accuweather" - "alert" - "analytics" - "bayesian" - "binary_sensor" - "blueprint" - "bluetooth_le_tracker" - "bluetooth_tracker" - "button" - "camera" - "cast" - "caldav" - "calendar" - "citybikes" - "configurator" - "coronavirus" - "cover" - "default_config" - "derivative" - "device_automation" - "device_sun_light_trigger" - "device_tracker" - "dlib_face_detect" - "dlib_face_identify" - "dlna_dmr" - "dlna_dms" - "esphome" - "flux" - "gdacs" - "google" - "google_translate" - "group" - "hassio" - "jellyfin" - "local_file" - "media_player" - "met" - "meteoalarm" - "network" - "nmap_tracker" - "notify" - "ping" - "plex" - "proximity" - "radarr" - "radio_browser" - "random" - "scene" - "schedule" - "sonarr" - "spotify" - "tcp" - "telegram" - "telegram_bot" - "template" - "threshold" - "tod" # times of the day - "trend" - "upnp" - "wake_on_lan" - "workday" - "zoneminder" - ]; - }; + # "accuweather" + # "alert" + # "analytics" + # "bayesian" + # "binary_sensor" + # "blueprint" + # "bluetooth_le_tracker" + # "bluetooth_tracker" + # "button" + # "camera" + # "cast" + # "caldav" + # "calendar" + # "citybikes" + # "configurator" + # "coronavirus" + # "cover" + # "default_config" + # "derivative" + # "device_automation" + # "device_sun_light_trigger" + # "device_tracker" + # "dlib_face_detect" + # "dlib_face_identify" + # "dlna_dmr" + # "dlna_dms" + # "esphome" + # "flux" + # "gdacs" + # "google" + # "google_translate" + # "group" + # "hassio" + # "jellyfin" + # "local_file" + # "media_player" + # "met" + # "meteoalarm" + # "network" + # "nmap_tracker" + # "notify" + # "ping" + # "plex" + # "proximity" + # "radarr" + # "radio_browser" + # "random" + # "scene" + # "schedule" + # "sonarr" + # "spotify" + # "tcp" + # "telegram" + # "telegram_bot" + # "template" + # "threshold" + # "tod" # times of the day + # "trend" + # "upnp" + # "wake_on_lan" + # "workday" + # "zoneminder" + # ]; + # }; security.sudo.extraConfig = '' Defaults pwfeedback diff --git a/loki/hardware-configuration.nix b/loki/hardware-configuration.nix index 26c4ce4..426bf1c 100644 --- a/loki/hardware-configuration.nix +++ b/loki/hardware-configuration.nix @@ -1,17 +1,12 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. { config, lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ehci_pci" - "ahci" - "uas" - "usb_storage" - "sd_mod" - "rtsx_pci_sdmmc" - ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "uas" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -26,85 +21,34 @@ fsType = "vfat"; }; - # fileSystems."/var/lib/zoneminder/events" = { - # device = "/dev/disk/by-uuid/7ca4d382-eed7-4b49-b7d8-4b5ca139dd9c"; - # fsType = "btrfs"; - # options = [ "subvol=@zoneminder" ]; - # }; + fileSystems."/home/bertof" = { + device = "/dev/disk/by-partlabel/5T"; + fsType = "btrfs"; + options = [ "subvol=@bertof" ]; + }; - # fileSystems."/mnt/raid0/condiviso" = { - # device = "/dev/disk/by-uuid/7ca4d382-eed7-4b49-b7d8-4b5ca139dd9c"; - # fsType = "btrfs"; - # options = [ "subvol=@condiviso" ]; - # }; + fileSystems."/home/tiziano" = { + device = "/dev/disk/by-partlabel/5T"; + fsType = "btrfs"; + options = [ "subvol=@tiziano" ]; + }; - # fileSystems."/mnt/raid1/condiviso" = { - # device = "/dev/disk/by-uuid/c84a38dc-9cc7-4762-b509-8fce1c1d95c8"; - # fsType = "btrfs"; - # options = [ "subvol=@condiviso" ]; - # }; - - # fileSystems."/home/bertof/raid0" = { - # device = "/dev/disk/by-uuid/7ca4d382-eed7-4b49-b7d8-4b5ca139dd9c"; - # fsType = "btrfs"; - # options = [ "subvol=@bertof" ]; - # }; - - # fileSystems."/home/bertof/raid1" = { - # device = "/dev/disk/by-uuid/c84a38dc-9cc7-4762-b509-8fce1c1d95c8"; - # fsType = "btrfs"; - # options = [ "subvol=@bertof" ]; - # }; - - # fileSystems."/home/tiziano/raid0" = { - # device = "/dev/disk/by-uuid/7ca4d382-eed7-4b49-b7d8-4b5ca139dd9c"; - # fsType = "btrfs"; - # options = [ "subvol=@tiziano" ]; - # }; - - # fileSystems."/home/tiziano/raid1" = { - # device = "/dev/disk/by-uuid/c84a38dc-9cc7-4762-b509-8fce1c1d95c8"; - # fsType = "btrfs"; - # options = [ "subvol=@tiziano" ]; - # }; - - # fileSystems."/home/tiziano/Condiviso/raid1" = { - # device = "/dev/disk/by-uuid/c84a38dc-9cc7-4762-b509-8fce1c1d95c8"; - # fsType = "btrfs"; - # options = [ "subvol=@condiviso" ]; - # }; - - # fileSystems."/home/tiziano/Condiviso/raid0" = { - # device = "/dev/disk/by-uuid/7ca4d382-eed7-4b49-b7d8-4b5ca139dd9c"; - # fsType = "btrfs"; - # options = [ "subvol=@condiviso" ]; - # }; - - # fileSystems."/home/bertof/Condiviso/raid0" = { - # device = "/dev/disk/by-uuid/7ca4d382-eed7-4b49-b7d8-4b5ca139dd9c"; - # fsType = "btrfs"; - # options = [ "subvol=@condiviso" ]; - # }; - - # fileSystems."/home/bertof/Condiviso/raid1" = { - # device = "/dev/disk/by-uuid/c84a38dc-9cc7-4762-b509-8fce1c1d95c8"; - # fsType = "btrfs"; - # options = [ "subvol=@condiviso" ]; - # }; - - swapDevices = [ ]; + swapDevices = [ + { + device = "/swapfile"; + size = 1024 * 4; + } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - # networking.useDHCP = lib.mkDefault true; - # networking.interfaces.docker0.useDHCP = lib.mkDefault true; + networking.useDHCP = lib.mkDefault true; # networking.interfaces.eno1.useDHCP = lib.mkDefault true; # networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true; # networking.interfaces.ztmjfdwjkp.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }