dots/flake.nix
2026-01-04 00:26:00 +02:00

64 lines
1.9 KiB
Nix

# flake.nix
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable/";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
nixos-hardware.url = "github:NixOS/nixos-hardware/";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
impermanence.url = "github:nix-community/impermanence";
};
outputs =
{ self, nixpkgs, nixpkgs-stable, home-manager, impermanence, disko, ... } @ inputs:
let
system = "x86_64-linux";
username = "xory";
opentrack-overlay = import ./overlays/opentrack.nix;
mkNixosHost = hostName:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
pkgs-stable = import nixpkgs-stable {
system = "x86_64-linux";
config.allowUnfree = true;
};
};
modules = [
{ nixpkgs.overlays = [ opentrack-overlay ]; }
disko.nixosModules.disko
impermanence.nixosModules.impermanence
./configuration.nix
./hosts/${hostName}/config.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
# Imports the common home.nix from root
home-manager.users.${username} = import ./home.nix;
}
];
};
in {
nixosConfigurations = nixpkgs.lib.mapAttrs'
(name: value: {
name = name;
value = mkNixosHost name;
})
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
(builtins.readDir ./hosts));
};
}