dogetipbot-telegram: migrate to flake

This commit is contained in:
nyanloutre 2021-10-22 11:06:14 +02:00
parent e30775bb01
commit f7319c3e20
3 changed files with 44 additions and 23 deletions

View File

@ -1,12 +1,31 @@
{ {
"nodes": { "nodes": {
"dogetipbot-telegram": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1634893013,
"narHash": "sha256-6vcnuqNvg49PN+4FePU50CQpdy5dPbj7+58wD7duRlw=",
"owner": "nyanloutre",
"repo": "dogetipbot-telegram",
"rev": "8807fb1a2a8f2d965618e72daf300eba0233327b",
"type": "gitlab"
},
"original": {
"owner": "nyanloutre",
"ref": "master",
"repo": "dogetipbot-telegram",
"type": "gitlab"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1634758644, "lastModified": 1627805549,
"narHash": "sha256-H3UW/msC6wadg28lcgZv2Ge/P7dWxesL6i37a0GOeyM=", "narHash": "sha256-+LHhcpzw6vAxF6q0VSLkZSEGpDC02JN21KM8eUWz+is=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "70904d4a9927a4d6e05c72c4aaac4370e05107f3", "rev": "16bf3980bfa0d8929639be93fa8491ebad9d61ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -47,6 +66,21 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1634758644,
"narHash": "sha256-H3UW/msC6wadg28lcgZv2Ge/P7dWxesL6i37a0GOeyM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "70904d4a9927a4d6e05c72c4aaac4370e05107f3",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-21.05",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1607522989, "lastModified": 1607522989,
"narHash": "sha256-o/jWhOSAlaK7y2M57OIriRt6whuVVocS/T0mG7fd1TI=", "narHash": "sha256-o/jWhOSAlaK7y2M57OIriRt6whuVVocS/T0mG7fd1TI=",
@ -63,7 +97,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "dogetipbot-telegram": "dogetipbot-telegram",
"nixpkgs": "nixpkgs_2",
"nixpkgs-nyanloutre-pysmart": "nixpkgs-nyanloutre-pysmart", "nixpkgs-nyanloutre-pysmart": "nixpkgs-nyanloutre-pysmart",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"simple-nixos-mailserver": "simple-nixos-mailserver" "simple-nixos-mailserver": "simple-nixos-mailserver"
@ -71,7 +106,7 @@
}, },
"simple-nixos-mailserver": { "simple-nixos-mailserver": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {

View File

@ -4,9 +4,10 @@
nixpkgs-unstable.url = "flake:nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "flake:nixpkgs/nixos-unstable";
nixpkgs-nyanloutre-pysmart.url = "github:nyanloutre/nixpkgs/pysmart-init"; nixpkgs-nyanloutre-pysmart.url = "github:nyanloutre/nixpkgs/pysmart-init";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-21.05"; simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-21.05";
dogetipbot-telegram.url = "gitlab:nyanloutre/dogetipbot-telegram/master";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, simple-nixos-mailserver, nixpkgs-nyanloutre-pysmart }: { outputs = { self, nixpkgs, nixpkgs-unstable, simple-nixos-mailserver, dogetipbot-telegram, nixpkgs-nyanloutre-pysmart }: {
nixosConfigurations.loutreos = nixpkgs.lib.nixosSystem { nixosConfigurations.loutreos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
@ -18,6 +19,7 @@
nixpkgs.nixosModules.notDetected nixpkgs.nixosModules.notDetected
"${nixpkgs-unstable}/nixos/modules/services/audio/navidrome.nix" "${nixpkgs-unstable}/nixos/modules/services/audio/navidrome.nix"
simple-nixos-mailserver.nixosModule simple-nixos-mailserver.nixosModule
dogetipbot-telegram.nixosModule
./systems/LoutreOS/configuration.nix ./systems/LoutreOS/configuration.nix
({ pkgs, ... }: { ({ pkgs, ... }: {
systemd.services.ipmihddtemp = { systemd.services.ipmihddtemp = {

View File

@ -675,23 +675,7 @@ in
}; };
}; };
systemd.services.dogetipbot-telegram = let dogetipbot-telegram.enable = true;
dogetipbot-telegram = pkgs.callPackage (pkgs.fetchgit {
url = "https://gitlab.com/nyanloutre/dogetipbot-telegram.git";
rev = "18c875a2e4b98221523818515a1eecb9c5aeb093";
sha256 = "0mhv00y1c2py425wxl13if6nlv97xk5k6flf772jj1yaxipjdmpn";
}) { inherit pkgs; };
in {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
script = "${dogetipbot-telegram}/bin/dogetipbot-telegram --db-path $STATE_DIRECTORY/users.db";
enable = true;
serviceConfig = {
EnvironmentFile = "/mnt/secrets/dogetipbot-telegram_env";
DynamicUser = true;
StateDirectory = "dogetipbot";
};
};
# systemd.services.minecraft-overviewer = # systemd.services.minecraft-overviewer =
# let # let