nixos/flake.nix
Jake Hillion 2b2ebd9e0b
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
tmux: initial configuration
2023-01-11 22:16:11 +00:00

40 lines
1.2 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";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
description = "Hillion Nix flake";
outputs = { self, nixpkgs, nixpkgs-unstable, agenix, home-manager }@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
home-manager.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;
};
}