mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
config: create declarative home-manager user management
This commit is contained in:
parent
4e428bf8e4
commit
87e01e119c
13
flake.nix
13
flake.nix
@ -79,6 +79,9 @@
|
|||||||
# support.
|
# support.
|
||||||
images = lib'.importTOML ./images.toml;
|
images = lib'.importTOML ./images.toml;
|
||||||
|
|
||||||
|
# A set of users with their metadata to be deployed with home-manager.
|
||||||
|
users = lib'.importTOML ./users.toml;
|
||||||
|
|
||||||
# A set of image-related utilities for the flake outputs.
|
# A set of image-related utilities for the flake outputs.
|
||||||
inherit (import ./lib/images.nix { inherit inputs; lib = lib'; }) mkHost mkUser mkImage;
|
inherit (import ./lib/images.nix { inherit inputs; lib = lib'; }) mkHost mkUser mkImage;
|
||||||
|
|
||||||
@ -310,8 +313,9 @@
|
|||||||
# I can now install home-manager users in non-NixOS systems.
|
# I can now install home-manager users in non-NixOS systems.
|
||||||
# NICE!
|
# NICE!
|
||||||
homeConfigurations = lib'.mapAttrs
|
homeConfigurations = lib'.mapAttrs
|
||||||
(_: path:
|
(name: metadata:
|
||||||
let
|
let
|
||||||
|
path = ./users/home-manager/${name};
|
||||||
extraModules = [
|
extraModules = [
|
||||||
({ pkgs, config, ... }: {
|
({ pkgs, config, ... }: {
|
||||||
# To be able to use the most of our config as possible, we want
|
# To be able to use the most of our config as possible, we want
|
||||||
@ -329,8 +333,11 @@
|
|||||||
path
|
path
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
mkUser { inherit extraModules extraArgs; })
|
mkUser {
|
||||||
(lib'.filesToAttr ./users/home-manager);
|
inherit extraModules extraArgs;
|
||||||
|
system = metadata.system or defaultSystem;
|
||||||
|
})
|
||||||
|
users;
|
||||||
|
|
||||||
# Extending home-manager with my custom modules, if anyone cares.
|
# Extending home-manager with my custom modules, if anyone cares.
|
||||||
homeModules =
|
homeModules =
|
||||||
|
8
users.toml
Normal file
8
users.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# This is project data for deploying home-manager users with this flake. Each
|
||||||
|
# of the users defined here should correspond to one of the home-manager users
|
||||||
|
# at `./users/home-manager/`.
|
||||||
|
[foodogsquared]
|
||||||
|
system = "x86_64-linux"
|
||||||
|
|
||||||
|
[plover]
|
||||||
|
system = "x86_64-linux"
|
Loading…
Reference in New Issue
Block a user