nixos/m/sys.nix
2024-09-23 21:31:13 +03:00

41 lines
1 KiB
Nix

{ lib, config, ... }:
let
types = lib.types;
sys = config.maid.sys;
in
{
options.maid.sys = {
enable = lib.mkEnableOption "whole maid system";
tz = lib.mkOption {
type = types.str;
default = "Europe/Moscow";
};
hostname = lib.mkOption {
type = types.str;
};
bluetooth = {
enable = lib.mkEnableOption "bluetooth";
powerOnBoot = lib.mkOption {
type = types.bool;
default = true;
description = "whether to power on bluetooth on system startup";
};
};
};
config = lib.mkIf sys.enable {
time.timeZone = sys.tz;
networking.hostName = sys.hostname;
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
hardware.bluetooth = lib.mkIf sys.bluetooth.enable {
enable = true;
powerOnBoot = sys.bluetooth.powerOnBoot;
};
};
}