common: profiles: migrate devices

This commit is contained in:
Bruno BELANYI 2024-01-03 17:03:09 +00:00
parent 42cbe79cae
commit 1d888f68e3
5 changed files with 25 additions and 23 deletions

View file

@ -3,9 +3,9 @@
{ lib, type ? null, ... }:
let
allowedTypes = [
"nixos"
"home"
"darwin"
"home"
"nixos"
];
allowedTypesString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedTypes);

View file

@ -3,5 +3,6 @@
{
imports = [
./bluetooth
./devices
];
}

View file

@ -0,0 +1,22 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.devices;
in
{
options.my.profiles.devices = with lib; {
enable = mkEnableOption "devices profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "nixos") {
my.hardware = {
ergodox.enable = true;
mx-ergo.enable = true;
};
# MTP devices auto-mount via file explorers
services.gvfs.enable = true;
})
]);
}

View file

@ -2,7 +2,6 @@
{ ... }:
{
imports = [
./devices
./gtk
./laptop
./wm

View file

@ -1,20 +0,0 @@
{ config, lib, ... }:
let
cfg = config.my.profiles.devices;
in
{
options.my.profiles.devices = with lib; {
enable = mkEnableOption "devices profile";
};
config = lib.mkIf cfg.enable {
my.hardware = {
ergodox.enable = true;
mx-ergo.enable = true;
};
# MTP devices auto-mount via file explorers
services.gvfs.enable = true;
};
}