nix-infra/flake.nix

64 lines
1.4 KiB
Nix
Raw Normal View History

2023-12-17 13:33:15 +00:00
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2024-03-24 18:02:26 +00:00
outputs =
inputs @ { self
, nixpkgs
, nixpkgs-unstable
, home-manager
, ...
}:
2024-03-24 18:02:27 +00:00
let
mkHost = { hostname, user ? "sammy" }: {
imports = [
./hosts/${hostname}/configuration.nix
./modules
(import "${home-manager}/nixos")
];
deployment = {
targetUser = user;
allowLocalDeployment = true;
};
};
in
2024-03-24 18:02:26 +00:00
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
colmena = {
meta = {
2024-03-24 18:02:27 +00:00
description = "All my NixoS machines";
specialArgs = {
flake = self;
};
2024-03-24 18:02:26 +00:00
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ ];
};
2024-03-24 18:02:23 +00:00
};
2024-03-24 18:02:27 +00:00
bengal = mkHost { hostname = "bengal"; };
2024-03-24 18:02:25 +00:00
2024-03-24 18:02:27 +00:00
maine-coon = mkHost { hostname = "maine-coon"; };
2024-03-24 18:02:26 +00:00
};
nixosConfigurations.test = nixpkgs.lib.nixosSystem {
2024-03-24 18:02:27 +00:00
system = "x86_64-linux";
specialArgs = {
flake = self;
};
2024-03-24 18:02:26 +00:00
modules = [
2024-03-24 18:02:27 +00:00
./modules
2024-03-24 18:02:26 +00:00
./hosts/test-vm/configuration.nix
2024-03-24 18:02:23 +00:00
(import "${home-manager}/nixos")
];
};
2023-12-17 13:33:15 +00:00
};
}