mirror of
				https://github.com/materusPL/nixos-config
				synced 2025-11-04 06:20:27 +01:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			2c27517ab1
			...
			afbe226504
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| afbe226504 | |||
| 3403a4cb3b | |||
| 672349895d | |||
| 30ca179cb2 | 
@ -62,7 +62,10 @@ in
 | 
			
		||||
    #Fix for amdgpu crashes
 | 
			
		||||
    KWIN_DRM_USE_MODIFIERS = "0";
 | 
			
		||||
    KWIN_DRM_NO_DIRECT_SCANOUT = "1";
 | 
			
		||||
    QT_PLUGIN_PATH = [ "${pkgs.qt6.qtimageformats}/${pkgs.qt6.qtbase.qtPluginPrefix}" ];
 | 
			
		||||
    QT_PLUGIN_PATH = [ 
 | 
			
		||||
      "${pkgs.qt6.qtimageformats}/${pkgs.qt6.qtbase.qtPluginPrefix}"
 | 
			
		||||
      "${pkgs.kdePackages.ffmpegthumbs}/${pkgs.qt6.qtbase.qtPluginPrefix}"
 | 
			
		||||
     ];
 | 
			
		||||
    XCURSOR_THEME = "breeze_cursors";
 | 
			
		||||
  };
 | 
			
		||||
  environment.systemPackages = with pkgs; [
 | 
			
		||||
 | 
			
		||||
@ -10,27 +10,267 @@
 | 
			
		||||
      cfg = config.valkyrieService.dcbot;
 | 
			
		||||
    in
 | 
			
		||||
    lib.mkIf cfg.enable {
 | 
			
		||||
      sops.templates."dcbot.env".content = ''
 | 
			
		||||
          TOKEN=${config.sops.placeholder.discord-token}
 | 
			
		||||
          MAX_PLAYLIST_SIZE=100
 | 
			
		||||
          PRUNING=false
 | 
			
		||||
          LOCALE=pl
 | 
			
		||||
          DEFAULT_VOLUME=100
 | 
			
		||||
          STAY_TIME=30
 | 
			
		||||
      '';
 | 
			
		||||
 | 
			
		||||
      systemd.tmpfiles.rules = [
 | 
			
		||||
        "d    /var/lib/muse  0776    root    root     -"
 | 
			
		||||
        "d    /var/lib/dcbot   0776    dcbot    dcbot     -"
 | 
			
		||||
      ];
 | 
			
		||||
 | 
			
		||||
      virtualisation.oci-containers.containers.dcbot = {
 | 
			
		||||
        image = "eritislami/evobot:latest";
 | 
			
		||||
        volumes = [
 | 
			
		||||
        ];
 | 
			
		||||
        environmentFiles = [
 | 
			
		||||
          config.sops.templates."dcbot.env".path
 | 
			
		||||
        ];
 | 
			
		||||
      users.groups.dcbot = { };
 | 
			
		||||
      users.users.dcbot = {
 | 
			
		||||
        group = "dcbot";
 | 
			
		||||
        isSystemUser = true;
 | 
			
		||||
      };
 | 
			
		||||
      systemd.services.dcbot = {
 | 
			
		||||
        description = "Make some noise!";
 | 
			
		||||
        serviceConfig = {
 | 
			
		||||
          User="dcbot";
 | 
			
		||||
          Group="dcbot";
 | 
			
		||||
        };
 | 
			
		||||
        wantedBy = [ "multi-user.target" ];
 | 
			
		||||
        path = [ pkgs.jdk ];
 | 
			
		||||
        script = let 
 | 
			
		||||
          musicbot = let version = "0.4.2"; in (pkgs.fetchurl {
 | 
			
		||||
              url = "https://github.com/jagrosh/MusicBot/releases/download/${version}/JMusicBot-${version}.jar";
 | 
			
		||||
              sha256 = "sha256-Jg6/ju3ADBd7fc3njRzoEDVjIL4SzAzlTc02I4Q9hz4=";
 | 
			
		||||
            });
 | 
			
		||||
        
 | 
			
		||||
        in ''
 | 
			
		||||
          cd /var/lib/dcbot
 | 
			
		||||
          java -Dconfig=${config.sops.templates."dcbot.config.txt".path} -Xmx1G -Dnogui=true -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -jar ${musicbot}
 | 
			
		||||
        '';
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      sops.templates."dcbot.config.txt".owner = "dcbot";
 | 
			
		||||
      sops.templates."dcbot.config.txt".group = "dcbot";
 | 
			
		||||
      sops.templates."dcbot.config.txt".content = ''
 | 
			
		||||
/////////////////////////////////////////////////////////
 | 
			
		||||
// Config for the JMusicBot                            //
 | 
			
		||||
/////////////////////////////////////////////////////////
 | 
			
		||||
// Any line starting with // is ignored                //
 | 
			
		||||
// You MUST set the token and owner                    //
 | 
			
		||||
// All other items have defaults if you don't set them //
 | 
			
		||||
// Open in Notepad++ for best results                  //
 | 
			
		||||
/////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the token for the bot to log in with
 | 
			
		||||
// This MUST be a bot token (user tokens will not work)
 | 
			
		||||
// If you don't know how to get a bot token, please see the guide here:
 | 
			
		||||
// https://github.com/jagrosh/MusicBot/wiki/Getting-a-Bot-Token
 | 
			
		||||
 | 
			
		||||
token = ${config.sops.placeholder.discord-token}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the owner of the bot
 | 
			
		||||
// This needs to be the owner's ID (a 17-18 digit number)
 | 
			
		||||
// https://github.com/jagrosh/MusicBot/wiki/Finding-Your-User-ID
 | 
			
		||||
 | 
			
		||||
owner = 141287334627901440
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the prefix for the bot
 | 
			
		||||
// The prefix is used to control the commands
 | 
			
		||||
// If you use !!, the play command will be !!play
 | 
			
		||||
// If you do not set this, the prefix will be a mention of the bot (@Botname play)
 | 
			
		||||
 | 
			
		||||
prefix = "@mention"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this, it modifies the default game of the bot
 | 
			
		||||
// Set this to NONE to have no game
 | 
			
		||||
// Set this to DEFAULT to use the default game
 | 
			
		||||
// You can make the game "Playing X", "Listening to X", or "Watching X"
 | 
			
		||||
// where X is the title. If you don't include an action, it will use the
 | 
			
		||||
// default of "Playing"
 | 
			
		||||
 | 
			
		||||
game = "DEFAULT"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this, it will modify the default status of bot
 | 
			
		||||
// Valid values: ONLINE IDLE DND INVISIBLE
 | 
			
		||||
 | 
			
		||||
status = ONLINE
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this to true, the bot will list the title of the song it is currently playing in its
 | 
			
		||||
// "Playing" status. Note that this will ONLY work if the bot is playing music on ONE guild;
 | 
			
		||||
// if the bot is playing on multiple guilds, this will not work.
 | 
			
		||||
 | 
			
		||||
songinstatus=true
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this, the bot will also use this prefix in addition to
 | 
			
		||||
// the one provided above
 | 
			
		||||
 | 
			
		||||
altprefix = "-"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set these, it will change the various emojis
 | 
			
		||||
 | 
			
		||||
success = "🎶"
 | 
			
		||||
warning = "💡"
 | 
			
		||||
error = "🚫"
 | 
			
		||||
loading = "⌚"
 | 
			
		||||
searching = "🔎"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this, you change the word used to view the help.
 | 
			
		||||
// For example, if you set the prefix to !! and the help to cmds, you would type
 | 
			
		||||
// !!cmds to see the help text
 | 
			
		||||
 | 
			
		||||
help = help
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this, the "nowplaying" command will show youtube thumbnails
 | 
			
		||||
// Note: If you set this to true, the nowplaying boxes will NOT refresh
 | 
			
		||||
// This is because refreshing the boxes causes the image to be reloaded
 | 
			
		||||
// every time it refreshes.
 | 
			
		||||
 | 
			
		||||
npimages = false
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this, the bot will not leave a voice channel after it finishes a queue.
 | 
			
		||||
// Keep in mind that being connected to a voice channel uses additional bandwith,
 | 
			
		||||
// so this option is not recommended if bandwidth is a concern.
 | 
			
		||||
 | 
			
		||||
stayinchannel = false
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the maximum amount of seconds any track loaded can be. If not set or set
 | 
			
		||||
// to any number less than or equal to zero, there is no maximum time length. This time
 | 
			
		||||
// restriction applies to songs loaded from any source.
 | 
			
		||||
 | 
			
		||||
maxtime = 0
 | 
			
		||||
 | 
			
		||||
// This sets the maximum number of pages of songs that can be loaded from a YouTube
 | 
			
		||||
// playlist. Each page can contain up to 100 tracks. Playing a playlist with more
 | 
			
		||||
// pages than the maximum will stop loading after the provided number of pages.
 | 
			
		||||
// For example, if the max was set to 15 and a playlist contained 1850 tracks,
 | 
			
		||||
// only the first 1500 tracks (15 pages) would be loaded. By default, this is
 | 
			
		||||
// set to 10 pages (1000 tracks).
 | 
			
		||||
 | 
			
		||||
maxytplaylistpages = 10
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the ratio of users that must vote to skip the currently playing song.
 | 
			
		||||
// Guild owners can define their own skip ratios, but this will be used if a guild
 | 
			
		||||
// has not defined their own skip ratio.
 | 
			
		||||
 | 
			
		||||
skipratio = 0.55
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the amount of seconds the bot will stay alone on a voice channel until it
 | 
			
		||||
// automatically leaves the voice channel and clears the queue. If not set or set
 | 
			
		||||
// to any number less than or equal to zero, the bot won't leave when alone.
 | 
			
		||||
 | 
			
		||||
alonetimeuntilstop = 120
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets an alternative folder to be used as the Playlists folder
 | 
			
		||||
// This can be a relative or absolute path
 | 
			
		||||
 | 
			
		||||
playlistsfolder = "Playlists"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// By default, the bot will DM the owner if the bot is running and a new version of the bot
 | 
			
		||||
// becomes available. Set this to false to disable this feature.
 | 
			
		||||
 | 
			
		||||
updatealerts=true
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Changing this changes the lyrics provider
 | 
			
		||||
// Currently available providers: "A-Z Lyrics", "Genius", "MusicMatch", "LyricsFreak"
 | 
			
		||||
// At the time of writing, I would recommend sticking with A-Z Lyrics or MusicMatch,
 | 
			
		||||
// as Genius tends to have a lot of non-song results and you might get something 
 | 
			
		||||
// completely unrelated to what you want.
 | 
			
		||||
// If you are interested in contributing a provider, please see
 | 
			
		||||
// https://github.com/jagrosh/JLyrics
 | 
			
		||||
 | 
			
		||||
lyrics.default = "A-Z Lyrics"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// These settings allow you to configure custom aliases for all commands.
 | 
			
		||||
// Multiple aliases may be given, separated by commas.
 | 
			
		||||
//
 | 
			
		||||
// Example 1: Giving command "play" the alias "p":
 | 
			
		||||
// play = [ p ]
 | 
			
		||||
//
 | 
			
		||||
// Example 2: Giving command "search" the aliases "yts" and "find":
 | 
			
		||||
// search = [ yts, find ]
 | 
			
		||||
 | 
			
		||||
aliases {
 | 
			
		||||
  // General commands
 | 
			
		||||
  settings = [ status ]
 | 
			
		||||
 | 
			
		||||
  // Music commands
 | 
			
		||||
  lyrics = []
 | 
			
		||||
  nowplaying = [ np, current ]
 | 
			
		||||
  play = []
 | 
			
		||||
  playlists = [ pls ]
 | 
			
		||||
  queue = [ list ]
 | 
			
		||||
  remove = [ delete ]
 | 
			
		||||
  scsearch = []
 | 
			
		||||
  search = [ ytsearch ]
 | 
			
		||||
  shuffle = []
 | 
			
		||||
  skip = [ voteskip ]
 | 
			
		||||
 | 
			
		||||
  // Admin commands
 | 
			
		||||
  prefix = [ setprefix ]
 | 
			
		||||
  setdj = []
 | 
			
		||||
  setskip = [ setskippercent, skippercent, setskipratio ]
 | 
			
		||||
  settc = []
 | 
			
		||||
  setvc = []
 | 
			
		||||
 | 
			
		||||
  // DJ Commands
 | 
			
		||||
  forceremove = [ forcedelete, modremove, moddelete, modelete ]
 | 
			
		||||
  forceskip = [ modskip ]
 | 
			
		||||
  movetrack = [ move ]
 | 
			
		||||
  pause = []
 | 
			
		||||
  playnext = []
 | 
			
		||||
  queuetype = []
 | 
			
		||||
  repeat = []
 | 
			
		||||
  skipto = [ jumpto ]
 | 
			
		||||
  stop = [ leave ]
 | 
			
		||||
  volume = [ vol ]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This sets the logging verbosity.
 | 
			
		||||
// Available levels: off, error, warn, info, debug, trace, all
 | 
			
		||||
//
 | 
			
		||||
// It is recommended to leave this at info. Debug log levels might help with troubleshooting,
 | 
			
		||||
// but can contain sensitive data.
 | 
			
		||||
 | 
			
		||||
loglevel = info
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Transforms are used to modify specific play inputs and convert them to different kinds of inputs
 | 
			
		||||
// These are quite complicated to use, and have limited use-cases, but in theory allow for rough
 | 
			
		||||
// whitelists or blacklists, roundabout loading from some sources, and customization of how things are
 | 
			
		||||
// requested.
 | 
			
		||||
//
 | 
			
		||||
// These are NOT EASY to set up, so if you want to use these, you'll need to look through the code 
 | 
			
		||||
// for how they work and what fields are needed. Also, it's possible this feature might get entirely
 | 
			
		||||
// removed in the future if I find a better way to do this.
 | 
			
		||||
 | 
			
		||||
transforms = {}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// If you set this to true, it will enable the eval command for the bot owner. This command
 | 
			
		||||
// allows the bot owner to run arbitrary code from the bot's account.
 | 
			
		||||
//
 | 
			
		||||
// WARNING:
 | 
			
		||||
// This command can be extremely dangerous. If you don't know what you're doing, you could
 | 
			
		||||
// cause horrific problems on your Discord server or on whatever computer this bot is running
 | 
			
		||||
// on. Never run this command unless you are completely positive what you are running.
 | 
			
		||||
//
 | 
			
		||||
// DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT THIS DOES OR HOW TO USE IT
 | 
			
		||||
// IF SOMEONE ASKS YOU TO ENABLE THIS, THERE IS AN 11/10 CHANCE THEY ARE TRYING TO SCAM YOU
 | 
			
		||||
 | 
			
		||||
eval=false
 | 
			
		||||
evalengine="Nashorn"
 | 
			
		||||
'';
 | 
			
		||||
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -56,6 +56,8 @@
 | 
			
		||||
            ''OC\Preview\BMP''
 | 
			
		||||
            ''OC\Preview\XBitmap''
 | 
			
		||||
            ''OC\Preview\MP3''
 | 
			
		||||
            ''OC\Preview\OGG''
 | 
			
		||||
            ''OC\Preview\OPUS''
 | 
			
		||||
            ''OC\Preview\MP4''
 | 
			
		||||
            ''OC\Preview\TXT''
 | 
			
		||||
            ''OC\Preview\MarkDown''
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user