diff --git a/README.md b/README.md
deleted file mode 100644
index 20d3cbc..0000000
--- a/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
Kan`s dotfiles
-
-
-
-
-
-
-
-
-
-
-
-## Content
-
-* [Project description](#chapter-0)
-* [Installation](#chapter-1)
-
-
-
-## Project description
-
-Config files for:
-* zsh
-* alacritty
-* tmux
-* ssh
-* git
-* ranger
-* sway
-* vim
-* nvim
-
-
-### Prompt
-
-
-
-
-You can add your files to the `~/.config/zsh/zshrc.d` directory for zsh so
-that they automatically run in ascending order when you open a terminal.\
-Example:\
-`~/.config/zsh/zshrc.d/01_hello.sh`
-```sh
-echo "Hello $USER!"
-```
-
-
-## Installation
-
-```sh
-git clone https://github.com/TheK4n/dotfiles
-cd dotfiles
-./install zsh nvim ...
-```
-
-
-## Installation script
-Per-user dotfiles "package" manager
-
-### Features
-1. Installing files from dotfiles/home/user to $HOME
-2. Uninstalling installed files
-3. Check installation integrity
-4. Transaction based installation
-5. Does not overwrite your configs
-
-
-
diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix
index 814026f..32d026b 100644
--- a/hosts/default/configuration.nix
+++ b/hosts/default/configuration.nix
@@ -46,6 +46,8 @@
};
};
+ services.gpm.enable = true;
+
programs.sway = {
enable = true;
};
diff --git a/hosts/thek4n/configuration.nix b/hosts/thek4n/configuration.nix
index 3c3fc16..53ba264 100644
--- a/hosts/thek4n/configuration.nix
+++ b/hosts/thek4n/configuration.nix
@@ -1,3 +1,11 @@
-{ config, pkgs, inputs, hostname, username, ... }:
+{ config, pkgs, inputs, lib, hostname, username, ... }:
-{}
+{
+ imports = [
+ ../../modules/user-services/mpv.nix
+ ];
+
+ users.users.${username} = {
+ linger = true;
+ };
+}
diff --git a/install-hooks/arch/pre-install b/install-hooks/arch/pre-install
deleted file mode 100755
index d871be5..0000000
--- a/install-hooks/arch/pre-install
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-echo 'pacman -S man-pages man-db lesspipe'
-echo 'echo "ParallelDownloads = 5\nVerbosePkgLists" >> /etc/pacman.conf'
-echo 'sudo systemctl enable --now gpm'
-echo 'sudo sysctl kernel.sysrq=1'
\ No newline at end of file
diff --git a/install-hooks/music/post-install b/install-hooks/music/post-install
deleted file mode 100755
index 4df30b0..0000000
--- a/install-hooks/music/post-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh -eu
-
-systemctl --user enable --now mpv
diff --git a/install-hooks/music/pre-install b/install-hooks/music/pre-install
deleted file mode 100755
index 3017ace..0000000
--- a/install-hooks/music/pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh -eu
-
-echo "sudo pacman -S mpv socat"
diff --git a/install-hooks/nvim/pre-install b/install-hooks/nvim/pre-install
deleted file mode 100755
index 957b66e..0000000
--- a/install-hooks/nvim/pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "sudo pacman -S npm ctags fzf glow tree-sitter tree-sitter-cli; mkdir ~/.npm-global; npm config set prefix '~/.npm-global'"
diff --git a/install-hooks/ranger/post-install b/install-hooks/ranger/post-install
deleted file mode 100755
index 2fbdfab..0000000
--- a/install-hooks/ranger/post-install
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-mkdir -p "${SANDBOX_PATH}/.config/ranger/plugins"
-git clone https://github.com/alexanderjeurissen/ranger_devicons "${SANDBOX_PATH}/.config/ranger/plugins/ranger_devicons"
diff --git a/install-hooks/ranger/pre-install b/install-hooks/ranger/pre-install
deleted file mode 100755
index ee22c97..0000000
--- a/install-hooks/ranger/pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "sudo pacman -S highlight ttf-joypixels noto-fonts-emoji ueberzug poppler"
\ No newline at end of file
diff --git a/install-hooks/sway/pre-install b/install-hooks/sway/pre-install
deleted file mode 100755
index 206a942..0000000
--- a/install-hooks/sway/pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "pacman -S sway swaybg i3blocks waybar swaylock swayidle wl-clipboard ydotool grim slurp mako wlr-randr rofi jq brightnessctl kanshi wtype"
diff --git a/install-hooks/tmux/pre-install b/install-hooks/tmux/pre-install
deleted file mode 100755
index bb08add..0000000
--- a/install-hooks/tmux/pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo 'pacman -S fd zoxide'
diff --git a/install-hooks/yazi/pre-install b/install-hooks/yazi/pre-install
deleted file mode 100755
index a724da6..0000000
--- a/install-hooks/yazi/pre-install
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo 'sudo pacman -S yazi ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick'
diff --git a/modules/common/boot.nix b/modules/common/boot.nix
index 0bb6757..9a2eb19 100644
--- a/modules/common/boot.nix
+++ b/modules/common/boot.nix
@@ -9,4 +9,8 @@
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
+
+ boot.kernel.sysctl = {
+ "kernel.sysrq" = 1;
+ };
}
diff --git a/modules/user-services/mpv.nix b/modules/user-services/mpv.nix
new file mode 100644
index 0000000..de856e0
--- /dev/null
+++ b/modules/user-services/mpv.nix
@@ -0,0 +1,61 @@
+{ config, pkgs, inputs, lib, hostname, username, ... }:
+
+let
+ mpv-service-script = pkgs.writeShellScriptBin "mpv-service" ''
+ #!/bin/sh -eu
+
+ SOCKET_PATH="/tmp/mpv-${USER}.sock"
+
+ rm -f "''${SOCKET_PATH}"
+
+ cleanup() {
+ echo "Stopping MPV service..."
+ rm -f "''${SOCKET_PATH}"
+ pkill -P $$ mpv || true
+ }
+ trap cleanup EXIT TERM INT
+
+ exec ${pkgs.mpv}/bin/mpv \
+ --really-quiet \
+ --idle \
+ --no-video --force-window=no \
+ --input-ipc-server="''${SOCKET_PATH}" \
+ --demuxer-max-bytes=50MiB \
+ --demuxer-max-back-bytes=10MiB \
+ --audio-buffer=0.5
+ '';
+in {
+ systemd.user.services.mpv-service = {
+ enable = true;
+ description = "MPV Audio Player Service with IPC";
+ documentation = [ "man:mpv(1)" ];
+
+ wantedBy = [ "default.target" ];
+ after = [ "sound.target" ];
+ wants = [ "sound.target" ];
+
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = "${mpv-service-script}/bin/mpv-service";
+ Restart = "on-failure";
+ RestartSec = "5";
+
+ Environment = [
+ "DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus"
+ "XDG_RUNTIME_DIR=%t"
+ ];
+
+ StandardOutput = "journal";
+ StandardError = "journal";
+
+ PrivateTmp = false;
+ ProtectSystem = "strict";
+ ProtectHome = "read-only";
+ NoNewPrivileges = true;
+ };
+
+ environment = {
+ MPV_SOCKET = "/tmp/mpv-${username}.sock";
+ };
+ };
+}
diff --git a/opt/bin/sandbox b/opt/bin/sandbox
deleted file mode 100755
index 9568dd7..0000000
--- a/opt/bin/sandbox
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh -eu
-exec docker run --rm -it --network none sandbox