Skip to content

Commit

Permalink
Add gthumb and mpv
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoth committed Sep 30, 2023
1 parent bfbe49f commit 85d8a0f
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 8 deletions.
2 changes: 2 additions & 0 deletions machines/pcLexell/gui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ in {
obsidian
tor-browser-bundle-bin
#hyprdim
gthumb # image viewver; automatically bind to xdg
mpv # Video player
];
programs.hyprland = {
#enable = true;
Expand Down
40 changes: 40 additions & 0 deletions machines/pcLexell/mpd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Infrastructure config by ASCIIMoth
#
# To the extent possible under law, the person who associated CC0 with
# this work has waived all copyright and related or neighboring rights
# to it.
#
# You should have received a copy of the CC0 legalcode along with this
# work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
{
config,
pkgs,
lib,
inputs,
...
}: let
constants = import ./constants.nix;
in {
services.mpd = {
enable = true;
musicDirectory = "/home/${constants.MainUser}/mpd";
user = "${constants.MainUser}";
extraConfig = ''
auto_update "no"
restore_paused "yes"
audio_output {
type "pipewire"
name "${constants.MainUser} PipeWire Output"
}
'';
#network.listenAddress = "any"; # if you want to allow non-localhost connections
#startWhenNeeded = true; # systemd feature: only start MPD service upon connection to its socket
};
systemd.services.mpd.environment = {
XDG_RUNTIME_DIR = "/run/user/1000";
};
environment.systemPackages = with pkgs; [
ncmpcpp
mpc-cli
];
}
1 change: 1 addition & 0 deletions machines/pcLexell/ranger.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
LOCKED_REV=$(read-or-value $LOCKSFILE "NONE")
ACTUAL_REV=$(readlink -f $NIX_RANGER)
if [ "$LOCKED_REV" != "$ACTUAL_REV" ]; then
rm -rf $REAL_RANGER
cp -rL $NIX_RANGER $REAL_RANGER
chmod -R +w $REAL_RANGER
echo -n "$ACTUAL_REV" > $LOCKSFILE
Expand Down
89 changes: 89 additions & 0 deletions machines/pcLexell/ranger/rifle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# vim: ft=cfg
#
# This is the configuration file of "rifle", ranger's file executor/opener.
# Each line consists of conditions and a command. For each line the conditions
# are checked and if they are met, the respective command is run.
#
# Syntax:
# <condition1> , <condition2> , ... = command
#
# The command can contain these environment variables:
# $1-$9 | The n-th selected file
# $@ | All selected files
#
# If you use the special command "ask", rifle will ask you what program to run.
#
# Prefixing a condition with "!" will negate its result.
# These conditions are currently supported:
# match <regexp> | The regexp matches $1
# ext <regexp> | The regexp matches the extension of $1
# mime <regexp> | The regexp matches the mime type of $1
# name <regexp> | The regexp matches the basename of $1
# path <regexp> | The regexp matches the absolute path of $1
# has <program> | The program is installed (i.e. located in $PATH)
# env <variable> | The environment variable "variable" is non-empty
# file | $1 is a file
# directory | $1 is a directory
# number <n> | change the number of this command to n
# terminal | stdin, stderr and stdout are connected to a terminal
# X | A graphical environment is available (darwin, Xorg, or Wayland)
#
# There are also pseudo-conditions which have a "side effect":
# flag <flags> | Change how the program is run. See below.
# label <label> | Assign a label or name to the command so it can
# | be started with :open_with <label> in ranger
# | or `rifle -p <label>` in the standalone executable.
# else | Always true.
#
# Flags are single characters which slightly transform the command:
# f | Fork the program, make it run in the background.
# | New command = setsid $command >& /dev/null &
# r | Execute the command with root permissions
# | New command = sudo $command
# t | Run the program in a new terminal. If $TERMCMD is not defined,
# | rifle will attempt to extract it from $TERM.
# | New command = $TERMCMD -e $command
# Note: The "New command" serves only as an illustration, the exact
# implementation may differ.
# Note: When using rifle in ranger, there is an additional flag "c" for
# only running the current file even if you have marked multiple files.

#-------------------------------------------
# Misc
#-------------------------------------------
# Define the "editor" for text files as first action
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
mime ^text, label pager = "$PAGER" -- "$@"
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"

ext 1 = man "$1"
ext s[wmf]c, has zsnes, X = zsnes "$1"
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1"
ext exe = wine "$1"
name ^[mM]akefile$ = make

#-------------------------------------------
# Generic file openers
#-------------------------------------------
label open, has xdg-open = nohup xdg-open "$@" </dev/null &>/dev/null &
label open, has open = nohup open "$@" </dev/null &>/dev/null &

# Define the editor for non-text files + pager as last action
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"


######################################################################
# The actions below are left so low down in this file on purpose, so #
# they are never triggered accidentally. #
######################################################################

# Execute a file as program/script.
mime application/x-executable = "$1"

# Move the file to trash using trash-cli.
label trash, has trash-put = trash-put -- "$@"
label trash = mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash
4 changes: 4 additions & 0 deletions machines/pcLexell/sound.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
}: let
mutespeaker = pkgs.writeShellScriptBin "mutespeaker" (builtins.readFile ./mutespeaker.sh);
in {
imports = [
./mpd.nix
];

sound.enable = true;
services.pipewire = {
enable = true;
Expand Down
16 changes: 8 additions & 8 deletions machines/pcLexell/x.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ in {
};
hardware.bolt.enable = false;
dbus.enable = true;
tumbler.enable = true;
#tumbler.enable = true;
};

#environment.etc.wallaper.source = ./GreyDot.png;
Expand All @@ -62,18 +62,18 @@ in {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
];
extraPackages32 = with pkgs.pkgsi686Linux; [libva];
setLdLibraryPath = true;
#extraPackages = with pkgs; [
# vaapiVdpau
# libvdpau-va-gl
#];
#extraPackages32 = with pkgs.pkgsi686Linux; [libva];
#setLdLibraryPath = true;
};
nvidia = {
#open = false;
modesetting.enable = true;
nvidiaSettings = true;
forceFullCompositionPipeline = true;
#forceFullCompositionPipeline = true;
powerManagement.enable = true;
#package = config.boot.kernelPackages.nvidiaPackages.stable; #Optional
};
Expand Down

0 comments on commit 85d8a0f

Please sign in to comment.