mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
flake-parts/setups/nixos: add foodogsquaredUtils
to module args
An ugly solution but can't get around much for generating Nix modules with the modularly set `foodogsquaredLib` so we'll have to make it evaluated before the NixOS config evaluation.
This commit is contained in:
parent
21ce62aa00
commit
bf52b6b5be
33
lib/utils/nixos.nix
Normal file
33
lib/utils/nixos.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ lib }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# This is only used for home-manager users without a NixOS user counterpart.
|
||||||
|
mapHomeManagerUser = user: settings:
|
||||||
|
let
|
||||||
|
homeDirectory = "/home/${user}";
|
||||||
|
defaultUserConfig = {
|
||||||
|
extraGroups = lib.mkDefault [ "wheel" ];
|
||||||
|
createHome = lib.mkDefault true;
|
||||||
|
home = lib.mkDefault homeDirectory;
|
||||||
|
isNormalUser = lib.mkForce true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
({ lib, ... }: {
|
||||||
|
home-manager.users."${user}" = { ... }: {
|
||||||
|
imports = [
|
||||||
|
{
|
||||||
|
home.username = user;
|
||||||
|
home.homeDirectory = homeDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
|
../../configs/home-manager/${user}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users."${user}" = lib.mkMerge [
|
||||||
|
defaultUserConfig
|
||||||
|
settings
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
@ -28,6 +28,7 @@ let
|
|||||||
in
|
in
|
||||||
(lib.makeOverridable nixosSystem) {
|
(lib.makeOverridable nixosSystem) {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
foodogsquaredUtils = import ../../../lib/utils/nixos.nix { inherit lib; };
|
||||||
foodogsquaredModulesPath = builtins.toString nixosModules;
|
foodogsquaredModulesPath = builtins.toString nixosModules;
|
||||||
};
|
};
|
||||||
modules = extraModules ++ [{
|
modules = extraModules ++ [{
|
||||||
|
Loading…
Reference in New Issue
Block a user