use nixosConfigurations and colmena combined. TODO check deployment
This commit is contained in:
parent
de3cd75244
commit
fe8045ee55
1 changed files with 93 additions and 77 deletions
154
flake.nix
154
flake.nix
|
|
@ -38,93 +38,109 @@
|
|||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
myModule = {
|
||||
imports = [ ./modules ];
|
||||
};
|
||||
|
||||
proxmoxModule = {
|
||||
imports = [
|
||||
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||
./modules/virtualisation/proxmox.nix
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
# used with: `nix fmt`
|
||||
formatter.${system} = pkgs.nixfmt-rfc-style;
|
||||
|
||||
colmena = {
|
||||
meta = {
|
||||
nixpkgs = pkgs;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
|
||||
defaults = {
|
||||
imports = [
|
||||
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||
./modules
|
||||
];
|
||||
};
|
||||
|
||||
# childnixos = {
|
||||
# deployment = {
|
||||
# targetHost = "10.233.244.63";
|
||||
# targetPort = 22;
|
||||
# targetUser = "root";
|
||||
# };
|
||||
|
||||
# imports = [ ./lxc-nix/configuration.nix ];
|
||||
# };
|
||||
|
||||
arr = {
|
||||
deployment = {
|
||||
targetHost = "192.168.1.189";
|
||||
targetPort = 22;
|
||||
targetUser = "root";
|
||||
};
|
||||
|
||||
imports = [ ./hosts/arr ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
nixosConfigurations =
|
||||
let
|
||||
mkNixosConfiguration =
|
||||
name: extraModules:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
nixosConfigurations.deadbeef = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
modules = [
|
||||
myModule
|
||||
./hosts/deadbeef
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.arr = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
myModule
|
||||
proxmoxModule
|
||||
./hosts/arr
|
||||
];
|
||||
};
|
||||
|
||||
colmena =
|
||||
{
|
||||
networking.hostName = name;
|
||||
nixpkgs.overlays = [ (_: _: { nixfiles = self.packages.${system}; }) ];
|
||||
# sops.defaultSopsFile = ./hosts + "/${name}" + /secrets.yaml;
|
||||
meta = {
|
||||
description = "pazpi.top infrastructure";
|
||||
nixpkgs = import nixpkgs { inherit system; };
|
||||
};
|
||||
}
|
||||
./modules
|
||||
(./hosts + "/${name}")
|
||||
# (./hosts + "/${name}" + /hardware.nix)
|
||||
# sops-nix.nixosModules.sops
|
||||
] ++ extraModules;
|
||||
};
|
||||
in
|
||||
{
|
||||
deadbeef = mkNixosConfiguration "deadbeef" [ ];
|
||||
# nyarlathotep = mkNixosConfiguration "nyarlathotep" [ "${nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ];
|
||||
};
|
||||
// builtins.mapAttrs (name: value: {
|
||||
nixpkgs.system = value.config.nixpkgs.system;
|
||||
imports = value._module.args.modules;
|
||||
deployment = {
|
||||
targetHost = "${name}.nixos.org";
|
||||
};
|
||||
}) self.nixosConfigurations;
|
||||
|
||||
# nixosConfigurations = {
|
||||
# colmena = {
|
||||
# meta = {
|
||||
# nixpkgs = pkgs;
|
||||
# specialArgs = {
|
||||
# inherit inputs;
|
||||
# };
|
||||
# };
|
||||
|
||||
# deadbeef = nixpkgs.lib.nixosSystem {
|
||||
# # inherit system;
|
||||
# system = "x86_64-linux";
|
||||
# specialArgs = { inherit inputs; };
|
||||
|
||||
# modules = [
|
||||
# {
|
||||
# networking.hostName = "deadbeef";
|
||||
# nixpkgs.overlays = [ (_: _: { nixfiles = self.packages."x86_64-linux"; }) ];
|
||||
# }
|
||||
# ./hosts/deadbeef
|
||||
# defaults = {
|
||||
# imports = [
|
||||
# "${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
||||
# ./modules
|
||||
# ./modules/virtualisation/proxmox.nix
|
||||
# ];
|
||||
# };
|
||||
|
||||
# # childnixos = {
|
||||
# # deployment = {
|
||||
# # targetHost = "10.233.244.63";
|
||||
# # targetPort = 22;
|
||||
# # targetUser = "root";
|
||||
# # };
|
||||
|
||||
# # imports = [ ./lxc-nix/configuration.nix ];
|
||||
# # };
|
||||
|
||||
# arr = {
|
||||
# deployment = {
|
||||
# targetHost = "192.168.1.189";
|
||||
# targetPort = 22;
|
||||
# targetUser = "pazpi";
|
||||
# };
|
||||
|
||||
# time.timeZone = "Europe/Rome";
|
||||
# imports = [ ./hosts/arr ];
|
||||
# };
|
||||
|
||||
# };
|
||||
# };
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
agenix.packages.${system}.agenix
|
||||
colmena.packages.${system}.colmena
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue