mirror of
https://github.com/semere-meb/dotfiles-nix.git
synced 2026-08-03 10:24:36 +00:00
59 lines
1.3 KiB
Nix
59 lines
1.3 KiB
Nix
{
|
|
description = "NixOS system flake";
|
|
|
|
inputs = {
|
|
nixpkgs = {
|
|
url = "github:NixOS/nixpkgs/nixos-26.05";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-26.05";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
home-manager,
|
|
...
|
|
}:
|
|
let
|
|
lib = nixpkgs.lib;
|
|
userVars = import ./vars.nix;
|
|
|
|
hostsDir = ./hosts;
|
|
hostNames = builtins.attrNames (
|
|
lib.filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir)
|
|
);
|
|
|
|
nixosConfigurations = lib.genAttrs hostNames (
|
|
name:
|
|
let
|
|
hostConfig = import (./hosts + "/${name}");
|
|
in
|
|
lib.nixosSystem {
|
|
system = hostConfig.system;
|
|
specialArgs = { inherit userVars; };
|
|
modules = [
|
|
hostConfig.configModule
|
|
]
|
|
++ [
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
extraSpecialArgs = { inherit userVars; };
|
|
backupFileExtension = "backup";
|
|
};
|
|
}
|
|
];
|
|
}
|
|
);
|
|
in
|
|
{
|
|
inherit nixosConfigurations;
|
|
};
|
|
}
|