dot_testing/flake.nix

62 lines
1.6 KiB
Nix
Raw Normal View History

2023-12-20 15:19:01 -06:00
{
2024-12-26 16:19:59 -06:00
description = "stupidcomputer's nixos flake";
2023-12-20 15:19:01 -06:00
inputs = {
2024-12-27 02:09:45 -06:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.11";
agenix.url = "github:ryantm/agenix";
2024-12-27 02:09:45 -06:00
deploy-rs.url = "github:serokell/deploy-rs";
2023-12-20 15:19:01 -06:00
};
outputs = {
self,
nixpkgs,
simple-nixos-mailserver,
agenix,
2024-12-27 02:09:45 -06:00
deploy-rs,
2024-03-15 18:51:36 -05:00
...
2024-12-26 16:19:59 -06:00
}@inputs: let
mkSystem = modules:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
machines = import ./lib/machines.nix;
};
inherit modules;
};
generateNixosConfigurations = configurations:
builtins.listToAttrs (
map (name: {
inherit name;
value = mkSystem [
(./boxes/. + "/${name}")
agenix.nixosModules.default
{
environment.systemPackages = [ agenix.packages."x86_64-linux".default ];
}
];
2024-12-26 16:19:59 -06:00
}) configurations
);
in {
2024-12-26 19:12:59 -06:00
nixosConfigurations = generateNixosConfigurations [ "netbox" "copernicus" "aristotle" ];
2024-12-27 02:09:45 -06:00
deploy = {
sshUser = "ryan";
user = "ryan";
sshOpts = [ "-p" "433" ];
autoRollback = false;
magicRollback = false;
nodes = {
"netbox" = {
hostname = "beepboop.systems";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."netbox";
};
};
};
};
2023-12-20 15:19:01 -06:00
};
}