added stuff
This commit is contained in:
parent
e8d9044d2b
commit
9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions
63
nyx/flake/deployments.nix
Normal file
63
nyx/flake/deployments.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
inputs,
|
||||
self,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
includedNodes = ["enyo" "helios"];
|
||||
mkNode = name: cfg: let
|
||||
inherit (cfg.pkgs.stdenv.hostPlatform) system;
|
||||
deployLib = inputs.deploy-rs.lib.${system};
|
||||
in {
|
||||
# this looks pretty goofy, I should get a simpler domain
|
||||
# it's actually hostname.namespace.domain.tld but my domain and namespace are the same
|
||||
hostname = "${name}.notashelf.notashelf.dev";
|
||||
sshOpts = ["-p" "30"];
|
||||
skipChecks = true;
|
||||
# currently only a single profile system
|
||||
profilesOrder = ["system"];
|
||||
profiles.system = {
|
||||
sshUser = "root";
|
||||
user = "root";
|
||||
path = deployLib.activate.nixos cfg;
|
||||
};
|
||||
};
|
||||
nodes = lib.mapAttrs mkNode (lib.filterAttrs (name: _: lib.elem name includedNodes) self.nixosConfigurations);
|
||||
in {
|
||||
flake = {
|
||||
deploy = {
|
||||
autoRollback = true;
|
||||
magicRollback = true;
|
||||
inherit nodes;
|
||||
};
|
||||
};
|
||||
|
||||
perSystem = {
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
deployPkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.deploy-rs.overlay
|
||||
(_: prev: {
|
||||
deploy-rs = {
|
||||
inherit (pkgs) deploy-rs;
|
||||
inherit (prev.deploy-rs) lib;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
in {
|
||||
# evaluation of deployChecks is slow
|
||||
# checks = (deployPkgs.deploy-rs.lib.deployChecks self.deploy)
|
||||
|
||||
apps.deploy = {
|
||||
type = "app";
|
||||
program = pkgs.writeShellScriptBin "deploy" ''
|
||||
${deployPkgs.deploy-rs.deploy-rs}/bin/deploy --skip-checks
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue