diff --git a/hosts/vps/mailserver/default.nix b/hosts/vps/mailserver/default.nix deleted file mode 100644 index fd9fd3e..0000000 --- a/hosts/vps/mailserver/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ pkgs, ... }: { - - fileSystems."/mnt/export1981" = { - device = "172.16.128.47:/nas/5490"; - fsType = "nfs"; - options = [ "nofail" ]; - }; - - users = { - users.ivand = { - isNormalUser = true; - hashedPassword = - "$2b$05$hPrPcewxj4qjLCRQpKBAu.FKvKZdIVlnyn4uYsWE8lc21Jhvc9jWG"; - extraGroups = [ "wheel" "adm" "mlocate" ]; - openssh.authorizedKeys.keys = [ - '' - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcLkzuCoBEg+wq/H+hkrv6pLJ8J5BejaNJVNnymlnlo ivan@idimitrov.dev - '' - ]; - }; - extraGroups = { mlocate = { }; }; - }; - - services = { - openssh = { - enable = true; - settings = { - PermitRootLogin = "prohibit-password"; - }; - }; - }; - systemd = { - timers = { - bingwp = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*-*-* 10:00:00"; - Persistent = true; - }; - }; - }; - services = { - bingwp = { - description = "Download bing image of the day"; - script = '' - ${pkgs.nushell}/bin/nu -c "http get ('https://bing.com' + ((http get https://www.bing.com/HPImageArchive.aspx?format=js&n=1).images.0.url)) | save ('/var/pic' | path join ( [ (date now | format date '%Y-%m-%d'), '.png' ] | str join ))" - ${pkgs.nushell}/bin/nu -c "${pkgs.toybox}/bin/ln -sf (ls /var/pic | where type == file | get name | sort | last) /var/pic/latest.png" - ''; - }; - }; - }; -} diff --git a/nixos/configs/default.nix b/nixos/configs/default.nix index f65226b..1638521 100644 --- a/nixos/configs/default.nix +++ b/nixos/configs/default.nix @@ -22,7 +22,7 @@ in nova-nonya = novaConfig (with mods; [ ivand anon cryptocurrency ]); nova-ai = novaConfig (with mods; [ ivand ai ]); install-iso = configWithModules { modules = (with mods; [ grub base shell wireless ]); }; - vps = configWithModules { modules = (with mods; [ base shell security vps mailserver nginx wireguard-output anonymous-dns firewall ]); }; + vps = configWithModules { modules = (with mods; [ base shell security vps mailserver nginx wireguard-output anonymous-dns firewall rest ]); }; stara-miner = configWithModules { modules = (essential ++ [ mods.monero-miner ]); }; }; } diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index af23cea..8d3ad33 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -252,7 +252,6 @@ top@{ inputs, moduleWithSystem, ... }: { vps = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { imports = [ inputs.vpsadminos.nixosConfigurations.container - ../../hosts/vps/mailserver ]; }); mailserver = moduleWithSystem (toplevel@{ ... }: perSystem@{ config, pkgs, ... }: { @@ -517,5 +516,54 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); + rest = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + fileSystems."/mnt/export1981" = { + device = "172.16.128.47:/nas/5490"; + fsType = "nfs"; + options = [ "nofail" ]; + }; + users = { + users.ivand = { + isNormalUser = true; + hashedPassword = + "$2b$05$hPrPcewxj4qjLCRQpKBAu.FKvKZdIVlnyn4uYsWE8lc21Jhvc9jWG"; + extraGroups = [ "wheel" "adm" "mlocate" ]; + openssh.authorizedKeys.keys = [ + '' + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcLkzuCoBEg+wq/H+hkrv6pLJ8J5BejaNJVNnymlnlo ivan@idimitrov.dev + '' + ]; + }; + extraGroups = { mlocate = { }; }; + }; + services = { + openssh = { + enable = true; + settings = { + PermitRootLogin = "prohibit-password"; + }; + }; + }; + systemd = { + timers = { + bingwp = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "*-*-* 10:00:00"; + Persistent = true; + }; + }; + }; + services = { + bingwp = { + description = "Download bing image of the day"; + script = '' + ${pkgs.nushell}/bin/nu -c "http get ('https://bing.com' + ((http get https://www.bing.com/HPImageArchive.aspx?format=js&n=1).images.0.url)) | save ('/var/pic' | path join ( [ (date now | format date '%Y-%m-%d'), '.png' ] | str join ))" + ${pkgs.nushell}/bin/nu -c "${pkgs.toybox}/bin/ln -sf (ls /var/pic | where type == file | get name | sort | last) /var/pic/latest.png" + ''; + }; + }; + }; + }); }; }