nixos-configuration/flake.nix

87 lines
2.1 KiB
Nix
Raw Normal View History

2023-12-08 19:07:54 +00:00
{
description = "Colmena hive configuration.";
inputs = {
2023-12-23 21:17:37 +00:00
nixpkgs-23_11 = {
url = "github:NixOS/nixpkgs/nixos-23.11";
};
home-manager-23_11 = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-23_11";
};
sops-nix-23_11 = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs-23_11";
};
2023-12-08 19:07:54 +00:00
};
2023-12-23 21:17:37 +00:00
outputs = { nixpkgs-23_11, home-manager-23_11, sops-nix-23_11, ... }:
2023-12-08 19:07:54 +00:00
let
system = "x86_64-linux";
tapir = {
stateVersion = "23.11";
pkgs = import nixpkgs-23_11 { inherit system; };
2023-12-23 21:17:37 +00:00
home-manager = home-manager-23_11;
sops-nix = sops-nix-23_11;
};
2023-12-08 19:07:54 +00:00
in
{
colmena = {
meta = {
2023-12-23 21:17:37 +00:00
nixpkgs = tapir.pkgs;
2023-12-08 19:07:54 +00:00
specialArgs = { inherit system; };
nodeNixpkgs = {
2023-12-23 21:17:37 +00:00
framework = tapir.pkgs;
deimos = tapir.pkgs;
phobos = tapir.pkgs;
2024-01-10 16:28:31 +00:00
thebe = tapir.pkgs;
};
2023-12-10 18:58:13 +00:00
nodeSpecialArgs = {
framework = {
2023-12-23 21:17:37 +00:00
inherit (tapir) home-manager;
};
deimos = {
inherit (tapir) sops-nix;
};
phobos = {
inherit (tapir) sops-nix;
};
2024-01-10 16:28:31 +00:00
thebe = {
2024-01-10 17:45:12 +00:00
inherit (tapir) sops-nix;
2024-01-10 16:28:31 +00:00
};
2023-12-10 18:58:13 +00:00
};
2023-12-08 19:07:54 +00:00
};
# Local machines. Deploy using `colmena apply-local [--sudo]`
framework = {
imports = [ ./hive/framework ];
2023-12-08 19:07:54 +00:00
deployment = {
allowLocalDeployment = true;
targetHost = null; # Disable SSH deployment.
};
};
# Remote machines. Deploy using `colmena apply`
deimos.imports = [ ./hive/deimos ];
phobos.imports = [ ./hive/phobos ];
2024-01-10 16:28:31 +00:00
thebe.imports = [ ./hive/thebe ];
};
packages.${system}.digital-ocean = {
tapir = import ./digital-ocean {
2023-12-23 21:17:37 +00:00
inherit (tapir) pkgs stateVersion;
};
2023-12-08 19:07:54 +00:00
};
2023-12-12 16:07:30 +00:00
devShells.${system}.default =
let
2023-12-23 21:17:37 +00:00
pkgs = tapir.pkgs;
2023-12-12 16:07:30 +00:00
in
pkgs.mkShell {
packages = with pkgs; [ ssh-to-age sops ];
};
2023-12-08 19:07:54 +00:00
};
}