2021-12-21 21:48:41 +00:00
|
|
|
{
|
|
|
|
description = "My deploy-rs config for logos";
|
|
|
|
|
|
|
|
inputs = {
|
2021-12-21 23:02:15 +00:00
|
|
|
agenix.url = "github:ryantm/agenix";
|
2021-12-21 21:48:41 +00:00
|
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
2021-12-21 23:02:15 +00:00
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2021-12-21 21:48:41 +00:00
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2021-12-21 23:02:15 +00:00
|
|
|
outputs = { self, nixpkgs, deploy-rs, home-manager, agenix, ... }:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
|
|
|
mkSystem = extraModules:
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2021-12-21 23:59:45 +00:00
|
|
|
modules = [
|
|
|
|
agenix.nixosModules.age
|
|
|
|
home-manager.nixosModules.home-manager
|
2021-12-22 00:02:15 +00:00
|
|
|
({ config, ... }: {
|
|
|
|
system.configurationRevision = self.sourceInfo.rev;
|
2021-12-22 16:57:09 +00:00
|
|
|
services.getty.greetingLine =
|
|
|
|
"<<< Welcome to NixOS ${config.system.nixos.label} @ ${self.sourceInfo.rev} - \\l >>>";
|
2021-12-22 17:26:40 +00:00
|
|
|
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2021-12-22 00:02:15 +00:00
|
|
|
})
|
2021-12-21 23:59:45 +00:00
|
|
|
] ++ extraModules;
|
2021-12-21 23:02:15 +00:00
|
|
|
};
|
2021-12-21 21:48:41 +00:00
|
|
|
in {
|
|
|
|
devShell.x86_64-linux = pkgs.mkShell {
|
2021-12-21 23:56:26 +00:00
|
|
|
buildInputs = [
|
|
|
|
deploy-rs.packages.x86_64-linux.deploy-rs
|
|
|
|
agenix.packages.x86_64-linux.agenix
|
|
|
|
];
|
2021-12-21 21:48:41 +00:00
|
|
|
};
|
|
|
|
|
2021-12-22 16:57:09 +00:00
|
|
|
nixosConfigurations = {
|
|
|
|
logos = mkSystem [ ./hosts/logos ./hardware/alrest ];
|
|
|
|
|
|
|
|
# vms
|
|
|
|
## logos
|
|
|
|
hugo = mkSystem [ ./hosts/vm/hugo ./hardware/libvirt-generic ];
|
|
|
|
};
|
2021-12-21 21:48:41 +00:00
|
|
|
|
2021-12-21 22:02:29 +00:00
|
|
|
deploy.nodes.logos = {
|
2021-12-21 21:48:41 +00:00
|
|
|
hostname = "192.168.2.35";
|
2021-12-21 22:02:29 +00:00
|
|
|
sshUser = "root";
|
|
|
|
fastConnection = true;
|
|
|
|
|
|
|
|
profiles.system = {
|
|
|
|
user = "root";
|
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
|
|
|
self.nixosConfigurations.logos;
|
|
|
|
};
|
2021-12-21 21:48:41 +00:00
|
|
|
};
|
|
|
|
|
2021-12-22 16:57:09 +00:00
|
|
|
deploy.nodes.hugo = {
|
|
|
|
hostname = "10.77.129.6";
|
|
|
|
sshUser = "root";
|
|
|
|
fastConnection = true;
|
|
|
|
|
|
|
|
profiles.system = {
|
|
|
|
user = "root";
|
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
|
|
|
self.nixosConfigurations.hugo;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-12-21 21:48:41 +00:00
|
|
|
# This is highly advised, and will prevent many possible mistakes
|
|
|
|
checks = builtins.mapAttrs
|
|
|
|
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
|
|
};
|
|
|
|
}
|