chaos-jetzt-nixfiles/flake.nix

79 lines
2.1 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";
};
2023-01-06 18:29:58 +01:00
freescout-nix = {
url = "git+https://cyberchaos.dev/e1mo/freescout-nix-flake?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
2023-02-18 11:54:34 +01:00
inputs.flake-utils.follows = "flake-utils";
2023-01-06 18:29:58 +01:00
};
2022-11-27 23:11:34 +01:00
};
2023-01-06 18:29:58 +01:00
outputs = inputs@{ self, nixpkgs, sops-nix, flake-utils, freescout-nix }: let
2022-11-27 23:11:34 +01:00
overlay = import ./packages;
2023-01-06 18:29:58 +01:00
allOverlays = [
overlay
freescout-nix.overlays.default
];
2022-11-27 23:11:34 +01:00
pkgs = import nixpkgs {
system = "x86_64-linux";
2023-01-06 18:29:58 +01:00
overlays = allOverlays;
2022-11-27 23:11:34 +01:00
};
defaultModules = [
sops-nix.nixosModules.sops
2023-01-06 18:29:58 +01:00
freescout-nix.nixosModules.freescout
2022-11-27 23:11:34 +01:00
./common/default.nix
{
2023-01-06 18:29:58 +01:00
nixpkgs.overlays = allOverlays;
2022-11-27 23:11:34 +01:00
_module.args = {
inherit inputs;
outputs = self;
2022-11-27 23:11:34 +01:00
};
}
];
in {
nixosConfigurations = {
shirley = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/shirley/configuration.nix
];
};
2022-12-11 16:53:35 +01:00
goldberg = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
./hosts/goldberg/configuration.nix
];
};
2022-11-27 23:11:34 +01:00
};
colmena = {
meta.allowApplyAll = false;
2022-11-27 23:11:34 +01:00
meta.nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
defaults = { name, ... }: {
deployment = {
tags = if name == "shirley" then [ "prod" ] else [ "dev" ];
2022-11-27 23:11:34 +01:00
# 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;
};
}