mirror of
https://github.com/cupcakearmy/nix-cli.git
synced 2025-12-07 14:25:03 +00:00
add profile name
This commit is contained in:
10
flake.nix
10
flake.nix
@@ -19,10 +19,10 @@
|
||||
profiles = import ./profiles.nix;
|
||||
in
|
||||
{
|
||||
homeConfigurations = nixpkgs.lib.genAttrs (builtins.map (user: user.username) profiles) (
|
||||
user:
|
||||
homeConfigurations = nixpkgs.lib.genAttrs (builtins.map (p: p.name) profiles) (
|
||||
profile:
|
||||
let
|
||||
system = (nixpkgs.lib.findFirst (u: u.username == user) null profiles).architecture;
|
||||
system = (nixpkgs.lib.findFirst (p: p.name == profile) null profiles).architecture;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
@@ -31,8 +31,8 @@
|
||||
modules = [ ./home.nix ];
|
||||
|
||||
extraSpecialArgs = {
|
||||
username = user;
|
||||
homeDirectory = (nixpkgs.lib.findFirst (u: u.username == user) null profiles).homeDirectory;
|
||||
username = (nixpkgs.lib.findFirst (p: p.name == profile) null profiles).username;
|
||||
homeDirectory = (nixpkgs.lib.findFirst (p: p.name == profile) null profiles).homeDirectory;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
12
profiles.nix
12
profiles.nix
@@ -1,21 +1,25 @@
|
||||
[
|
||||
{
|
||||
username = "root_x86_linux";
|
||||
name = "root_x86_linux";
|
||||
username = "root";
|
||||
architecture = "x86_64-linux";
|
||||
homeDirectory = "/root";
|
||||
}
|
||||
{
|
||||
username = "root_x86_macos";
|
||||
name = "root_x86_macos";
|
||||
username = "root";
|
||||
architecture = "x86_64-darwin";
|
||||
homeDirectory = "/root";
|
||||
}
|
||||
{
|
||||
username = "root_arm_linux";
|
||||
name = "root_arm_linux";
|
||||
username = "root";
|
||||
architecture = "aarch64-linux";
|
||||
homeDirectory = "/root";
|
||||
}
|
||||
{
|
||||
username = "root_arm_macos";
|
||||
name = "root_arm_macos";
|
||||
username = "root";
|
||||
architecture = "aarch64-darwin";
|
||||
homeDirectory = "/root";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user