1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: deploy makanek, kabsa

This commit is contained in:
2021-12-30 16:42:02 +01:00
parent 913f60a7f5
commit 5b3aea782b
11 changed files with 49 additions and 40 deletions

View File

@@ -242,7 +242,6 @@ in {
./tmux.nix ./tmux.nix
./traadfri.nix ./traadfri.nix
./unclutter.nix ./unclutter.nix
./version.nix
./vscode.nix ./vscode.nix
./watson.nix ./watson.nix
./zsh.nix ./zsh.nix

View File

@@ -2,7 +2,7 @@
let let
hc = pkgs.callPackage <stockholm/tv/5pkgs/simple/hc.nix> {}; hc = pkgs.callPackage <stockholm/tv/5pkgs/simple/hc.nix> {};
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {}; worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {};
menstruation = pkgs.callPackage <niveum/submodules/menstruation-backend> {}; menstruation = pkgs.callPackage <menstruation-backend> {};
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; }; nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };

View File

@@ -1,4 +0,0 @@
{ lib, config, ... }:
{
environment.etc."niveum/version".text = lib.sources.commitIdFromGitRepo <niveum/.git>;
}

34
flake.lock generated
View File

@@ -72,6 +72,38 @@
"type": "github" "type": "github"
} }
}, },
"menstruation-backend": {
"flake": false,
"locked": {
"lastModified": 1634573652,
"narHash": "sha256-FIj8oCOJO+Wqxr2o5MMqIShvzMJud4iUq3o8y4NIRvw=",
"owner": "kmein",
"repo": "menstruation.rs",
"rev": "dd405fe2acf32441e8ac56e488e689bb1c4bea82",
"type": "github"
},
"original": {
"owner": "kmein",
"repo": "menstruation.rs",
"type": "github"
}
},
"menstruation-telegram": {
"flake": false,
"locked": {
"lastModified": 1634815642,
"narHash": "sha256-q1OTMx5ayNu9ppHJBDUie/ow+BcA5DXnHEm11EY+C4E=",
"owner": "kmein",
"repo": "menstruation-telegram",
"rev": "a34555cf46f02157718b0565b5456348fff54181",
"type": "github"
},
"original": {
"owner": "kmein",
"repo": "menstruation-telegram",
"type": "github"
}
},
"nix-writers": { "nix-writers": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -157,6 +189,8 @@
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"krops": "krops", "krops": "krops",
"menstruation-backend": "menstruation-backend",
"menstruation-telegram": "menstruation-telegram",
"nix-writers": "nix-writers", "nix-writers": "nix-writers",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-mozilla": "nixpkgs-mozilla", "nixpkgs-mozilla": "nixpkgs-mozilla",

View File

@@ -29,6 +29,14 @@
url = "github:mozilla/nixpkgs-mozilla"; url = "github:mozilla/nixpkgs-mozilla";
flake = false; flake = false;
}; };
menstruation-telegram = {
url = "github:kmein/menstruation-telegram";
flake = false;
};
menstruation-backend = {
url = "github:kmein/menstruation.rs";
flake = false;
};
}; };
outputs = outputs =
@@ -36,6 +44,8 @@
, flake-utils , flake-utils
, home-manager , home-manager
, krops , krops
, menstruation-backend
, menstruation-telegram
, nix-writers , nix-writers
, nixpkgs , nixpkgs
, nixpkgs-mozilla , nixpkgs-mozilla
@@ -57,6 +67,8 @@
nix-writers.git = { url = "https://cgit.krebsco.de/nix-writers"; ref = nix-writers.rev; }; nix-writers.git = { url = "https://cgit.krebsco.de/nix-writers"; ref = nix-writers.rev; };
retiolum.git = { url = "https://github.com/krebs/retiolum"; ref = retiolum.rev; }; retiolum.git = { url = "https://github.com/krebs/retiolum"; ref = retiolum.rev; };
nixpkgs-mozilla.git = { url = "https://github.com/mozilla/nixpkgs-mozilla"; ref = nixpkgs-mozilla.rev; }; nixpkgs-mozilla.git = { url = "https://github.com/mozilla/nixpkgs-mozilla"; ref = nixpkgs-mozilla.rev; };
menstruation-telegram.git = { url = "https://github.com/kmein/menstruation-telegram"; ref = menstruation-telegram.rev; };
menstruation-backend.git = { url = "https://github.com/kmein/menstruation.rs"; ref = menstruation-backend.rev; };
system-secrets.pass = { system-secrets.pass = {
dir = toString ~/.password-store; dir = toString ~/.password-store;
@@ -86,33 +98,6 @@
program = toString (pkgs.writers.writeDash "deploy-all" program = toString (pkgs.writers.writeDash "deploy-all"
(nixpkgs.lib.concatMapStringsSep "\n" (script: script.program) (builtins.attrValues deployScripts))); (nixpkgs.lib.concatMapStringsSep "\n" (script: script.program) (builtins.attrValues deployScripts)));
}; };
niveum-status = {
type = "app";
program = let
statusCommand = pkgs.writers.writeDash "niveum-status-one" ''
[ $# -eq 1 ] || {
echo "Please provide a niveum system hostname." >&2
exit 1
}
hostname="$1"
version_file=/etc/niveum/version
if commit_id="$(${pkgs.coreutils}/bin/timeout 2s ${pkgs.openssh}/bin/ssh "$hostname" cat $version_file 2>/dev/null)"; then
${pkgs.git}/bin/git log -1 --oneline "$commit_id"
else
echo offline
fi
'';
in toString (pkgs.writers.writeDash "niveum-status" ''
if [ $# -gt 0 ]; then
systems="$@"
else
systems="$(ls ${toString ./.}/systems)"
fi
${pkgs.parallel}/bin/parallel --line-buffer --tagstring '{}' -q ${statusCommand} '{1}' ::: $systems
'');
};
}; };
nixosConfigurations = {}; nixosConfigurations = {};

View File

@@ -24,7 +24,6 @@ in
<niveum/configs/spacetime.nix> <niveum/configs/spacetime.nix>
<niveum/configs/sshd.nix> <niveum/configs/sshd.nix>
<niveum/configs/telegram-bots> <niveum/configs/telegram-bots>
<niveum/configs/version.nix>
<niveum/modules/retiolum.nix> <niveum/modules/retiolum.nix>
]; ];

View File

@@ -1,7 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
backend = pkgs.callPackage <niveum/submodules/menstruation-backend> {}; backend = pkgs.callPackage <menstruation-backend> {};
telegram = pkgs.callPackage <niveum/submodules/menstruation-telegram> {}; telegram = pkgs.callPackage <menstruation-telegram> {};
backendPort = 8000; backendPort = 8000;
in in
{ {

View File

@@ -19,7 +19,6 @@ in
<niveum/configs/spacetime.nix> <niveum/configs/spacetime.nix>
<niveum/configs/sshd.nix> <niveum/configs/sshd.nix>
<niveum/configs/traadfri.nix> <niveum/configs/traadfri.nix>
<niveum/configs/version.nix>
<niveum/configs/wpa_supplicant.nix> <niveum/configs/wpa_supplicant.nix>
<niveum/modules/retiolum.nix> <niveum/modules/retiolum.nix>
]; ];