reorganise
This commit is contained in:
parent
98af4d5664
commit
744f70fc87
14 changed files with 72 additions and 64 deletions
234
system/global/home.nix
Normal file
234
system/global/home.nix
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
{ config, pkgs, user, name, ... }:
|
||||
# https://nix-community.github.io/home-manager/options.html
|
||||
{
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.username = "tristan";
|
||||
home.homeDirectory = "/home/tristan";
|
||||
|
||||
xdg.userDirs.enable = true;
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
associations.added = {
|
||||
"inode/directory" = "lf.desktop;vscodium.desktop;pcmanfm.desktop";
|
||||
};
|
||||
defaultApplications = {
|
||||
"inode/directory" = "lf.desktop";
|
||||
"text/html" = "brave-browser.desktop";
|
||||
"x-scheme-handler/http" = "brave-browser.desktop";
|
||||
"x-scheme-handler/https" = "brave-browser.desktop";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# script requirements
|
||||
libnotify
|
||||
playerctl
|
||||
grim
|
||||
wl-clipboard
|
||||
slurp
|
||||
chafa
|
||||
wofi
|
||||
|
||||
# utils
|
||||
exa
|
||||
du-dust
|
||||
htop
|
||||
imv
|
||||
libsixel
|
||||
|
||||
# apps
|
||||
gimp
|
||||
logseq
|
||||
quickemu
|
||||
ansible
|
||||
bitwarden
|
||||
nextcloud-client
|
||||
godot_4
|
||||
ardour
|
||||
blender
|
||||
musescore
|
||||
];
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.swaylock.settings = {
|
||||
clock = true;
|
||||
screenshots = true;
|
||||
effect-scale = 0.5;
|
||||
effect-blur = "10x10";
|
||||
};
|
||||
|
||||
services.swayidle.enable = true;
|
||||
services.swayidle.events = [
|
||||
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }
|
||||
{ event = "lock"; command = "${pkgs.swaylock}/bin/swaylock"; }
|
||||
];
|
||||
|
||||
programs.waybar.enable = true;
|
||||
programs.waybar.settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 30;
|
||||
modules-left = [ "wlr/taskbar" "hyprland/window" ];
|
||||
modules-right = [ "mpd" "pulseaudio" "clock" "tray" ];
|
||||
clock = {
|
||||
format = "📅 {:%a %b-%d %I:%M %p}";
|
||||
};
|
||||
pulseaudio = {
|
||||
format-muted = "🔇 {volume}%";
|
||||
format = "{icon} {volume}";
|
||||
format-icons.default = ["🔈" "🔉" "🔊"];
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
mpd = {
|
||||
server = "192.168.1.2";
|
||||
on-click = "foot -e ncmpcpp";
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.waybar.systemd.enable = true;
|
||||
|
||||
services.udiskie = {
|
||||
enable = true;
|
||||
notify = true;
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Materia-dark";
|
||||
package = pkgs.materia-theme;
|
||||
};
|
||||
gtk3.bookmarks = [
|
||||
"file:///home/tristan/Documents"
|
||||
];
|
||||
};
|
||||
|
||||
services.fnott = {
|
||||
enable = true;
|
||||
# https://codeberg.org/dnkl/fnott/src/branch/master/fnott.ini
|
||||
settings = {
|
||||
main = {
|
||||
selection-helper = "wofi --show dmenu";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.ncmpcpp = {
|
||||
enable = true;
|
||||
settings.mpd_host = "music.local";
|
||||
bindings = [
|
||||
{ key = "j"; command = "scroll_down"; }
|
||||
{ key = "k"; command = "scroll_up"; }
|
||||
{ key = "J"; command = [ "select_item" "scroll_down" ]; }
|
||||
{ key = "K"; command = [ "select_item" "scroll_up" ]; }
|
||||
];
|
||||
};
|
||||
services.mpd-mpris.enable = true;
|
||||
services.mpd-mpris.mpd = {
|
||||
host = "music.local";
|
||||
};
|
||||
|
||||
programs.mpv.enable = true;
|
||||
programs.mpv.bindings = {
|
||||
l = "seek 5";
|
||||
h = "seek -5";
|
||||
e = "add chapter 1";
|
||||
b = "add chapter -1";
|
||||
">" = "multiply speed 1.1";
|
||||
"<" = "multiply speed 1/1.1";
|
||||
"." = "frame-step";
|
||||
"," = "frame-back-step";
|
||||
"ctrl+n" = "playlist-next";
|
||||
"ctrl+p" = "playlist-prev";
|
||||
k = "add volume 2";
|
||||
j = "add volume -2";
|
||||
m = "cycle mute";
|
||||
c = "cycle sub-visibility";
|
||||
};
|
||||
|
||||
programs.foot.enable = true;
|
||||
programs.foot.server.enable = true;
|
||||
programs.foot.settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
font = "mono:size=12";
|
||||
};
|
||||
colors = {
|
||||
foreground="abb2bf";
|
||||
background="282c34";
|
||||
regular0="222222";
|
||||
regular1="eb3a26";
|
||||
regular2="7fbc59";
|
||||
regular3="e9db65";
|
||||
regular4="4781d1";
|
||||
regular5="7d74bb";
|
||||
regular6="50a2bd";
|
||||
regular7="dcdccc";
|
||||
bright0="666666";
|
||||
bright1="e15d4e";
|
||||
bright2="8fbd73";
|
||||
bright3="e3d97e";
|
||||
bright4="6791ce";
|
||||
bright5="8f88be";
|
||||
bright6="6caabf";
|
||||
bright7="ffffff";
|
||||
};
|
||||
};
|
||||
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
extensions = with pkgs; [
|
||||
vscode-extensions.asvetliakov.vscode-neovim
|
||||
vscode-extensions.jnoortheen.nix-ide
|
||||
];
|
||||
userSettings = {
|
||||
"vscode-neovim.neovimExecutablePaths.linux" = "/run/current-system/sw/bin/nvim";
|
||||
"keyboard.dispatch" = "keyCode";
|
||||
};
|
||||
};
|
||||
|
||||
services.nextcloud-client.enable = true;
|
||||
services.nextcloud-client.startInBackground = true;
|
||||
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
email = "tristan@tristans.cloud";
|
||||
base_url = "https://vault.tristans.cloud";
|
||||
};
|
||||
};
|
||||
|
||||
programs.ssh.enable = true;
|
||||
programs.ssh.matchBlocks = {
|
||||
"git.tristans.cloud" = {
|
||||
user = "git";
|
||||
port = 2222;
|
||||
};
|
||||
};
|
||||
|
||||
programs.neovim.defaultEditor = true;
|
||||
|
||||
programs.lf.enable = true;
|
||||
programs.lf.keybindings = {
|
||||
D = "trash";
|
||||
};
|
||||
|
||||
home.sessionPath = [
|
||||
"$HOME/.local/scripts"
|
||||
];
|
||||
home.file.".local/scripts" = {
|
||||
source = ./scripts;
|
||||
executable = true;
|
||||
recursive = true;
|
||||
};
|
||||
home.file.".config/wofi/config".text = ''
|
||||
term=foot
|
||||
'';
|
||||
|
||||
}
|
||||
13
system/global/scripts/autostart
Executable file
13
system/global/scripts/autostart
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
nextcloud &
|
||||
waybar &
|
||||
|
||||
swaybg \
|
||||
-o eDP-1 -i ~/Pictures/backgrounds/nix-wallpaper-waterfall.png \
|
||||
-o DP-1 -i ~/Pictures/backgrounds/demonslayer.jpg \
|
||||
-o HDMI-A-1 -i ~/Pictures/backgrounds/nier.jpg &
|
||||
|
||||
swayidle -w \
|
||||
timeout 600 'swaylock &' &
|
||||
|
||||
3
system/global/scripts/bwmenu
Executable file
3
system/global/scripts/bwmenu
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
rbw list | wofi --show dmenu | xargs -I_ rbw get _ | wl-copy
|
||||
11
system/global/scripts/play-pause
Executable file
11
system/global/scripts/play-pause
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$(playerctl --list-all | wc -l)" -lt 2 ]
|
||||
then
|
||||
playerctl play-pause
|
||||
else
|
||||
playerctl --list-all | \
|
||||
xargs -I _ playerctl --player _ metadata --format '_ - {{title}}' | \
|
||||
wofi --dmenu | awk '{print $1}' | \
|
||||
xargs -I _ playerctl --player _ play-pause
|
||||
fi
|
||||
9
system/global/scripts/screenshot
Executable file
9
system/global/scripts/screenshot
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
OUT_DIR=${GRIM_DEFAULT_DIR:-~/Pictures/Screenshots/}
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
grim -g "$(slurp -o)" - | wl-copy
|
||||
notify-send "Screenshot Taken" "to the clipboard"
|
||||
wl-paste > $OUT_DIR/$(date +"%Y-%m-%dT%H:%M:%SZ").png
|
||||
|
||||
149
system/global/system.nix
Normal file
149
system/global/system.nix
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
|
||||
# https://search.nixos.org/options
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
};
|
||||
|
||||
nix.settings.trusted-users = [ "root" "tristan" ];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
useXkbConfig = true;
|
||||
};
|
||||
|
||||
# use pipewire
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
|
||||
security.doas.enable = true;
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
# Configure graphical stuff
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
layout = "gb";
|
||||
libinput.enable = true;
|
||||
|
||||
# the only display manager that works?
|
||||
displayManager.gdm.enable = true;
|
||||
displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "tristan";
|
||||
};
|
||||
};
|
||||
|
||||
qt.enable = true;
|
||||
qt.platformTheme = "gtk2";
|
||||
qt.style = "gtk2";
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
# services.flatpak.enable = true;
|
||||
xdg.portal.enable = true;
|
||||
|
||||
users.users.tristan = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "video" ];
|
||||
initialPassword = "pass";
|
||||
shell = pkgs.fish;
|
||||
};
|
||||
programs.fish.enable = true;
|
||||
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
TERMINAL = "foot";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
foot
|
||||
brave
|
||||
tealdeer
|
||||
alsa-utils
|
||||
wofi
|
||||
waybar
|
||||
swaylock-effects
|
||||
swayidle
|
||||
swaybg
|
||||
pcmanfm
|
||||
pavucontrol
|
||||
trash-cli
|
||||
(neovim.override {
|
||||
vimAlias = true;
|
||||
configure = {
|
||||
packages.myPlugins = with pkgs.vimPlugins; {
|
||||
start = [ vim-surround vim-commentary vim-nix ];
|
||||
opt = [];
|
||||
};
|
||||
customRC = ''
|
||||
vnoremap * y/\V<C-R>=escape(@",'/\')<CR><CR>
|
||||
vnoremap <C-R> "ry:%s/<C-R>=escape(@r,'/\')<CR>
|
||||
vnoremap A :norm A
|
||||
set number
|
||||
set rnu
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set mouse=a
|
||||
set path=.,**
|
||||
let g:netrw_banner=0
|
||||
let g:netrw_liststyle=3
|
||||
set undofile
|
||||
set undodir=~/.local/share/nvim/undo
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
services.dbus.enable = true;
|
||||
programs.light.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
programs.tmux.enable = true;
|
||||
programs.tmux.extraConfig = ''
|
||||
set escape-time 0
|
||||
set -g default-terminal screen
|
||||
|
||||
bind -n M-s split-window -v
|
||||
bind -n M-v split-window -h
|
||||
bind -n M-Enter split-window -h
|
||||
bind -n M-h select-pane -L
|
||||
bind -n M-j select-pane -D
|
||||
bind -n M-k select-pane -U
|
||||
bind -n M-l select-pane -R
|
||||
bind -n M-q kill-pane
|
||||
bind -n M-< resize-pane -L 10
|
||||
bind -n M-> resize-pane -R 10
|
||||
bind -n M-- resize-pane -D 10
|
||||
bind -n M-+ resize-pane -U 10
|
||||
bind -n M-u copy-mode
|
||||
bind -n M-p paste-buffer
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind-key -T copy-mode-vi y send-keys -X copy-selection
|
||||
'';
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue