1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files
niveum/deploy.nix

69 lines
2.1 KiB
Nix
Raw Normal View History

2019-01-31 23:39:38 +01:00
let
inherit (import ./lib/default.nix) sshPort;
2019-11-26 20:16:57 +01:00
gitFromJson = path:
2020-06-10 17:37:25 +02:00
let object = importJson path;
in {
inherit (object) url;
ref = object.rev;
};
2019-12-27 23:57:12 +01:00
krops = builtins.fetchGit (gitFromJson .versions/krops.json);
2019-01-31 23:39:38 +01:00
lib = import "${krops}/lib";
2020-06-10 17:37:25 +02:00
pkgs = import "${krops}/pkgs" { };
importJson = (import <nixpkgs> { }).lib.importJSON;
2019-01-31 23:39:38 +01:00
2020-10-18 17:28:45 +02:00
regularSystem = { path, name, address }: {
2020-06-10 17:37:25 +02:00
source = lib.evalSource [{
niveum.file = toString ./.;
system.file = toString path;
nixos-config.symlink = "system/configuration.nix";
2019-10-26 13:43:30 +02:00
nixpkgs.git = gitFromJson .versions/nixpkgs.json // { shallow = true; };
nixpkgs-unstable.git = gitFromJson .versions/nixpkgs-unstable.json // { shallow = true; };
2020-06-10 17:37:25 +02:00
home-manager.git = gitFromJson .versions/home-manager.json;
stockholm.git = gitFromJson .versions/stockholm.json;
2021-12-28 14:48:09 +01:00
nix-writers.git = gitFromJson .versions/nix-writers.json;
2020-10-18 17:27:43 +02:00
retiolum.git = gitFromJson .versions/retiolum.json;
2021-06-02 10:27:43 +02:00
nixpkgs-mozilla.git = gitFromJson .versions/nixpkgs-mozilla.json;
2020-09-24 19:25:47 +02:00
system-secrets.pass = {
dir = toString ~/.password-store;
name = "systems/${name}";
2020-06-10 17:37:25 +02:00
};
2020-09-24 19:25:47 +02:00
secrets.pass = {
2020-06-10 17:37:25 +02:00
dir = toString ~/.password-store;
name = "shared";
};
}];
target = "root@${address}:${toString sshPort}";
2019-04-10 21:14:29 +02:00
};
2020-01-18 17:10:47 +01:00
inherit (pkgs.krops) writeDeploy;
2019-06-17 18:01:14 +02:00
in {
2020-10-28 21:56:14 +01:00
zaatar = writeDeploy "deploy-zaatar" (regularSystem {
path = systems/zaatar;
name = "zaatar";
address = "zaatar.r";
2020-10-18 17:28:45 +02:00
});
2021-09-19 09:41:51 +02:00
kabsa = writeDeploy "deploy-kabsa" (regularSystem {
path = systems/kabsa;
name = "kabsa";
address = "kabsa.r";
2020-10-18 17:28:45 +02:00
});
toum = writeDeploy "deploy-toum" (regularSystem {
path = systems/toum;
name = "toum";
address = "toum.r";
}) // {
buildTarget = "${builtins.getEnv "USER"}@localhost/${builtins.getEnv "HOME"}/.cache/krops";
};
2020-10-31 20:51:25 +01:00
makanek = writeDeploy "deploy-makanek" (regularSystem {
path = systems/makanek;
name = "makanek";
2020-11-03 20:18:57 +01:00
address = "makanek.r";
2020-10-31 20:51:25 +01:00
});
2020-11-05 21:28:23 +01:00
manakish = writeDeploy "deploy-manakish" (regularSystem {
path = systems/manakish;
name = "manakish";
2020-11-06 10:52:30 +01:00
address = "manakish.r";
2020-11-05 21:28:23 +01:00
});
2019-01-31 23:39:38 +01:00
}