created home manager nixos adapter modules

This commit is contained in:
Leyla Becker 2024-11-24 15:23:04 -06:00
parent a755b9ff48
commit 90f0c114b3
9 changed files with 34 additions and 8 deletions

View file

@ -3,9 +3,6 @@
../common
];
# # Enable sound with pipewire.
# hardware.flipperzero.enable = true;
environment.systemPackages = with pkgs; [
cachefilesd
];

5
home-modules/default.nix Normal file
View file

@ -0,0 +1,5 @@
{...}: {
imports = [
./flipperzero.nix
];
}

View file

@ -0,0 +1,3 @@
{lib, ...}: {
options.hardware.flipperzero.enable = lib.mkEnableOption "enable flipperzero hardware";
}

View file

@ -6,6 +6,10 @@
}: let
cfg = osConfig.host.users.ester;
in {
imports = [
../../home-modules
];
config = {
home = {
username = "ester";

View file

@ -6,6 +6,10 @@
}: let
cfg = osConfig.host.users.eve;
in {
imports = [
../../home-modules
];
config = {
home = {
username = "eve";

View file

@ -1,10 +1,7 @@
{
pkgs,
osConfig,
...
}: {
{pkgs, ...}: {
imports = [
./packages.nix
../../home-modules
];
config = {

View file

@ -5,5 +5,6 @@
./users.nix
./desktop.nix
./nix-development.nix
./home-manager
];
}

View file

@ -0,0 +1,6 @@
# modules in this folder are to adapt home manager modules defined in `home-modules` to any nix module configs that they need to set
{...}: {
imports = [
./flipperzero.nix
];
}

View file

@ -0,0 +1,9 @@
{
lib,
config,
...
}: let
home-users = lib.attrsets.mapAttrsToList (_: user: user) config.home-manager.users;
in {
hardware.flipperzero.enable = lib.lists.any (home-user: home-user.hardware.flipperzero.enable) home-users;
}