provide per-user args (ie username)
This commit is contained in:
parent
169bf2bf48
commit
34a8c23537
1 changed files with 22 additions and 10 deletions
|
|
@ -12,18 +12,22 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
{
|
{
|
||||||
root,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
_cerulean,
|
_cerulean,
|
||||||
|
config,
|
||||||
|
root,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
} @ args: let
|
} @ args: let
|
||||||
inherit
|
inherit
|
||||||
(builtins)
|
(builtins)
|
||||||
attrNames
|
|
||||||
filter
|
|
||||||
pathExists
|
pathExists
|
||||||
;
|
;
|
||||||
|
|
||||||
|
inherit
|
||||||
|
(lib)
|
||||||
|
filterAttrs
|
||||||
|
mapAttrs
|
||||||
|
;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
_cerulean.homeManager.nixosModules.default
|
_cerulean.homeManager.nixosModules.default
|
||||||
|
|
@ -49,13 +53,21 @@ in {
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
useUserPackages = lib.mkDefault false;
|
||||||
|
useGlobalPkgs = lib.mkDefault true;
|
||||||
|
|
||||||
|
overwriteBackup = lib.mkDefault false;
|
||||||
|
backupFileExtension = lib.mkDefault "bak";
|
||||||
|
|
||||||
users =
|
users =
|
||||||
config.users.users
|
config.users.users
|
||||||
|> attrNames
|
|> filterAttrs (name: value: value.manageHome && pathExists /${root}/homes/${name})
|
||||||
|> filter (x: x.manageHome && pathExists /${root}/homes/${x})
|
|> mapAttrs (name: _: {
|
||||||
|> (x:
|
imports = [import /${root}/homes/${name}];
|
||||||
lib.genAttrs x (y:
|
|
||||||
import /${root}/homes/${y}));
|
# per-user arguments
|
||||||
|
_module.args.username = name;
|
||||||
|
});
|
||||||
|
|
||||||
extraSpecialArgs = _cerulean.specialArgs;
|
extraSpecialArgs = _cerulean.specialArgs;
|
||||||
sharedModules = [
|
sharedModules = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue