diff --git a/modules/nixos/disko/options.nix b/modules/nixos/disko/options.nix index 4329ebc..948291d 100644 --- a/modules/nixos/disko/options.nix +++ b/modules/nixos/disko/options.nix @@ -17,6 +17,8 @@ in enableSwap = mkBoolOpt false "Enable swap"; + enableLuks = mkBoolOpt false "Enable Luks"; + swapSize = mkOpt types.str "16G" "size of swap part"; }; } diff --git a/modules/nixos/disko/x86_64-linux/default.nix b/modules/nixos/disko/x86_64-linux/default.nix index 49ee35e..76e63e3 100644 --- a/modules/nixos/disko/x86_64-linux/default.nix +++ b/modules/nixos/disko/x86_64-linux/default.nix @@ -56,6 +56,62 @@ let }; }; + # BTRFS root partition configuration + encBtrfsRoot = { + name = "cryptroot"; + size = "100%"; + content = { + type = "luks"; + name = "cryptroot"; + extraOpenArgs = [ + "--allow-discards" + "--perf-no_read_workqueue" + "--perf-no_write_workqueue" + ]; + settings = {crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];}; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + "home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "root" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/root"; + }; + "nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + "etc" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/etc"; + }; + "log" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/var/log"; + }; + }; + }; + }; + }; + # BCacheFS root partition configuration bcachefsRoot = { name = "bcachefs-root"; @@ -108,7 +164,7 @@ in size = cfg.swapSize; }; - root = if cfg.filesystem == "btrfs" then btrfsRoot else bcachefsRoot; + root = if cfg.filesystem == "btrfs" then ( if cfg.enableLuks then encBtrfsRoot else btrfsRoot) else bcachefsRoot; }; }; }; diff --git a/modules/nixos/homeassistant/services/homeassistant/default.nix b/modules/nixos/homeassistant/services/homeassistant/default.nix index 4814e08..cc41ced 100644 --- a/modules/nixos/homeassistant/services/homeassistant/default.nix +++ b/modules/nixos/homeassistant/services/homeassistant/default.nix @@ -106,6 +106,7 @@ in "homekit_controller" "http" "humidifier" + "ibeacon" "image" "image_processing" "image_upload" @@ -117,6 +118,7 @@ in "input_select" "input_text" "ios" + "ipp" "isal" "jellyfin" "keyboard" @@ -206,7 +208,7 @@ in "usb" "vacuum" "vlc" - "vesync" + # "vesync" "wake_on_lan" "waze_travel_time" "weather" @@ -258,6 +260,7 @@ in extraPackages = ps: with ps; [ pkgs.${namespace}.python-roborock + pkgs.${namespace}.pyvesync # # Core functionality # aiohttp # aiodns diff --git a/packages/python/pyvesync/default.nix b/packages/python/pyvesync/default.nix new file mode 100644 index 0000000..b4bc6ce --- /dev/null +++ b/packages/python/pyvesync/default.nix @@ -0,0 +1,38 @@ +{ + lib, + fetchFromGitHub, + python3Packages, +}: + +python3Packages.buildPythonPackage rec { + pname = "pyvesync"; + version = "3.0.0b8"; + pyproject = true; + + disabled = python3Packages.pythonOlder "3.11"; + + src = fetchFromGitHub { + owner = "webdjoe"; + repo = "pyvesync"; + rev = "dev-2.0"; + hash = "sha256-hJGlcszXD8EXNPppOUuBt9obtunhymlqIGAltkAuZjA="; + }; + + build-system = with python3Packages; [ setuptools ]; + + dependencies = with python3Packages; [ + aiohttp + mashumaro + python-dateutil + ]; + + # pythonImportsCheck = [ "pyvesync" ]; + + meta = with lib; { + description = "Python library to manage Etekcity Devices and Levoit Air Purifier"; + homepage = "https://github.com/webdjoe/pyvesync"; + changelog = "https://github.com/webdjoe/pyvesync/releases/tag/${src.tag}"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} \ No newline at end of file diff --git a/systems/x86_64-linux/matt-nixos/default.nix b/systems/x86_64-linux/matt-nixos/default.nix index 59ddf1c..2e2727b 100644 --- a/systems/x86_64-linux/matt-nixos/default.nix +++ b/systems/x86_64-linux/matt-nixos/default.nix @@ -23,7 +23,7 @@ imports = [ ./boot.nix ./filesystems.nix - ./hardware-configuration.nix + # ./hardware-configuration.nix ./sops.nix ./services/lsfg-vk ./services/ratbagd @@ -44,7 +44,11 @@ gaming.enable = true; hardware = { - disko.enable = false; + disko = { + enable = true; + enableLuks = true; + }; + amd = { enable = true; lact.enable = true;