mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33: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;
|
||||
};
|
||||
specialArgs = { inherit inputs; };
|
||||
nixosHosts = [
|
||||
"zp"
|
||||
"zephyrus"
|
||||
"nixvirt"
|
||||
];
|
||||
|
||||
mkNixosSystem =
|
||||
hostname:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
inherit specialArgs;
|
||||
modules = [ ./hosts/${hostname} ];
|
||||
};
|
||||
|
||||
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 {
|
||||
system = "x86_64-linux";
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/zephyrus
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.nixvirt = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/nixvirt
|
||||
];
|
||||
};
|
||||
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
|
||||
|
||||
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
|
|
@ -76,28 +68,31 @@
|
|||
./hosts/zen
|
||||
];
|
||||
};
|
||||
homeConfigurations.js0ny = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = forSystem "x86_64-linux";
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = [
|
||||
./users/js0ny
|
||||
];
|
||||
};
|
||||
homeConfigurations."js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = forSystem "x86_64-linux";
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = [
|
||||
./users/js0ny/zephyrus.nix
|
||||
plasma-manager.homeModules.plasma-manager
|
||||
nix-flatpak.homeManagerModules.nix-flatpak
|
||||
];
|
||||
};
|
||||
homeConfigurations."js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = forSystem "x86_64-linux";
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = [
|
||||
./users/js0ny/nixvirt.nix
|
||||
];
|
||||
|
||||
homeConfigurations = {
|
||||
js0ny = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = forSystem "x86_64-linux";
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = [
|
||||
./users/js0ny
|
||||
];
|
||||
};
|
||||
"js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = forSystem "x86_64-linux";
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = [
|
||||
./users/js0ny/zephyrus.nix
|
||||
plasma-manager.homeModules.plasma-manager
|
||||
nix-flatpak.homeManagerModules.nix-flatpak
|
||||
];
|
||||
};
|
||||
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = forSystem "x86_64-linux";
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = [
|
||||
./users/js0ny/nixvirt.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
{
|
||||
imports = [
|
||||
../../modules/nixos
|
||||
../../modules/nixos/host-machine.nix
|
||||
# ../../modules/nixos/users/js0ny.nix
|
||||
# ../../modules/nixos/guest.nix
|
||||
../../modules/nixos/laptop.nix
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
usbutils
|
||||
smartmontools
|
||||
v4l-utils
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue