nix
This commit is contained in:
parent
e3e9b3b2cf
commit
3681176f62
68
README.md
68
README.md
@ -1,68 +0,0 @@
|
|||||||
<h1 align="center">Kan`s dotfiles</h1>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://github.com/TheK4n">
|
|
||||||
<img src="https://img.shields.io/github/followers/TheK4n?label=Follow&style=social" alt="TheK4n">
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/TheK4n/dotfiles">
|
|
||||||
<img src="https://img.shields.io/github/stars/TheK4n/dotfiles?style=social" alt="project">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
## Content
|
|
||||||
|
|
||||||
* [Project description](#chapter-0)
|
|
||||||
* [Installation](#chapter-1)
|
|
||||||
|
|
||||||
|
|
||||||
<a id="chapter-0"></a>
|
|
||||||
## Project description
|
|
||||||
|
|
||||||
Config files for:
|
|
||||||
* zsh
|
|
||||||
* alacritty
|
|
||||||
* tmux
|
|
||||||
* ssh
|
|
||||||
* git
|
|
||||||
* ranger
|
|
||||||
* sway
|
|
||||||
* vim
|
|
||||||
* nvim
|
|
||||||
|
|
||||||
|
|
||||||
### Prompt
|
|
||||||
<p align="center">
|
|
||||||
<img src=".assets/prompt.png" alt="Prompt">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
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!"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a id="chapter-1"></a>
|
|
||||||
## 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
|
|
||||||
|
|
||||||
|
|
||||||
<h1 align="center"><a href="#top">▲</a></h1>
|
|
||||||
@ -46,6 +46,8 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.gpm.enable = true;
|
||||||
|
|
||||||
programs.sway = {
|
programs.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
@ -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'
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh -eu
|
|
||||||
|
|
||||||
systemctl --user enable --now mpv
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh -eu
|
|
||||||
|
|
||||||
echo "sudo pacman -S mpv socat"
|
|
||||||
@ -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'"
|
|
||||||
@ -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"
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "sudo pacman -S highlight ttf-joypixels noto-fonts-emoji ueberzug poppler"
|
|
||||||
@ -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"
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo 'pacman -S fd zoxide'
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo 'sudo pacman -S yazi ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick'
|
|
||||||
@ -9,4 +9,8 @@
|
|||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
"kernel.sysrq" = 1;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
61
modules/user-services/mpv.nix
Normal file
61
modules/user-services/mpv.nix
Normal file
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh -eu
|
|
||||||
exec docker run --rm -it --network none sandbox
|
|
||||||
Loading…
x
Reference in New Issue
Block a user