nixos/flake.nix
Jake Hillion f1c6a62468
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
flake: update 11 Jan 2023
2023-01-11 21:08:31 +00:00

36 lines
1.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
};
description = "Hillion Nix flake";
outputs = { self, nixpkgs, nixpkgs-unstable, agenix }@inputs: {
nixosConfigurations =
let
fqdns = builtins.attrNames (builtins.readDir ./hosts);
mkHost = fqdn:
let system = builtins.readFile ./hosts/${fqdn}/system; in
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = inputs;
modules = [
./hosts/${fqdn}/default.nix
agenix.nixosModule
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
];
};
in
nixpkgs.lib.genAttrs fqdns mkHost;
formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".nixpkgs-fmt;
formatter."aarch64-darwin" = nixpkgs.legacyPackages."aarch64-darwin".nixpkgs-fmt;
};
}