mirror of
https://github.com/cupcakearmy/nix-cli.git
synced 2025-12-07 22:35:03 +00:00
Compare commits
3 Commits
01898ecafc
...
88a1e08e52
| Author | SHA1 | Date | |
|---|---|---|---|
| 88a1e08e52 | |||
| a2cb841039 | |||
| 91baaf07d7 |
12
flake.nix
12
flake.nix
@@ -19,10 +19,11 @@
|
|||||||
profiles = import ./profiles.nix;
|
profiles = import ./profiles.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeConfigurations = nixpkgs.lib.genAttrs (builtins.map (user: user.username) profiles) (
|
homeConfigurations = nixpkgs.lib.genAttrs (builtins.map (p: p.name) profiles) (
|
||||||
user:
|
profile:
|
||||||
let
|
let
|
||||||
system = (nixpkgs.lib.findFirst (u: u.username == user) null profiles).architecture;
|
p = (nixpkgs.lib.findFirst (p: p.name == profile) null profiles);
|
||||||
|
system = p.architecture;
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in
|
||||||
home-manager.lib.homeManagerConfiguration {
|
home-manager.lib.homeManagerConfiguration {
|
||||||
@@ -31,8 +32,9 @@
|
|||||||
modules = [ ./home.nix ];
|
modules = [ ./home.nix ];
|
||||||
|
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
username = user;
|
username = p.username;
|
||||||
homeDirectory = (nixpkgs.lib.findFirst (u: u.username == user) null profiles).homeDirectory;
|
homeDirectory = p.homeDirectory;
|
||||||
|
name = p.name;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
3
home.nix
3
home.nix
@@ -2,6 +2,7 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
username,
|
username,
|
||||||
|
name,
|
||||||
homeDirectory,
|
homeDirectory,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
c = "pwd | pbcopy";
|
c = "pwd | pbcopy";
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
vai = "sudo darwin-rebuild switch --flake ~/.config/nix-macos#${username}";
|
hm = "nix run home-manager/master -- switch --flake github:cupcakearmy/nix-cli/v3#${name} -b backup";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
12
profiles.nix
12
profiles.nix
@@ -1,21 +1,25 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
username = "root_x86_linux";
|
name = "root_x86_linux";
|
||||||
|
username = "root";
|
||||||
architecture = "x86_64-linux";
|
architecture = "x86_64-linux";
|
||||||
homeDirectory = "/root";
|
homeDirectory = "/root";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
username = "root_x86_macos";
|
name = "root_x86_macos";
|
||||||
|
username = "root";
|
||||||
architecture = "x86_64-darwin";
|
architecture = "x86_64-darwin";
|
||||||
homeDirectory = "/root";
|
homeDirectory = "/root";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
username = "root_arm_linux";
|
name = "root_arm_linux";
|
||||||
|
username = "root";
|
||||||
architecture = "aarch64-linux";
|
architecture = "aarch64-linux";
|
||||||
homeDirectory = "/root";
|
homeDirectory = "/root";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
username = "root_arm_macos";
|
name = "root_arm_macos";
|
||||||
|
username = "root";
|
||||||
architecture = "aarch64-darwin";
|
architecture = "aarch64-darwin";
|
||||||
homeDirectory = "/root";
|
homeDirectory = "/root";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user