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

84 lines
2.4 KiB
Nix
Raw Normal View History

2022-03-10 21:52:12 +01:00
{
inputs,
system,
name,
}: let
inherit (inputs) nixpkgs;
pkgs = nixpkgs.legacyPackages.${system};
2022-03-10 21:52:12 +01:00
ensureFiles = paths:
pkgs.runCommand "directory" {} ''
set -efu
mkdir $out
cd $out
${
nixpkgs.lib.concatMapStringsSep "\n" (path: ''
mkdir -p "$(dirname ${nixpkgs.lib.escapeShellArg path})"
echo foo > ${nixpkgs.lib.escapeShellArg path}
'')
paths
}
'';
2021-12-31 16:42:22 +01:00
nixPath = nixpkgs.lib.concatStringsSep ":" ([
2022-03-13 10:31:19 +01:00
"niveum=${toString ./.}"
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
"system-secrets=${systemSecrets}"
"secrets=${sharedSecrets}"
]
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
# cd ~/.password-store/shared && find * -type f | sed 's/.gpg$//'
sharedSecrets = ensureFiles [
"di.fm/key"
"eduroam/identity"
"eduroam/password"
2022-03-12 12:43:35 +01:00
"hass/token"
"mail/cock"
"mail/fastmail"
"mail/gmail/amroplay"
"mail/gmail/kieran.meinhardt"
"mail/meinhaki"
"mail/posteo"
"nextcloud-fysi/password"
"nextcloud/password"
"openweathermap.key"
2022-01-19 13:37:01 +01:00
"restic/password"
"traadfri.key"
"wifi/Aether.psk"
2022-01-17 18:53:26 +01:00
"spotify/username"
"spotify/password"
];
2022-03-10 21:52:12 +01:00
systemSecrets = let
basic = ["retiolum.ed25519" "retiolum.key" "syncthing/cert.pem" "syncthing/key.pem"];
in
{
zaatar = ensureFiles (["moodle.token" "telegram/moodle-dl.token" "mpd-web.key"] ++ basic);
kabsa = ensureFiles basic;
manakish = ensureFiles basic;
2022-03-16 16:04:22 +01:00
tahina = ensureFiles basic;
2022-03-10 21:52:12 +01:00
makanek = ensureFiles ([
2022-03-13 10:31:19 +01:00
"irc/retiolum"
"irc/hackint"
"irc/libera"
"irc/oftc"
"matrix/nibbana"
"maxmind/license.key"
"moodle-dl/faye.token"
"nextcloud/admin"
"nextcloud/database"
"telegram/nachtischsatan.token"
"telegram/reverse.token"
"telegram/odyssey.token"
"telegram/betacode.token"
"telegram/moodle-dl.token"
"telegram/proverb.token"
"telegram/menstruation.token"
"telegram/cool_village.token"
"telegram/kmein.token"
"telegram/prometheus.token"
"weechat/relay"
]
++ basic);
2022-03-10 21:52:12 +01:00
}
.${name};
in
toString (pkgs.writers.writeDash "build" "NIX_PATH=${nixPath} nix-build '<nixpkgs/nixos>' -A system --dry-run")