dots/flake.nix
2025-11-11 15:38:51 +02:00

42 lines
1.2 KiB
Nix

{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable/";
nixos-hardware.url = "github:NixOS/nixos-hardware/";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence";
};
outputs =
{ self, nixpkgs, home-manager, impermanence, ... } @ inputs:
let
system = "x86_64-linux";
username = "xory";
mkNixosHost = hostName:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
impermanence.nixosModules.impermanence
./hosts/${hostName}/configuration.nix
./hosts/${hostName}/hardware-configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = import ./hosts/${hostName}/home.nix;
}
];
};
in {
nixosConfigurations = nixpkgs.lib.mapAttrs'
(name: value: {
name = name;
value = mkNixosHost name;
})
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
(builtins.readDir ./hosts));
};
}