1
0
Fork 0
server-configuration/flake.nix

50 lines
1.2 KiB
Nix
Raw Normal View History

2025-02-21 05:49:05 +00:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2025-02-21 08:27:04 +00:00
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
2025-02-21 11:41:47 +00:00
srvos.url = "github:numtide/srvos";
srvos.inputs.nixpkgs.follows = "nixpkgs";
2025-02-21 05:49:05 +00:00
};
2025-02-21 11:41:47 +00:00
outputs = inputs@{ flake-parts, nixpkgs, ... }:
2025-02-21 08:30:52 +00:00
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
2025-02-21 11:41:47 +00:00
imports = [
./targets/flake-module.nix
./modules/flake-module.nix
];
2025-02-21 08:30:52 +00:00
perSystem = { system, pkgs, ... }:
2025-02-21 05:49:05 +00:00
let
tofuPkg = pkgs.opentofu.withPlugins (p: [
pkgs.terraform-providers.hcloud
2025-02-21 08:27:04 +00:00
pkgs.terraform-providers.null
pkgs.terraform-providers.external
2025-02-21 11:41:47 +00:00
pkgs.terraform-providers.local
2025-02-21 05:49:05 +00:00
]);
in {
2025-02-21 08:30:52 +00:00
devShells.default = pkgs.mkShell {
2025-02-21 05:49:05 +00:00
buildInputs = [
tofuPkg
pkgs.terraform-ls
2025-02-21 11:41:47 +00:00
pkgs.hcloud
2025-02-21 05:49:05 +00:00
];
2025-02-21 07:49:45 +00:00
shellHook = ''
2025-02-21 11:41:47 +00:00
set -a
source ./.env
set +a
2025-02-21 07:49:45 +00:00
'';
2025-02-21 05:49:05 +00:00
};
2025-02-21 08:30:52 +00:00
};
};
2025-02-21 05:49:05 +00:00
}