nixos-servers/flake.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

2023-11-05 17:43:32 +00:00
{
description = "NixOS definitions for our physical servers";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
2023-11-11 23:04:37 +00:00
deploy-rs.url = "github:serokell/deploy-rs";
2023-11-05 17:43:32 +00:00
};
2023-11-11 23:04:37 +00:00
outputs = { self, nixpkgs, deploy-rs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
deployPkgs = import nixpkgs {
inherit system;
overlays = [
deploy-rs.overlay
(self: super: {
deploy-rs = {
inherit (pkgs) deploy-rs;
lib = super.deploy-rs.lib;
};
})
];
};
in {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
nixosConfigurations.hypervisor = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./configuration.nix ];
2023-11-05 19:11:51 +00:00
};
2023-11-11 23:04:37 +00:00
deploy = {
sshUser = "root";
user = "root";
nodes.jefke = {
hostname = "jefke.hyp";
profiles.hypervisor = {
path = deployPkgs.deploy-rs.lib.activate.nixos
self.nixosConfigurations.hypervisor;
};
};
};
checks = builtins.mapAttrs
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
2023-11-05 17:43:32 +00:00
};
}