diff --git a/flake.lock b/flake.lock index 070d1c9..66b12dc 100644 --- a/flake.lock +++ b/flake.lock @@ -75,11 +75,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1685202362, - "narHash": "sha256-RSfrkXSFWdMosdmIy5bDAOwqTkakLscYro6oYIHidBY=", + "lastModified": 1685346756, + "narHash": "sha256-pZNHeNkBBgi5o2DOT1T8MPHnrpJN+eEfYeqdg2ASjZA=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "078ba6daa8e2e2d8e25a226d65a418b8a85956b3", + "rev": "b3a86952cf14b6f556159eb898eaa7b6ceac4335", "type": "github" }, "original": { @@ -109,6 +109,27 @@ "type": "github" } }, + "images": { + "inputs": { + "nixpkgs": [ + "trucksimulatorbot", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685252271, + "narHash": "sha256-Yytfm4nZFTeF80PP/WVbuDKQp4mvC5qXsUkcZlMbRFo=", + "owner": "therealr5", + "repo": "TruckSimulatorBot-images", + "rev": "3f827365df8f17f549d60e616a945969d059e0d0", + "type": "github" + }, + "original": { + "owner": "therealr5", + "repo": "TruckSimulatorBot-images", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1684264534, @@ -241,11 +262,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1685168767, - "narHash": "sha256-wQgnxz0PdqbyKKpsWl/RU8T8QhJQcHfeC6lh1xRUTfk=", + "lastModified": 1685290091, + "narHash": "sha256-GGQYNZ7POoqPTtXgPOLUuSiHkOKFRWYpCoWUOSeSRoU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e10802309bf9ae351eb27002c85cfdeb1be3b262", + "rev": "4e37b4e55b60fb7d43d2b62deb51032a489bcbe8", "type": "github" }, "original": { @@ -261,11 +282,11 @@ ] }, "locked": { - "lastModified": 1685267951, - "narHash": "sha256-Mf0tAJQYLTbjreDayneXEf//f34hAbySAPwREJq6Gg0=", + "lastModified": 1685304640, + "narHash": "sha256-diFAEedQfEybK7FLpFOoNQFfN/R44yOxQvIVPIYmLvw=", "owner": "therealr5", "repo": "purge", - "rev": "b1c672511a392c716509e284d9013175da6a9feb", + "rev": "49f00c56e7bcf3bc7d84392bb872bfc36d59d95c", "type": "github" }, "original": { @@ -286,7 +307,7 @@ "purge": "purge", "simple-nixos-mailserver": "simple-nixos-mailserver", "sops-nix": "sops-nix", - "trucksimulatorbot-images": "trucksimulatorbot-images" + "trucksimulatorbot": "trucksimulatorbot" } }, "simple-nixos-mailserver": { @@ -333,23 +354,24 @@ "type": "indirect" } }, - "trucksimulatorbot-images": { + "trucksimulatorbot": { "inputs": { + "images": "images", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1685252271, - "narHash": "sha256-Yytfm4nZFTeF80PP/WVbuDKQp4mvC5qXsUkcZlMbRFo=", + "lastModified": 1685359790, + "narHash": "sha256-qeOykz4m3XRgMUExo/PB97omCukd6hFfrvzc2QIYh6A=", "owner": "therealr5", - "repo": "trucksimulatorbot-images", - "rev": "3f827365df8f17f549d60e616a945969d059e0d0", + "repo": "TruckSimulatorBot", + "rev": "b573449efcdbbabdcff3a1c488689e4b3158bbf8", "type": "github" }, "original": { "owner": "therealr5", - "repo": "trucksimulatorbot-images", + "repo": "TruckSimulatorBot", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 94a6357..222781a 100644 --- a/flake.nix +++ b/flake.nix @@ -27,8 +27,8 @@ url = "github:therealr5/purge"; inputs.nixpkgs.follows = "nixpkgs"; }; - trucksimulatorbot-images = { - url = "github:therealr5/trucksimulatorbot-images"; + trucksimulatorbot = { + url = "github:therealr5/TruckSimulatorBot"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -50,7 +50,7 @@ , nix-colors , nixos-hardware , purge - , trucksimulatorbot-images + , trucksimulatorbot , simple-nixos-mailserver , ... }@attrs: { @@ -104,7 +104,7 @@ nix-index-database.nixosModules.nix-index sops-nix.nixosModules.sops purge.nixosModules.default - trucksimulatorbot-images.nixosModules.default + trucksimulatorbot.nixosModules.default simple-nixos-mailserver.nixosModules.default ]; }; diff --git a/hosts/falkenstein-1/default.nix b/hosts/falkenstein-1/default.nix index d1710d3..2ef9ed4 100644 --- a/hosts/falkenstein-1/default.nix +++ b/hosts/falkenstein-1/default.nix @@ -23,23 +23,17 @@ efi.efiSysMountPoint = "/boot/efi"; }; kernelPackages = pkgs.linuxPackages_latest; - #tmpOnTmpfs = true; }; time.timeZone = "Europe/Berlin"; i18n.defaultLocale = "en_US.UTF-8"; - console = { - keyMap = "dvorak"; - }; - virtualisation.docker.enable = true; environment.systemPackages = with pkgs; [ vim wget htop-vim helix - docker-compose lsof ]; programs.git = { @@ -50,6 +44,7 @@ }; }; services.qemuGuest.enable = true; + systemd.services.qemu-guest-agent.path = [ pkgs.shadow ]; # fix root password reset # Enable the OpenSSH daemon. services.openssh = { diff --git a/hosts/falkenstein-1/modules/purge/default.nix b/hosts/falkenstein-1/modules/purge/default.nix index f61004f..3b57572 100644 --- a/hosts/falkenstein-1/modules/purge/default.nix +++ b/hosts/falkenstein-1/modules/purge/default.nix @@ -6,6 +6,10 @@ in sops.secrets."purge/environment".owner = "purge"; services.purge = { enable = true; + discord = { + clientId = "941041925216157746"; + publicKey = "d2945f6130d9b4a8dda8c8bf52db5dee127a82f89c6b8782e84aa8f45f61d402"; + }; environmentFile = config.sops.secrets."purge/environment".path; }; services.nginx.virtualHosts."${domain}" = { diff --git a/hosts/falkenstein-1/modules/trucksimulatorbot/default.nix b/hosts/falkenstein-1/modules/trucksimulatorbot/default.nix index 6a89abb..328c46e 100644 --- a/hosts/falkenstein-1/modules/trucksimulatorbot/default.nix +++ b/hosts/falkenstein-1/modules/trucksimulatorbot/default.nix @@ -1,10 +1,28 @@ -{ config, ... }: +{ config, pkgs, ... }: let domain = "trucksimulatorbot.rfive.de"; in { services.trucksimulatorbot = { - images.enable = true; + enable = true; + listenPort = 9033; + discord = { + clientId = "831052837353816066"; + publicKey = "faa7004a2a5096702f96f3ebeb45c7e8272c119b72c1a0894abc4d76d8cc8bad"; + }; + }; + services.mysql = { + enable = true; + package = pkgs.mariadb; + ensureUsers = [ + { + name = "trucksimulator"; + ensurePermissions = { + "trucksimulator.*" = "ALL PRIVILEGES"; + }; + } + ]; + ensureDatabases = [ "trucksimulator" ]; }; services.nginx.virtualHosts = { "images.${domain}" = { @@ -19,9 +37,8 @@ in forceSSL = true; locations."/invite".return = " 301 https://discord.com/api/oauth2/authorize?client_id=831052837353816066&permissions=262144&scope=bot%20applications.commands"; locations."/" = { - proxyPass = "http://127.0.0.1:9000"; + proxyPass = "http://127.0.0.1:${toString config.services.trucksimulatorbot.listenPort}"; }; }; }; } - diff --git a/secrets/falkenstein-1.yaml b/secrets/falkenstein-1.yaml index 8791606..e0a4f20 100644 --- a/secrets/falkenstein-1.yaml +++ b/secrets/falkenstein-1.yaml @@ -1,5 +1,5 @@ purge: - environment: ENC[AES256_GCM,data:+QIP6MzKi0a6PJxNuQHOYBNW6rWEcoij1KCKwManSBUxEH3ftG5mZYMtd+OIdL5FPa29qxeHPbSU18MhAcAt9KNykKwjfEa1NqFloYrCF7VDUb7TbD//1TeW8/ni4LdcgimRHEGQhlDiymgZB/5kR1wdse4+9uafoLOZJb05cyN9OFWwEOM/LQHaJq0RLcmEIx7OEs0/jXU2boNcAX1tMpfxoiIj5U0P94K6pj5odeo8SYGB0yflYM0O0hSqGkdSG4GihfvTzg2i8w==,iv:VuzQcs6eQukZJ8dCSuL/1LYr6ir18nJVKcALx0Uzcss=,tag:cBPliz+7je0AhJwffSgHVg==,type:str] + environment: ENC[AES256_GCM,data:4qxa4Jod8vFdd5NzHugeRlo5MtEMoUQfbCYhualyfF7RZMms7G/R4OB2RSfv5BekJechU8t8i0+2rHt/c9sVd+JU7Za20bzVqVz7wvMAiZKV,iv:1QesCJz2+tmvrNLIkAhvzMLKQy7IEP7muA7J1ijINI4=,tag:Bn3tIhMm+qOJ764XlAIm/A==,type:str] mail: rouven: ENC[AES256_GCM,data:aUUH36pDczOufIgDKWz3obcQOloKBpydZfXMUDHGrsJ3h8O0kZYFmq389L86PJ2YISTd7Jv8PfUYPdLi3e80UggKh7SdtP/bBw==,iv:XgZNmCR+XZhjMxV6H2mtepqt4YUADG+45m9P8jdLVNY=,tag:p2RNQ7uBNctJqm69kXxTug==,type:str] rspamd: ENC[AES256_GCM,data:Q4V/0aPl9K+ba3aKAZH5Q0lnixIAQBMgPTmMfDP1ZnYAObVc,iv:NBlFpAVBw8az1qEQd+vDmzUHGPMQYuok9MXydHgx8IY=,tag:QptoxnuA+1XB4/0Zd9Yr3Q==,type:str] @@ -18,8 +18,8 @@ sops: NGlZbU8rcWJRbGE5OEFHdUNqZ2xUS2sK/r7qJHfTP0REcM2PYM95XT0onnCYXzam 20BgfynX3PJE2QVcgl8rr7ssuKxESi+tY/1VB0l8Tryxe6hr/p5IVg== -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-05-24T14:54:23Z" - mac: ENC[AES256_GCM,data:33ci4VTHMb9+So3BuITqB5CscTV/X+Ln18uE/NJX9w20FpxxcEVAUumtnXCdKwL2RKyN5217qyfe46eIg7eMV7tvTmg2uTjMqnjeqOrAqp++uUHCFgRccL8X6d7OVFJHDX4tXJBgmb4y6VZkoLyuYNswJut6JsI2jkhvYuTVtsM=,iv:ExpRJJMHK7dsq+ZG9kilQDDJpFtY2OTuk4fG5tLCPT4=,tag:Y6hNdvjNs5WxtH480jdZpw==,type:str] + lastmodified: "2023-05-28T20:06:48Z" + mac: ENC[AES256_GCM,data:hZk9ltfNRKuTm+ePBpU5wKRexlmRd9oEuHRAjZ4kHRbJBEBTeALOcYXgNXu9ws70hZR7do869tdjY+k1Li+cquqgBFTMIs0R+hBmD9q1Tpv0bMEuQ1t3dHEiMvkm/oi19QKpZLDw9SWlwD1mw3J/4a+w/t1dR5PSrt9SWGkV6mU=,iv:DKjVYYyF5to9Bd84fT1Wl58dLs7Il160o210k/tEQaM=,tag:SgGkU0cDr61kYnmgGGkxGw==,type:str] pgp: - created_at: "2023-04-12T15:47:07Z" enc: |-