From 23cc6752ab014624e593231d687b93e6f2c2b76c Mon Sep 17 00:00:00 2001 From: nx2 Date: Sun, 17 Mar 2024 12:46:31 +0100 Subject: [PATCH] working on meli, bunch of stuff --- configuration.nix | 4 +- flake.lock | 18 +- flake.nix | 9 +- home-modules/discord.nix | 491 ++++++++++++++++++ home-modules/gestures.nix | 17 +- home-modules/git.nix | 18 + home-modules/mako.nix | 12 + home-modules/meli/meli.nix | 22 + home-modules/meli/oauth2.py | 370 +++++++++++++ home-modules/mutt/neomutt.nix | 23 +- home-modules/neomutt.nix | 84 --- home-modules/pnx.nix | 30 -- home-modules/shell/zoxide.nix | 11 + home-modules/vscode.nix | 1 + home.nix | 57 +- secrets/passwords-and-certificates.nix | Bin 1547 -> 1580 bytes ..._rdp_srv-phoe3-vmdms_192-168-1-104.remmina | Bin 1508 -> 0 bytes ...nx_rdp_srv-phoenix-3_192-168-1-108.remmina | Bin 1507 -> 0 bytes ...pnx_rdp_srv-phoenix2_192-168-1-101.remmina | Bin 1507 -> 0 bytes .../pnx_rdp_srv-remote_192-168-1-21.remmina | Bin 1444 -> 0 bytes system-modules/health_reminder.nix | 61 +++ 21 files changed, 1066 insertions(+), 162 deletions(-) create mode 100644 home-modules/discord.nix create mode 100644 home-modules/mako.nix create mode 100644 home-modules/meli/meli.nix create mode 100644 home-modules/meli/oauth2.py delete mode 100644 home-modules/neomutt.nix delete mode 100644 home-modules/pnx.nix create mode 100644 home-modules/shell/zoxide.nix delete mode 100644 secrets/pnx-vpn/pnx_rdp_srv-phoe3-vmdms_192-168-1-104.remmina delete mode 100644 secrets/pnx-vpn/pnx_rdp_srv-phoenix-3_192-168-1-108.remmina delete mode 100644 secrets/pnx-vpn/pnx_rdp_srv-phoenix2_192-168-1-101.remmina delete mode 100644 secrets/pnx-vpn/pnx_rdp_srv-remote_192-168-1-21.remmina create mode 100644 system-modules/health_reminder.nix diff --git a/configuration.nix b/configuration.nix index 5ab2082..7d2d580 100644 --- a/configuration.nix +++ b/configuration.nix @@ -13,6 +13,7 @@ ./system-modules/ollama.nix ./system-modules/hsmw.nix + ./system-modules/health_reminder.nix ]; @@ -63,6 +64,7 @@ services.openssh.enable = false; + # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ @@ -110,4 +112,4 @@ programs.bash.shellInit = '' source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh ''; -} \ No newline at end of file +} diff --git a/flake.lock b/flake.lock index 3c8d0f6..765610d 100644 --- a/flake.lock +++ b/flake.lock @@ -36,10 +36,26 @@ "type": "indirect" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1710272261, + "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 815aa3b..d9f602f 100644 --- a/flake.nix +++ b/flake.nix @@ -3,18 +3,21 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-23.11"; + nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, home-manager, ... }: + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; user = "nx2"; + pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; allowed = { unfree-packages = [ "spotify" + "discord" "obsidian" "zoom-us" ]; @@ -39,9 +42,9 @@ nx2 = home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ ./home.nix ]; - extraSpecialArgs = {inherit system user allowed secrets;}; + extraSpecialArgs = {inherit system user allowed secrets pkgs-unstable;}; }; }; }; -} \ No newline at end of file +} diff --git a/home-modules/discord.nix b/home-modules/discord.nix new file mode 100644 index 0000000..96febbe --- /dev/null +++ b/home-modules/discord.nix @@ -0,0 +1,491 @@ +{ config, pkgs, pkgs-unstable, allowed, ... }: +{ + home.packages = [ + pkgs-unstable.vesktop + ]; + + home.file.".config/vesktop/settings/settings.json".text = '' + { + "notifyAboutUpdates": true, + "autoUpdate": false, + "autoUpdateNotification": true, + "useQuickCss": true, + "themeLinks": [ + "https://luckfire.github.io/amoled-cord/src/amoled-cord.css" + ], + "enabledThemes": [], + "enableReactDevtools": false, + "frameless": false, + "transparent": true, + "winCtrlQ": false, + "macosTranslucency": false, + "disableMinSize": false, + "winNativeTitleBar": false, + "plugins": { + "BadgeAPI": { + "enabled": true + }, + "CommandsAPI": { + "enabled": true + }, + "ContextMenuAPI": { + "enabled": true + }, + "MemberListDecoratorsAPI": { + "enabled": false + }, + "MessageAccessoriesAPI": { + "enabled": false + }, + "MessageDecorationsAPI": { + "enabled": false + }, + "MessageEventsAPI": { + "enabled": false + }, + "MessagePopoverAPI": { + "enabled": false + }, + "NoticesAPI": { + "enabled": true + }, + "ServerListAPI": { + "enabled": false + }, + "NoTrack": { + "enabled": true + }, + "Settings": { + "enabled": true, + "settingsLocation": "aboveActivity" + }, + "SupportHelper": { + "enabled": true + }, + "ChatInputButtonAPI": { + "enabled": false + }, + "AlwaysAnimate": { + "enabled": true + }, + "AlwaysTrust": { + "enabled": true + }, + "AnonymiseFileNames": { + "enabled": false + }, + "WebRichPresence (arRPC)": { + "enabled": false + }, + "BANger": { + "enabled": false + }, + "BetterFolders": { + "enabled": false + }, + "BetterGifAltText": { + "enabled": false + }, + "BetterGifPicker": { + "enabled": false + }, + "BetterNotesBox": { + "enabled": false + }, + "BetterRoleDot": { + "enabled": false + }, + "BetterUploadButton": { + "enabled": false + }, + "BiggerStreamPreview": { + "enabled": false + }, + "BlurNSFW": { + "enabled": false + }, + "CallTimer": { + "enabled": false + }, + "ClearURLs": { + "enabled": false + }, + "ClientTheme": { + "enabled": false + }, + "ColorSighted": { + "enabled": false + }, + "ConsoleShortcuts": { + "enabled": false + }, + "CopyUserURLs": { + "enabled": false + }, + "CrashHandler": { + "enabled": true + }, + "CustomRPC": { + "enabled": false + }, + "Dearrow": { + "enabled": false + }, + "Decor": { + "enabled": false + }, + "DisableCallIdle": { + "enabled": false + }, + "EmoteCloner": { + "enabled": false + }, + "Experiments": { + "enabled": false + }, + "F8Break": { + "enabled": false + }, + "FakeNitro": { + "enabled": false + }, + "FakeProfileThemes": { + "enabled": true + }, + "FavoriteEmojiFirst": { + "enabled": false + }, + "FavoriteGifSearch": { + "enabled": false + }, + "FixCodeblockGap": { + "enabled": false + }, + "FixSpotifyEmbeds": { + "enabled": false + }, + "FixYoutubeEmbeds": { + "enabled": false + }, + "ForceOwnerCrown": { + "enabled": false + }, + "FriendInvites": { + "enabled": false + }, + "GameActivityToggle": { + "enabled": false + }, + "GifPaste": { + "enabled": false + }, + "GreetStickerPicker": { + "enabled": false + }, + "HideAttachments": { + "enabled": false + }, + "iLoveSpam": { + "enabled": false + }, + "IgnoreActivities": { + "enabled": false + }, + "ImageZoom": { + "enabled": false + }, + "InvisibleChat": { + "enabled": false + }, + "KeepCurrentChannel": { + "enabled": false + }, + "LastFMRichPresence": { + "enabled": false + }, + "LoadingQuotes": { + "enabled": false + }, + "MemberCount": { + "enabled": false + }, + "MessageClickActions": { + "enabled": false + }, + "MessageLinkEmbeds": { + "enabled": false + }, + "MessageLogger": { + "enabled": false + }, + "MessageTags": { + "enabled": false + }, + "MoreCommands": { + "enabled": false + }, + "MoreKaomoji": { + "enabled": false + }, + "MoreUserTags": { + "enabled": false + }, + "Moyai": { + "enabled": false + }, + "MutualGroupDMs": { + "enabled": false + }, + "NewGuildSettings": { + "enabled": false + }, + "NoBlockedMessages": { + "enabled": false + }, + "NoDevtoolsWarning": { + "enabled": false + }, + "NoF1": { + "enabled": false + }, + "NoMosaic": { + "enabled": false + }, + "NoPendingCount": { + "enabled": false + }, + "NoProfileThemes": { + "enabled": false + }, + "NoReplyMention": { + "enabled": false + }, + "NoScreensharePreview": { + "enabled": false + }, + "NoTypingAnimation": { + "enabled": false + }, + "NoUnblockToJump": { + "enabled": false + }, + "NormalizeMessageLinks": { + "enabled": false + }, + "NotificationVolume": { + "enabled": false + }, + "NSFWGateBypass": { + "enabled": false + }, + "OnePingPerDM": { + "enabled": false + }, + "oneko": { + "enabled": false + }, + "OpenInApp": { + "enabled": false + }, + "Party mode 🎉": { + "enabled": false + }, + "PermissionFreeWill": { + "enabled": false + }, + "PermissionsViewer": { + "enabled": false + }, + "petpet": { + "enabled": false + }, + "PictureInPicture": { + "enabled": false + }, + "PinDMs": { + "enabled": false + }, + "PlainFolderIcon": { + "enabled": false + }, + "PlatformIndicators": { + "enabled": false + }, + "PreviewMessage": { + "enabled": false + }, + "PronounDB": { + "enabled": false + }, + "QuickMention": { + "enabled": false + }, + "QuickReply": { + "enabled": false + }, + "ReactErrorDecoder": { + "enabled": false + }, + "ReadAllNotificationsButton": { + "enabled": false + }, + "RelationshipNotifier": { + "enabled": false + }, + "RevealAllSpoilers": { + "enabled": false + }, + "ReverseImageSearch": { + "enabled": false + }, + "ReviewDB": { + "enabled": false + }, + "RoleColorEverywhere": { + "enabled": true + }, + "SearchReply": { + "enabled": false + }, + "SecretRingToneEnabler": { + "enabled": false + }, + "SendTimestamps": { + "enabled": false + }, + "ServerListIndicators": { + "enabled": false + }, + "ServerProfile": { + "enabled": false + }, + "ShikiCodeblocks": { + "enabled": false + }, + "ShowAllMessageButtons": { + "enabled": false + }, + "ShowConnections": { + "enabled": false + }, + "ShowHiddenChannels": { + "enabled": false + }, + "ShowMeYourName": { + "enabled": false + }, + "ShowTimeouts": { + "enabled": false + }, + "SilentMessageToggle": { + "enabled": false + }, + "SilentTyping": { + "enabled": false + }, + "SortFriendRequests": { + "enabled": false + }, + "SpotifyControls": { + "enabled": false + }, + "SpotifyCrack": { + "enabled": false + }, + "SpotifyShareCommands": { + "enabled": false + }, + "StartupTimings": { + "enabled": false + }, + "SuperReactionTweaks": { + "enabled": false + }, + "TextReplace": { + "enabled": false + }, + "ThemeAttributes": { + "enabled": false + }, + "TimeBarAllActivities": { + "enabled": false + }, + "Translate": { + "enabled": false + }, + "TypingIndicator": { + "enabled": false + }, + "TypingTweaks": { + "enabled": false + }, + "Unindent": { + "enabled": false + }, + "UnsuppressEmbeds": { + "enabled": false + }, + "UrbanDictionary": { + "enabled": false + }, + "UserVoiceShow": { + "enabled": false + }, + "USRBG": { + "enabled": false + }, + "ValidUser": { + "enabled": false + }, + "VoiceChatDoubleClick": { + "enabled": false + }, + "VcNarrator": { + "enabled": false + }, + "VencordToolbox": { + "enabled": false + }, + "ViewIcons": { + "enabled": false + }, + "ViewRaw": { + "enabled": false + }, + "VoiceMessages": { + "enabled": false + }, + "WebContextMenus": { + "enabled": true, + "addBack": true + }, + "WebKeybinds": { + "enabled": true + }, + "WhoReacted": { + "enabled": false + }, + "Wikisearch": { + "enabled": false + }, + "XSOverlay": { + "enabled": false + } + }, + "notifications": { + "timeout": 5000, + "position": "bottom-right", + "useNative": "not-focused", + "logLimit": 50 + }, + "cloud": { + "authenticated": false, + "url": "https://api.vencord.dev/", + "settingsSync": false, + "settingsSyncVersion": 1710459223618 + } + } + ''; +} + + diff --git a/home-modules/gestures.nix b/home-modules/gestures.nix index 57e3339..9f4ef4c 100644 --- a/home-modules/gestures.nix +++ b/home-modules/gestures.nix @@ -13,5 +13,20 @@ # Gestures gesture swipe left 3 echo key k:276 | dotool gesture swipe right 3 echo key k:275 | dotool -''; + ''; + # systemd.user.services = { + # ydotoold = { + # Unit = { + # Description = "An auto-input utility for wayland"; + # Documentation = [ "man:ydotool(1)" "man:ydotoold(8)" ]; + # }; + + # Service = { + # ExecStart = "/run/current-system/sw/bin/ydotoold --socket-path /tmp/ydotool_socket "; + # }; + # Install = { + # WantedBy = ["default.target"]; + # }; + # }; + # }; } \ No newline at end of file diff --git a/home-modules/git.nix b/home-modules/git.nix index e69de29..5ba3ed4 100644 --- a/home-modules/git.nix +++ b/home-modules/git.nix @@ -0,0 +1,18 @@ +{ config, pkgs, lib, system, user, allowed, secrets, ... }: + +{ + programs.git = { + enable = true; + userName = "nx2"; + userEmail = "nx2@nx2.site"; + delta = { + enable = true; + options = { + line-numbers = true; + side-by-side = false; + features = "unobtrusive-line-numbers decorations"; + whitespace-error-style = "22 reverse"; + }; + }; + }; +} \ No newline at end of file diff --git a/home-modules/mako.nix b/home-modules/mako.nix new file mode 100644 index 0000000..458a53f --- /dev/null +++ b/home-modules/mako.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + home.packages = [ + pkgs.mako + pkgs.libnotify + ]; + services.mako = { + enable = true; + defaultTimeout = 60000; + }; +} \ No newline at end of file diff --git a/home-modules/meli/meli.nix b/home-modules/meli/meli.nix new file mode 100644 index 0000000..45d81fa --- /dev/null +++ b/home-modules/meli/meli.nix @@ -0,0 +1,22 @@ +{ config, pkgs, lib, system, user, allowed, secrets, ... }: + +{ + home.packages = [ + pkgs.meli + pkgs.msmtp + pkgs.w3m + + # (pkgs.writeScriptBin "mutt_oauth" (builtins.readFile ./mutt_oauth2.py)) + + ]; + + + + + home.file.".config/meli.config" = { + + } +} + + + diff --git a/home-modules/meli/oauth2.py b/home-modules/meli/oauth2.py new file mode 100644 index 0000000..97df793 --- /dev/null +++ b/home-modules/meli/oauth2.py @@ -0,0 +1,370 @@ +#!/usr/bin/env python3 +# +# Copyright 2012 Google Inc. +# Copyright 2020 Manos Pitsidianakis +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Performs client tasks for testing IMAP OAuth2 authentication. + +To use this script, you'll need to have registered with Google as an OAuth +application and obtained an OAuth client ID and client secret. +See https://developers.google.com/identity/protocols/OAuth2 for instructions on +registering and for documentation of the APIs invoked by this code. + +This script has 3 modes of operation. + +1. The first mode is used to generate and authorize an OAuth2 token, the +first step in logging in via OAuth2. + + oauth2 --user=xxx@gmail.com \ + --client_id=1038[...].apps.googleusercontent.com \ + --client_secret=VWFn8LIKAMC-MsjBMhJeOplZ \ + --generate_oauth2_token + +The script will converse with Google and generate an oauth request +token, then present you with a URL you should visit in your browser to +authorize the token. Once you get the verification code from the Google +website, enter it into the script to get your OAuth access token. The output +from this command will contain the access token, a refresh token, and some +metadata about the tokens. The access token can be used until it expires, and +the refresh token lasts indefinitely, so you should record these values for +reuse. + +2. The script will generate new access tokens using a refresh token. + + oauth2 --user=xxx@gmail.com \ + --client_id=1038[...].apps.googleusercontent.com \ + --client_secret=VWFn8LIKAMC-MsjBMhJeOplZ \ + --refresh_token=1/Yzm6MRy4q1xi7Dx2DuWXNgT6s37OrP_DW_IoyTum4YA + +3. The script will generate an OAuth2 string that can be fed +directly to IMAP or SMTP. This is triggered with the --generate_oauth2_string +option. + + oauth2 --generate_oauth2_string --user=xxx@gmail.com \ + --access_token=ya29.AGy[...]ezLg + +The output of this mode will be a base64-encoded string. To use it, connect to a +IMAPFE and pass it as the second argument to the AUTHENTICATE command. + + a AUTHENTICATE XOAUTH2 a9sha9sfs[...]9dfja929dk== +""" + +import base64 +import imaplib +import json +from optparse import OptionParser +import smtplib +import sys +import urllib.request, urllib.parse, urllib.error + + +def SetupOptionParser(): + # Usage message is the module's docstring. + parser = OptionParser(usage=__doc__) + parser.add_option( + "--generate_oauth2_token", + action="store_true", + dest="generate_oauth2_token", + help="generates an OAuth2 token for testing", + ) + parser.add_option( + "--generate_oauth2_string", + action="store_true", + dest="generate_oauth2_string", + help="generates an initial client response string for " "OAuth2", + ) + parser.add_option( + "--client_id", + default=None, + help="Client ID of the application that is authenticating. " + "See OAuth2 documentation for details.", + ) + parser.add_option( + "--client_secret", + default=None, + help="Client secret of the application that is " + "authenticating. See OAuth2 documentation for " + "details.", + ) + parser.add_option("--access_token", default=None, help="OAuth2 access token") + parser.add_option("--refresh_token", default=None, help="OAuth2 refresh token") + parser.add_option( + "--scope", + default="https://mail.google.com/", + help="scope for the access token. Multiple scopes can be " + "listed separated by spaces with the whole argument " + "quoted.", + ) + parser.add_option( + "--test_imap_authentication", + action="store_true", + dest="test_imap_authentication", + help="attempts to authenticate to IMAP", + ) + parser.add_option( + "--test_smtp_authentication", + action="store_true", + dest="test_smtp_authentication", + help="attempts to authenticate to SMTP", + ) + parser.add_option( + "--user", + default=None, + help="email address of user whose account is being " "accessed", + ) + parser.add_option( + "--quiet", + action="store_true", + default=False, + dest="quiet", + help="Omit verbose descriptions and only print " "machine-readable outputs.", + ) + return parser + + +# The URL root for accessing Google Accounts. +GOOGLE_ACCOUNTS_BASE_URL = "https://accounts.google.com" + + +# Hardcoded dummy redirect URI for non-web apps. +REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob" + + +def AccountsUrl(command): + """Generates the Google Accounts URL. + + Args: + command: The command to execute. + + Returns: + A URL for the given command. + """ + return "%s/%s" % (GOOGLE_ACCOUNTS_BASE_URL, command) + + +def UrlEscape(text): + # See OAUTH 5.1 for a definition of which characters need to be escaped. + return urllib.parse.quote(text, safe="~-._") + + +def UrlUnescape(text): + # See OAUTH 5.1 for a definition of which characters need to be escaped. + return urllib.parse.unquote(text) + + +def FormatUrlParams(params): + """Formats parameters into a URL query string. + + Args: + params: A key-value map. + + Returns: + A URL query string version of the given parameters. + """ + param_fragments = [] + for param in sorted(iter(params.items()), key=lambda x: x[0]): + param_fragments.append("%s=%s" % (param[0], UrlEscape(param[1]))) + return "&".join(param_fragments) + + +def GeneratePermissionUrl(client_id, scope="https://mail.google.com/"): + """Generates the URL for authorizing access. + + This uses the "OAuth2 for Installed Applications" flow described at + https://developers.google.com/accounts/docs/OAuth2InstalledApp + + Args: + client_id: Client ID obtained by registering your app. + scope: scope for access token, e.g. 'https://mail.google.com' + Returns: + A URL that the user should visit in their browser. + """ + params = {} + params["client_id"] = client_id + params["redirect_uri"] = REDIRECT_URI + params["scope"] = scope + params["response_type"] = "code" + return "%s?%s" % (AccountsUrl("o/oauth2/auth"), FormatUrlParams(params)) + + +def AuthorizeTokens(client_id, client_secret, authorization_code): + """Obtains OAuth access token and refresh token. + + This uses the application portion of the "OAuth2 for Installed Applications" + flow at https://developers.google.com/accounts/docs/OAuth2InstalledApp#handlingtheresponse + + Args: + client_id: Client ID obtained by registering your app. + client_secret: Client secret obtained by registering your app. + authorization_code: code generated by Google Accounts after user grants + permission. + Returns: + The decoded response from the Google Accounts server, as a dict. Expected + fields include 'access_token', 'expires_in', and 'refresh_token'. + """ + params = {} + params["client_id"] = client_id + params["client_secret"] = client_secret + params["code"] = authorization_code + params["redirect_uri"] = REDIRECT_URI + params["grant_type"] = "authorization_code" + request_url = AccountsUrl("o/oauth2/token") + + response = urllib.request.urlopen( + request_url, urllib.parse.urlencode(params).encode() + ).read() + return json.loads(response) + + +def RefreshToken(client_id, client_secret, refresh_token): + """Obtains a new token given a refresh token. + + See https://developers.google.com/accounts/docs/OAuth2InstalledApp#refresh + + Args: + client_id: Client ID obtained by registering your app. + client_secret: Client secret obtained by registering your app. + refresh_token: A previously-obtained refresh token. + Returns: + The decoded response from the Google Accounts server, as a dict. Expected + fields include 'access_token', 'expires_in', and 'refresh_token'. + """ + params = {} + params["client_id"] = client_id + params["client_secret"] = client_secret + params["refresh_token"] = refresh_token + params["grant_type"] = "refresh_token" + request_url = AccountsUrl("o/oauth2/token") + + response = urllib.request.urlopen( + request_url, urllib.parse.urlencode(params).encode() + ).read() + return json.loads(response) + + +def GenerateOAuth2String(username, access_token, base64_encode=True): + """Generates an IMAP OAuth2 authentication string. + + See https://developers.google.com/google-apps/gmail/oauth2_overview + + Args: + username: the username (email address) of the account to authenticate + access_token: An OAuth2 access token. + base64_encode: Whether to base64-encode the output. + + Returns: + The SASL argument for the OAuth2 mechanism. + """ + auth_string = "user=%s\1auth=Bearer %s\1\1" % (username, access_token) + if base64_encode: + auth_string = base64.b64encode(bytes(auth_string, "utf-8")) + return auth_string + + +def TestImapAuthentication(user, auth_string): + """Authenticates to IMAP with the given auth_string. + + Prints a debug trace of the attempted IMAP connection. + + Args: + user: The Gmail username (full email address) + auth_string: A valid OAuth2 string, as returned by GenerateOAuth2String. + Must not be base64-encoded, since imaplib does its own base64-encoding. + """ + print() + imap_conn = imaplib.IMAP4_SSL("imap.gmail.com") + imap_conn.debug = 4 + imap_conn.authenticate("XOAUTH2", lambda x: auth_string) + imap_conn.select("INBOX") + + +def TestSmtpAuthentication(user, auth_string): + """Authenticates to SMTP with the given auth_string. + + Args: + user: The Gmail username (full email address) + auth_string: A valid OAuth2 string, not base64-encoded, as returned by + GenerateOAuth2String. + """ + print() + smtp_conn = smtplib.SMTP("smtp.gmail.com", 587) + smtp_conn.set_debuglevel(True) + smtp_conn.ehlo("test") + smtp_conn.starttls() + smtp_conn.docmd("AUTH", "XOAUTH2 " + base64.b64encode(auth_string)) + + +def RequireOptions(options, *args): + missing = [arg for arg in args if getattr(options, arg) is None] + if missing: + print("Missing options: %s" % " ".join(missing), file=sys.stderr) + sys.exit(-1) + + +def main(argv): + options_parser = SetupOptionParser() + (options, args) = options_parser.parse_args() + if options.refresh_token: + RequireOptions(options, "client_id", "client_secret") + response = RefreshToken( + options.client_id, options.client_secret, options.refresh_token + ) + if options.quiet: + print(response["access_token"]) + else: + print("Access Token: %s" % response["access_token"]) + print("Access Token Expiration Seconds: %s" % response["expires_in"]) + elif options.generate_oauth2_string: + RequireOptions(options, "user", "access_token") + oauth2_string = GenerateOAuth2String(options.user, options.access_token) + if options.quiet: + print(oauth2_string.decode("utf-8")) + else: + print("OAuth2 argument:\n" + oauth2_string.decode("utf-8")) + elif options.generate_oauth2_token: + RequireOptions(options, "client_id", "client_secret") + print("To authorize token, visit this url and follow the directions:") + print(" %s" % GeneratePermissionUrl(options.client_id, options.scope)) + authorization_code = input("Enter verification code: ") + response = AuthorizeTokens( + options.client_id, options.client_secret, authorization_code + ) + print("Refresh Token: %s" % response["refresh_token"]) + print("Access Token: %s" % response["access_token"]) + print("Access Token Expiration Seconds: %s" % response["expires_in"]) + elif options.test_imap_authentication: + RequireOptions(options, "user", "access_token") + TestImapAuthentication( + options.user, + GenerateOAuth2String( + options.user, options.access_token, base64_encode=False + ), + ) + elif options.test_smtp_authentication: + RequireOptions(options, "user", "access_token") + TestSmtpAuthentication( + options.user, + GenerateOAuth2String( + options.user, options.access_token, base64_encode=False + ), + ) + else: + options_parser.print_help() + print("Nothing to do, exiting.") + return + + +if __name__ == "__main__": + main(sys.argv) diff --git a/home-modules/mutt/neomutt.nix b/home-modules/mutt/neomutt.nix index 6132198..998d1b4 100644 --- a/home-modules/mutt/neomutt.nix +++ b/home-modules/mutt/neomutt.nix @@ -16,7 +16,7 @@ programs.neomutt = { enable = true; package = pkgs.neomutt; - editor = "micro"; + editor = "$EDITOR"; sort = "date"; sidebar = { enable = true; @@ -43,7 +43,6 @@ imapPass = ""; imapAuthenticators = "oauthbearer:xoauth2"; imapOAuthRefreshCommand = "mutt_oauth ~/.config/mutt/${imapUser}.tokens"; - smtpUrl = "smtp://lennart.kurzweg.lk@smtp.gmail.com:587/"; smtpPass = ""; sslForceTls = true; realname = "Lennart J. Kurzweg"; @@ -81,4 +80,22 @@ # ]; # }; }; -} \ No newline at end of file + + + accounts.email.accounts = { + secrets.email.gmail.mail1 = { + primary = true; + smtp = ""; + smtpUrl = "smtp://lennart.kurzweg.lk@smtp.gmail.com:587/"; + realName = "Lennart J. Kurzweg"; + address = secrets.email.gmail.mail1; + aliases = [ ]; + userName = "nx2"; + passwordCommand = "op read op://Personal/iCloud/himalaya"; + }; + }; + +} + + + diff --git a/home-modules/neomutt.nix b/home-modules/neomutt.nix deleted file mode 100644 index 689c03e..0000000 --- a/home-modules/neomutt.nix +++ /dev/null @@ -1,84 +0,0 @@ -{ config, pkgs, lib, system, user, allowed, secrets, ... }: - -{ - home.packages = [ - pkgs.neomutt - pkgs.isync - pkgs.msmtp - pkgs.notmuch - pkgs.abook - pkgs.urlview - - (pkgs.writeScriptBin "mutt_oauth" (builtins.readFile ./scripts/mutt_oauth2.py)) - - ]; - - programs.neomutt = { - enable = true; - package = pkgs.neomutt; - editor = "micro"; - sort = "date"; - sidebar = { - enable = true; - }; - binds = [ - { map = [ "index" ]; key = ""; action = "sidebar-toggle-visible"; } - { map = [ "pager" ]; key = ""; action = "sidebar-toggle-visible"; } - { map = [ "index" ]; key = "\\Cp"; action = "sidebar-prev"; } - { map = [ "pager" ]; key = "\\Cp"; action = "sidebar-prev"; } - { map = [ "index" ]; key = "\\Cn"; action = "sidebar-next"; } - { map = [ "pager" ]; key = "\\Cn"; action = "sidebar-next"; } - { map = [ "index" ]; key = "\\Co"; action = "sidebar-open"; } - { map = [ "pager" ]; key = "\\Co"; action = "sidebar-open"; } - { map = [ "pager" ]; key = ""; action = "previous-line"; } - { map = [ "pager" ]; key = ""; action = "next-line"; } - ]; - - settings = let imapUser = "lennart.kurzweg.lk@gmail.com"; in { - cryptReplysign = true; - cryptVerifySig = true; - editHeaders = true; - from = imapUser; - inherit imapUser; - imapPass = ""; - imapAuthenticators = "oauthbearer:xoauth2"; - imapOAuthRefreshCommand = "mutt_oauth ~/.config/mutt/${imapUser}.tokens"; - smtpUrl = "smtp://lennart.kurzweg.lk@smtp.gmail.com:587/"; - smtpPass = ""; - sslForceTls = true; - realname = "Lennart J. Kurzweg"; - useFrom = true; - timeout = 10; - }; - - # Color Settings - # colors = { - # normal = "white default"; - # attachment = "brightyellow default"; - # hdrdefault = "cyan default"; - # indicator = "black cyan"; - # markers = "brightred default"; - # quoted = "green default"; - # signature = "cyan default"; - # status = "brightgreen blue"; - # tilde = "blue default"; - # tree = "red default"; - # index = [ - # "red default ~P" - # "red default ~D" - # "magenta default ~T" - # ]; - # header = [ - # "brightgreen default ^From:" - # "brightcyan default ^To:" - # "brightcyan default ^Reply-To:" - # "brightcyan default ^Cc:" - # "brightblue default ^Subject:" - # ]; - # body = [ - # "brightred default [\\-\\.+_a-zA-Z0-9]+@[\\-\\.a-zA-Z0-9]+" - # "brightblue default (https?|ftp)://[\\-\\.,/%~_:?&=\\#a-zA-Z0-9]+" - # ]; - # }; - }; -} \ No newline at end of file diff --git a/home-modules/pnx.nix b/home-modules/pnx.nix deleted file mode 100644 index c0f8f3f..0000000 --- a/home-modules/pnx.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, pkgs, lib, system, user, allowed, secrets, ... }: - -{ - home.packages = [ - pkgs.remmina - pkgs.openvpn - - (pkgs.writeShellScriptBin "connect_to_pnx" '' - pushd ~/.ssl/ - sudo openvpn --config /home/nx2/.vpn/ljk-pnx.ovpn --auth-user-pass ~/.vpn/ljk-pnx-pass.txt #gets put there by home-manager - popd - '') - - ]; - - home.file = { - - ".vpn/ljk-pnx-cert.pem".text = secrets.pnxVpn.cert; - ".vpn/ljk-pnx-cert.key".text = secrets.pnxVpn.certKey; - ".vpn/ljk-pnx-ca.pem".text = secrets.pnxVpn.ca; - ".vpn/ljk-pnx.ovpn".text = secrets.pnxVpn.ovpn; - ".vpn/ljk-pnx-pass.txt".text = secrets.pnxVpn.pass; - - # Remmina - ".local/share/remmina/pnx_rdp_srv-phoe3-vmdms_192-168-1-104.remmina".source = ./secrets/pnx-vpn/pnx_rdp_srv-phoe3-vmdms_192-168-1-104.remmina; - ".local/share/remmina/pnx_rdp_srv-phoenix-3_192-168-1-108.remmina".source = ./secrets/pnx-vpn/pnx_rdp_srv-phoenix-3_192-168-1-108.remmina; - ".local/share/remmina/pnx_rdp_srv-phoenix2_192-168-1-101.remmina".source = ./secrets/pnx-vpn/pnx_rdp_srv-phoenix2_192-168-1-101.remmina; - ".local/share/remmina/pnx_rdp_srv-remote_192-168-1-21.remmina".source = ./secrets/pnx-vpn/pnx_rdp_srv-remote_192-168-1-21.remmina; - }; -} \ No newline at end of file diff --git a/home-modules/shell/zoxide.nix b/home-modules/shell/zoxide.nix new file mode 100644 index 0000000..9107fd9 --- /dev/null +++ b/home-modules/shell/zoxide.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + home.packages = [ + pkgs.zoxide + ]; + programs.zoxide = { + enable = true; + enableFishIntegration = true; + }; +} \ No newline at end of file diff --git a/home-modules/vscode.nix b/home-modules/vscode.nix index 42233e2..0cc89cb 100644 --- a/home-modules/vscode.nix +++ b/home-modules/vscode.nix @@ -36,6 +36,7 @@ gencer.html-slim-scss-css-class-completion donjayamanne.githistory mads-hartmann.bash-ide-vscode + bungcip.better-toml #jeanp413.open-remote-ssh # ms-vscode-remote.remote-ssh diff --git a/home.nix b/home.nix index edc4716..8603750 100644 --- a/home.nix +++ b/home.nix @@ -2,10 +2,12 @@ { imports = [ ./home-modules/vscode.nix - ./home-modules/mutt/neomutt.nix + ./home-modules/discord.nix + ./home-modules/meli.nix + # ./home-modules/mutt/neomutt.nix ./home-modules/gestures.nix - ./home-modules/pnx.nix + ./home-modules/pnx/pnx.nix # ./home-modules/hsmw.nix ./home-modules/hyprland/hyprland.nix @@ -14,9 +16,11 @@ ./home-modules/shell/fish.nix ./home-modules/shell/starship.nix ./home-modules/shell/yazi.nix + ./home-modules/shell/zoxide.nix ./home-modules/ssh.nix ./home-modules/git.nix + ./home-modules/mako.nix ./home-modules/theme/gtk.nix ./home-modules/theme/qt.nix @@ -34,7 +38,11 @@ kitty zathura #vesktop - thunderbird element-desktop # zoom-us + thunderbird element-desktop + # zoom-us + # vesktop + discord + signal-desktop obsidian spotify spicetify-cli @@ -44,9 +52,12 @@ imv mpv mediainfo exiftool ffmpeg pavucontrol fontpreview gtk2fontsel - lynx bat du-dust eza neofetch zoxide tldr fzf figlet delta ripgrep lolcat + lynx bat du-dust eza neofetch tldr fzf figlet delta ripgrep lolcat jq brightnessctl wev element sssnake pipes + + nodejs + (pkgs.python3.withPackages (python-pkgs: [ python-pkgs.pandas python-pkgs.requests @@ -74,21 +85,7 @@ ''; }) ]; - # systemd.user.services = { - # ydotoold = { - # Unit = { - # Description = "An auto-input utility for wayland"; - # Documentation = [ "man:ydotool(1)" "man:ydotoold(8)" ]; - # }; - - # Service = { - # ExecStart = "/run/current-system/sw/bin/ydotoold --socket-path /tmp/ydotool_socket "; - # }; - # Install = { - # WantedBy = ["default.target"]; - # }; - # }; - # }; + home.file = { }; # Home Manager can also manage your environment variables through @@ -102,31 +99,13 @@ # # /etc/profiles/per-user/nx2/etc/profile.d/hm-session-vars.sh # - home.sessionVariables = { - XDG_CONFIG_HOME = "$HOME/.config"; - XDG_DATA_HOME = "$HOME/.local/share"; - XDG_CACHE_HOME = "$HOME/."; - XDG_STATE_HOME = "$HOME/.local/state"; - }; - programs.git = { - enable = true; - userName = "nx2"; - userEmail = "nx2@local"; - delta = { - enable = true; - options = { - line-numbers = true; - side-by-side = false; - features = "unobtrusive-line-numbers decorations"; - whitespace-error-style = "22 reverse"; - }; - }; - }; xdg = { enable = true; configHome = /home/${user}/.config; cacheHome = /home/${user}/.cache; + dataHome = /home/${user}/.local/share; + stateHome = /home/${user}/.local/state; mimeApps = { enable = true; defaultApplications = { diff --git a/secrets/passwords-and-certificates.nix b/secrets/passwords-and-certificates.nix index 85579b8bd0baa1cabf900ace4237bfeda9447cda..51e8171bc248089d032e8dad19bca8077cddb865 100644 GIT binary patch literal 1580 zcmZQ@_Y83kiVO&0czkQ$_E{-+o_+C>XjGT{o&COF;h~vo!^*Od2keKho@)Ijk-UGN z*pK0h~ivjj{&ko>XP3vX zSWx&b{Rxjg>w#VG1lP*0b6E9w52u~_X3tk?H*fLm{XCsD&Q)^x)Pu5*QXX|RUA~zx zEyK_Cl9t|$!V8?#%5O!_O);9ir}XCiA05-)-D0^dGw04- zHb%GGH%(6J{|Sm*`(W0bz{`xb6|Gi#pR%M+dtUyULAB^#dwfFaCy9`Xb)lygzAQdh ze2gXL&5fI`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ik&Qh>z7W{3lvIxwW>Ga#M>#n*BKs#$?ku%S#Q&o zP037Z=dN9=f77r1LRRMYwOO;yf10@dll#Mo2T~)<8N-w<%KEb>{#Y>a$p5`})l>Zp znN1!&e-LrzwDo_BrRvu6W8{4&Gk=-Nv*BoKh|%eQW1L!?R(J2Uw+h|HI-5?u zoyn!UyGe1|`KGG;eU4qH++9<(TrMq`&?mc>r%=q)?}aP#^T-wn-z6ItY!dOj9B1|8 z+^5F$rXQQ<9#|P9CM_6yLo=Va3 ZH?n6${#T#+o)RCvb-~T8%FM?<0ssm=^RWN` diff --git a/secrets/pnx-vpn/pnx_rdp_srv-phoe3-vmdms_192-168-1-104.remmina b/secrets/pnx-vpn/pnx_rdp_srv-phoe3-vmdms_192-168-1-104.remmina deleted file mode 100644 index d482f5c5affc5f75357b4cd0e315cd1c7541bfd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1508 zcmZQ@_Y83kiVO&0*!}4cU-9kcZl|4%018>1bly{j zruSyc=F0}^o!r)DzwJbg-dz&Y(q>#-$>u^ zOUyO0w0yqVs&W7Sti3xwYhC+PTX&Uv-bZcKf3|8@l9xUIdwQzKpPFwodlpygO6GX1 zO#Iir&%AQ(ztC@Y1af76h$p>e+^^{W=k5!INz4La4RdCny8P~wqHp+h&BKZ3BKen{ zTyk6OE4KxsV{iQ5hfa-8w#%N^DBW+#7OpY=W^xI_gjsyHUFS$MfzY&X-{)ukP3 z+}$@V&vna&!-f+@$~Mf@t0F)*^M~Nk9eL9uGu`@B>rCF2W_+F z=`ZcF!WE0#0yb{ox)w2eyZY>dpDw-N3{{qV)A8i{*Jk6A>sudO)$??*T(IG?ke(UO zbQw=~C#`2HofD%w+?F(H&h$%ve|Bb-E&C3Uc5bG0weLqwn)%H6&z^GhGo9_m6wUtX zk3qrxb3)U1FnjeI+_`D4Tb8$E4xf*O_oijn7IRDZ>N%G-+C17LCtm;2$;0+@^X<*^ zZFzK~e!84Z;P|b7Ca-)AM@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-168-1-108.remmina deleted file mode 100644 index 77545991b7d6c71e05de36939f92aa867d2d8280..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1507 zcmZQ@_Y83kiVO&0xXZ8N>+?K8(DSbU$Iw42^G`>u)>u=$JvM)_<>?hC+!|el@6JE2 z^y0Lb!(@K${W8q6G>en%#EQaH%7UahCf3hKUc-=wQ=RV5w=D=h0(_}r-#+Si=EYf z`P+;)D_Gx)*nPOUXVyaPsu%x`#KzpSyB_0_pxkcf@;Uioew_V-|E3$Z74yyQ(%B_C z(ehy~L&uYbrwrS)6Ynt^7JmQsL!aqQ)Ea^33aPtS{)vAczj#G{?cU~oZj*w7!v#-X zZo9JF;jeD(jnb^cU%5p$vdsM}-~HRjWSw2|7Nft0U!HMKaAa@wNN4+0H(^?FNqGwY z+$}l&>82H~rFyCN1-7hklHFu<=hVAJ0X~_A3qt11-S1s5Vs>;D-@LCeOEyk?&6Dzz z`{HWX%+6W6q$?KBi99Bo*Ku9r_o^qe7BBnw@ust|wIB!M!vd?&lGpkH73a&O&ef$> zns0Qh+!Q6txA)XZ{|g%yX!>8jbLOADWqYm*Kl|#m4__xS-9EG6tA^O$)n5*Etog-M z^kLbz(_3SmGoAhxwuw#75nJ?ASjFr5AAz1y*&3CO429{YhyL~Nh-vAY?cN@GclohL z_7Ar4YT3#L47@5$B5tqx96xWHWq3UM?SM0k>5TlMWr`o91@p7JMT^5P z=*xO$sR-rpIwiF`IyMESAHVxphuQeRbpFjB_J^*h}P-hDaqTV9(88JzK0w4Q&*%dW;^-VWQAV%MQK2 zx>0g_4o~9+o?xk&xu^d>YMmJtW>9_W_<;$FW<6}bW2U%N*1G2Oc~3LxHQ(N!bvH;A zS{;z>bwfDd4DU>bbGoN3cgu(`+wgPdo~#9b`@Uu|3%v|kCjRMEq)U)(T?tpvUB}x3 zCNi>DPJWbHmN+-*j{IELAf0o+r&?ySv`_4E>zyjB!K-sN&M{i-L)E3AKGv9y+0mkr zrJPRFHVXF{RwhjUqb|rNUL4erE&B0Odfw`1H$pz_zv=VdyH{@y)0JcKf*V;>1Kxe( zcYcs_riRb%PoVzGb2r#u2xUz>yvPxyQ;{rC2(I&=;&|DVCEIsNlY z9z*tN)ra@5@Mq@kH+=BstbXVhla;R?dB|QWUZZ$we^g?l@T`kUXN#B}BWLJMFFV(` zRrg%0Y3k-#ozDW63;sB<%6^W{oPWPARY+~=kecx4g;Vs)`?ti!*)o@%KD+9~DfRl} zj!wG!pZ<3Kye=qLAo|HA_xXoSl+PrV{P%3yAXv?G|GU1Zbi89n!DVB<18=8IJ)`wy zp08;Llk$4&*S#DuQ#M%iE_j~AP`v;4qK+541T0<@ILXL!rO)x%e@Hi&Bj(!aM;x&Z zwE`?GS_dv1FT5DWa(%{hU)d*T{!Fp^x3aIQdCGyxlx5lxCsU;rZz%~^D(>%GP~06Q zw{d3K7QMLW8%LJTmV2|+tLWDLTOUtWudT4-JW~GodjZFnU*FSqT=jHc66v*nE~m}( z{3q;Zude@oSh9JwfuVOI%iSf)?`qr?*6unKyD#)vZT4fnu9a@QJ|6{=tPZ}CFY$ZP zx-UFa>($fH^~dgfux@zqz9WiD`2WTmJ%v(#cOHFi?_T#UYWpFxoUi6P7Wdk(?1)!g z^M8NT#@Aw7W=CZknmpJPSAI+5bHI~*QtP)adlFbU`P*ry@`f`n*>j#}Stu0F*~0dy zv^6wdWtMLen<7iy=JigK*?%`4VA)|U?Rxaj+j*>4t~Ryq`rYjy9$>1NF!A&8f8vgJ z*0pWV(fECjLubRm<1s(>vbg+=)M46lkkx73PXm)Yep5@s)aE7E|6H2!>CUzrhL*2a im-ufpQ2jiK&CmIKg(FLi`U$b;kMB#ZysNZdm<0ejq~Rj~ diff --git a/secrets/pnx-vpn/pnx_rdp_srv-phoenix2_192-168-1-101.remmina b/secrets/pnx-vpn/pnx_rdp_srv-phoenix2_192-168-1-101.remmina deleted file mode 100644 index a537d9383b38737971c8c5e0d1c7901c35035e0f..0000000000000000000000000000000000000000 GIT binary pat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*7yB+dAX{?CY<%0&hp}Phn_SoATy3&z%dD-bbg^BAg*ew5bF>t5(*MskbLUwXgrN5tjkTE~!_WN&X9h>?j zLVg^cRc(^&*1cG^Z*$gFyTxy^)*t@0T=IW(^^eKSA9yD7uAH^6bduqf;O`<#pI^_Z lcwD&7i{t0Sss8J9x4bL7!uyifTAX43zB9Ir#}dAp0|14E?Xmy> diff --git a/secrets/pnx-vpn/pnx_rdp_srv-remote_192-168-1-21.remmina b/secrets/pnx-vpn/pnx_rdp_srv-remote_192-168-1-21.remmina deleted file mode 100644 index fc466b36e03cdf558879b4aa386517ed2812826f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1444 zcmZQ@_Y83kiVO&0h>Thp>vTw0)g>%ted<}?nfa5aeoDOmNc-xlDPPOhZt&4M{;Pl0 z{r*2Y^i;Kj)eALPeg+9K9(eKb!tUv%r?))Tyfky-PYLlWZBtEB7P{!@e|aNm@zk#A z$V{zTp9>KJn{J<5q{Z1`CCRvKLV~_zZ|}jxUBdfRMVAEsJ@PlR;O3gL*t?n{*IqVX zIG?^={eIVygoU3J7WxI<$-9@}`QM=RVOHp+BgTBJ&6zV_^y==M%cRw+of>YJqVTh4 zCc~EbWlQb9wBDY-;Z<|n9FYmdYyE#+wmDaJEu zCB>z^A5UwReQ%VHIHl;vEuCd~t8Gr8>w)86-)wX6obR$YF+Fv=+xIe~Zr=+XAuiVHC9*FTdMTY}KdfUVU^)FA>)Zu5rg}#EoGK};h!i;(5cPd) z^uervyr0Iiju&Qomnh!*t0nks6Vt4}iCHT`g3aa$<>@kt%vw9W#!(}hDbZuga_)e9 z!-Bb8xejLTnME(ZwSF+FG%z_N?iJ>}9|Ph@XGcZ_ZQAO59gpuEkP1LF&%p9x1Vj0t=-T zA0E&${bbs8I;v>G6|ORW$+*p@I_EyWw?wnbh`W8Ly@6~LXJe<07!u4b-C-2<3 z_}%1(Mo)Ox3RoGQo>ZpCo}hEyaNUBZ|M*!a&)e~5-tV2fx=VX_x0Tp0Ut;>q;O4?P z$EJPyv~kf?*9~gi?GM|Q)je^#wdTUH^^2VE*4Q+LdKfG*F|V#&ZoJVn?xkn!kJFqc ztRGXQZd5G4Iy*X#sp6!jSERh@&*fVE7rydk$p)@U-mP}@?XUZbrf=>`Kk;@~a#+Wo zMH#aX89yv}Hi>l=OMd2;1>t{hvm~(SZ`3`pSWQs;;(8|4ihWm;`hzzfNqTbAI@2Qe zX;Ho3-{%z(Mgd_@+pSphPF`F8=Ges-dGk9Txr?8^E~TGl^3U+f&c8PT?=Skl%PVL> zqzB8PC9Gk|30tcfvX9rLpPJiWXkQ|6$d7&X&hGSETZ*-ITzqKw>VtU32@3_)mdfp6 zVj8YbCvDw(+OV+M^08Dui-Ldr=?(J@H5E2b&0QV!KqMj4=6=K6`)@zSXUa0nXq*39 z=J{>U=j>YwZ)yK9mg37dS=coqbyDOZ5aPb#_6m#pnCeZmBfS%Uj0I z@@UoW{N+*q`VH3kYb=mhn_<;zvaKTNUPo`%+T*L{ygF<>N$>p`qb*s6#`Vd}N!|J! zvTI78UXq`zRI}f5PWFqF4GH1<;|!7 diff --git a/system-modules/health_reminder.nix b/system-modules/health_reminder.nix new file mode 100644 index 0000000..c14c7de --- /dev/null +++ b/system-modules/health_reminder.nix @@ -0,0 +1,61 @@ +{ config, pkgs, ... }: + +{ + systemd.timers."health_reminder" = { + enable = true; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "5m"; + OnUnitActiveSec = "5m"; + Unit = "health_reminder.service"; + }; + }; + + systemd.services."health_reminder" = + let hm = pkgs.writeScriptBin "health_reminder" '' + #!${pkgs.python3}/bin/python3 + import random + + class Action: + def __init__(self, actionA: str, actionB: str, likelihood: int, options: str): + self.actionA = actionA + self.actionB = actionB + self.likelihood = likelihood + self.options = options + + def __str__(self): + if self.options: + return f"{self.actionA}{random.choice(self.options)}{self.actionB}" + else: + return self.actionA + + + actions = [ + Action("look away for 20 Seconds!", "", 300, ""), + Action("Shrimp 3000!", "", 90, ""), + Action("Do ", " Biceps curls with each Arm! ", 5, ["50", "10", "20"]), + Action("Do ", " Shourlder thingees", 5, ["30", "50", "20"]), + Action("Plank for ", " senonds!", 5, ["60", "60", "70"]), + Action("Strech your upper body!", "", 10, ""), + Action("Strech your core!", "", 5, ""), + Action("Strech your legs!", "", 5, ""), + Action("Make Tea!", "", 5, ""), + ] + + total_likelihood = sum(a.likelihood for a in actions) + random_action = random.choices(actions, [a.likelihood for a in actions], k=1)[0] + print(random_action) + ''; + in + { + script = '' + set -eu + export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus" + ${pkgs.libnotify}/bin/notify-send "$(${hm}/bin/health_reminder)" + ''; + serviceConfig = { + Type = "oneshot"; + User = "nx2"; + }; + }; +} \ No newline at end of file