chaos-jetzt-nixfiles/flake.nix

64 lines
1.6 KiB
Nix
Raw Normal View History

2022-11-27 23:11:34 +01:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, sops-nix, flake-utils }: let
overlay = import ./packages;
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ overlay ];
};
defaultModules = [
sops-nix.nixosModules.sops
./common/default.nix
{
nixpkgs.overlays = [ overlay ];
_module.args = {
inherit nixpkgs;
# TODO: Change when going to production
# Not sure if this is the best way to do this
baseDomain = "dev.chaos.jetzt";
};
}
];
in {
nixosConfigurations = {
shirley = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/shirley/configuration.nix
];
};
};
colmena = {
meta.nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
defaults = { name, ... }: {
deployment = {
# TODO: It'd probably be nice to derive that from the host-configured fqdn
targetHost = "${name}.net.chaos.jetzt";
targetUser = null;
};
};
} // builtins.mapAttrs (name: host: {
nixpkgs = { inherit (host.config.nixpkgs) system; };
imports = host._module.args.modules;
}) self.nixosConfigurations;
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = with pkgs; [ sops colmena ];
};
overlays.default = overlay;
legacyPackages.x86_64-linux = pkgs;
};
}