73 lines
1.9 KiB
Nix
73 lines
1.9 KiB
Nix
{
|
|
description = "NixOS config";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
flake-programs-sqlite = {
|
|
url = "github:wamserma/flake-programs-sqlite";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nix-gaming = {
|
|
url = "github:fufexan/nix-gaming";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
disko = {
|
|
url = "github:nix-community/disko/latest";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
pwndbg = {
|
|
url = "github:/pwndbg/pwndbg";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
lightly = {
|
|
url = "github:/Bali10050/Darkly";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
nixpkgs,
|
|
home-manager,
|
|
...
|
|
} @ inputs: let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
with builtins;
|
|
with nixpkgs.lib.attrsets; {
|
|
nixosConfigurations = mapAttrs' (host: _: {
|
|
name = host;
|
|
value = nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
specialArgs = {inherit inputs;};
|
|
modules = [(./hosts + "/${host}")];
|
|
};
|
|
}) (readDir ./hosts);
|
|
homeConfigurations = foldl' (a: b: a // b) {} (map (
|
|
host: let
|
|
users = ./hosts + "/${host}/users";
|
|
in
|
|
if pathExists users
|
|
then
|
|
mapAttrs' (user: _: {
|
|
name = "${user}@${host}";
|
|
value = home-manager.lib.homeManagerConfiguration {
|
|
inherit pkgs;
|
|
extraSpecialArgs = {inherit inputs;};
|
|
modules = [(users + "/${user}")];
|
|
};
|
|
}) (readDir users)
|
|
else {}
|
|
) (attrNames (readDir ./hosts)));
|
|
};
|
|
}
|