nixos-config/lib/flake-module.nix

31 lines
702 B
Nix
Raw Normal View History

2024-01-30 21:44:02 +01:00
{ inputs, lib, ... }:
2024-01-30 20:09:08 +01:00
2024-05-26 16:45:38 +02:00
let
createUser' = import ./createUser.nix;
in
{
2024-01-30 21:44:02 +01:00
imports = [ ./openwrt.nix ];
options.flake.lib = lib.mkOption { type = with lib.types; lazyAttrsOf raw; };
config.flake.lib = {
2024-05-26 16:45:38 +02:00
createSystem =
hostName:
2024-01-30 20:09:08 +01:00
{ hardwareConfig, config }:
2024-05-26 16:45:38 +02:00
(
{ pkgs, lib, ... }:
{
networking.hostName = hostName;
2024-01-30 20:09:08 +01:00
2024-05-26 16:45:38 +02:00
imports = [
../modules/common.nix
hardwareConfig
config
];
}
);
createUser =
name: args:
({ pkgs, ... }@args2: (createUser' name args) ({ inherit (inputs) home-manager; } // args2));
2024-01-30 20:09:08 +01:00
createMediaGroup = _: { users.groups.media.gid = 600; };
};
}