mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
nix: optimize flake.nix for reusability
This commit is contained in:
parent
6b7c6d529d
commit
05d620296e
3 changed files with 42 additions and 46 deletions
|
|
@ -42,32 +42,24 @@
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
|
nixosHosts = [
|
||||||
|
"zp"
|
||||||
|
"zephyrus"
|
||||||
|
"nixvirt"
|
||||||
|
];
|
||||||
|
|
||||||
|
mkNixosSystem =
|
||||||
|
hostname:
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
inherit specialArgs;
|
||||||
|
modules = [ ./hosts/${hostname} ];
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.zp = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
inherit specialArgs;
|
|
||||||
modules = [
|
|
||||||
nix-flatpak.nixosModules.nix-flatpak
|
|
||||||
./hosts/zp
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.zephyrus = nixpkgs.lib.nixosSystem {
|
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
|
||||||
system = "x86_64-linux";
|
|
||||||
inherit specialArgs;
|
|
||||||
modules = [
|
|
||||||
./hosts/zephyrus
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.nixvirt = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
inherit specialArgs;
|
|
||||||
modules = [
|
|
||||||
./hosts/nixvirt
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
|
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
|
||||||
system = "aarch64-darwin";
|
system = "aarch64-darwin";
|
||||||
|
|
@ -76,14 +68,16 @@
|
||||||
./hosts/zen
|
./hosts/zen
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
homeConfigurations.js0ny = home-manager.lib.homeManagerConfiguration {
|
|
||||||
|
homeConfigurations = {
|
||||||
|
js0ny = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = forSystem "x86_64-linux";
|
pkgs = forSystem "x86_64-linux";
|
||||||
extraSpecialArgs = specialArgs;
|
extraSpecialArgs = specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
./users/js0ny
|
./users/js0ny
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
homeConfigurations."js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
|
"js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = forSystem "x86_64-linux";
|
pkgs = forSystem "x86_64-linux";
|
||||||
extraSpecialArgs = specialArgs;
|
extraSpecialArgs = specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
@ -92,7 +86,7 @@
|
||||||
nix-flatpak.homeManagerModules.nix-flatpak
|
nix-flatpak.homeManagerModules.nix-flatpak
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
homeConfigurations."js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
|
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = forSystem "x86_64-linux";
|
pkgs = forSystem "x86_64-linux";
|
||||||
extraSpecialArgs = specialArgs;
|
extraSpecialArgs = specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
@ -100,4 +94,5 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
|
../../modules/nixos/host-machine.nix
|
||||||
# ../../modules/nixos/users/js0ny.nix
|
# ../../modules/nixos/users/js0ny.nix
|
||||||
# ../../modules/nixos/guest.nix
|
# ../../modules/nixos/guest.nix
|
||||||
../../modules/nixos/laptop.nix
|
../../modules/nixos/laptop.nix
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,5 @@
|
||||||
usbutils
|
usbutils
|
||||||
smartmontools
|
smartmontools
|
||||||
v4l-utils
|
v4l-utils
|
||||||
]
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue