chaos-jetzt-nixfiles/flake.nix
2023-04-13 18:38:10 +02:00

76 lines
2 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
freescout-nix = {
url = "git+https://cyberchaos.dev/e1mo/freescout-nix-flake?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = inputs@{ self, nixpkgs, sops-nix, flake-utils, freescout-nix }: let
overlay = import ./packages;
allOverlays = [
overlay
freescout-nix.overlays.default
];
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = allOverlays;
};
defaultModules = [
sops-nix.nixosModules.sops
freescout-nix.nixosModules.freescout
./common/default.nix
{
nixpkgs.overlays = allOverlays;
_module.args = {
inherit inputs;
outputs = self;
};
}
];
in {
nixosConfigurations = {
shirley = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/shirley/configuration.nix
];
};
goldberg = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/goldberg/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;
};
}