Files
dotfiles/home.nix
2024-03-06 18:05:23 +01:00

370 lines
9.5 KiB
Nix

{ config, pkgs, lib, allowed, secrets, ... }:
{
imports = [
# Make vscode settings writable
(import (builtins.fetchurl {
url = "https://gist.githubusercontent.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa/raw/41e569ba110eb6ebbb463a6b1f5d9fe4f9e82375/mutability.nix";
sha256 = "4b5ca670c1ac865927e98ac5bf5c131eca46cc20abf0bd0612db955bfc979de8";
}) { inherit config lib; })
(import (builtins.fetchurl {
url = "https://gist.githubusercontent.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa/raw/41e569ba110eb6ebbb463a6b1f5d9fe4f9e82375/vscode.nix";
sha256 = "fed877fa1eefd94bc4806641cea87138df78a47af89c7818ac5e76ebacbd025f";
}) { inherit config lib pkgs; })
];
home.username = "nx2";
home.homeDirectory = "/home/nx2";
home.stateVersion = "23.11";
nixpkgs.config = {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) allowed.unfree-packages;
permittedInsecurePackages = allowed.inecure-packages;
};
home.packages = with pkgs; [
firefox chromium
vscodium gimp inkscape
kitty
zathura remmina
#vesktop
thunderbird element-desktop # zoom-us
obsidian
spotify spicetify-cli
obs-studio bitwarden
hyprland-protocols waybar swww hyprland-autoname-workspaces rofi wlogout imv mpv
pavucontrol fontpreview gtk2fontsel
lynx tldr fzf
libinput-gestures dotool wev gnome.nautilus gnome.gnome-themes-extra gnome.adwaita-icon-theme gnome.gnome-tweaks gtk3 gtk4 lxappearance
element sssnake pipes
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
(pkgs.writeShellScriptBin "nx_connect_to_pnx" ''
cd /home/nx2/PNX/vpn
sudo openvpn /home/nx2/PNX/vpn/firewall_phoenix_1_local_RW_Phoenix.ovpn
'')
];
xdg.mimeApps = {
enable = true;
defaultApplications = {
"default-web-browser" = [ "firefox.desktop" ];
"text/html" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
"x-scheme-handler/about" = [ "firefox.desktop" ];
"x-scheme-handler/unknown" = [ "firefox.desktop" ];
"image/png" = "imv.desktop";
"image/gif" = "imv.desktop";
};
};
# systemd.user.services = {
# ydotoold = {
# Unit = {
# Description = "An auto-input utility for wayland";
# Documentation = [ "man:ydotool(1)" "man:ydotoold(8)" ];
# };
# Service = {
# ExecStart = "/run/current-system/sw/bin/ydotoold --socket-path /tmp/ydotool_socket ";
# };
# Install = {
# WantedBy = ["default.target"];
# };
# };
# };
home.file = {
# ".config/libinput/gestures".text = ''
# # Swipe threshold (0-100)
# swipe_threshold 0
# # Gestures
# gesture swipe left 3 ydotool key 276:1 276:0
# gesture swipe right 3 ydotool key 275:1 275:0
# ''
".config/libinput/gestures".text = ''
# Swipe threshold (0-100)
swipe_threshold 0
# Gestures
gesture swipe left 3 echo key k:276 | dotool
gesture swipe right 3 echo key k:275 | dotool
'';
".config/hyprland-autoname-workspaces/config.toml".text = ''
version = "1.1.13"
[class]
Signal = "󱅵"
DEFAULT = "{class}"
libreoffice-writer = ""
pavucontrol = "󰕾"
"epicgameslauncher.exe" = "󰯷"
"riotclientux.exe" = "󰰌"
"[Cc]ode" = "󰨞"
VirtualBox = ""
KiCad = ""
Gimp = ""
code-oss = "󰨞"
VSCodium = "󰨞"
Alacritty = ""
kitty = ""
vesktop = "󰙯"
"cyberpunk2077.exe" = "󰾲"
"Tor Browser" = "󰾔"
"[Tt]hunderbird" = ""
Element = "󰘨"
blueman-manager = "󰂯"
obsidian = "󰠮"
libreoffice-calc = ""
zoom = "󰬡"
mpv = ""
chatterino = ""
"com.obsproject.Studio" = ""
"leagueclientux.exe" = "󰰌"
"[sS]potify" = ""
"org.remmina.Remmina" = "󰢹"
steam = "󰓓"
"galaxyclient.exe" = "󰮡"
"[Ff]irefox" = "󰈹"
pcbnew = ""
".*.exe" = ""
Chromium = ""
virt-manager = ""
Bitwarden = ""
"[tT]hunar" = ""
zathura = "󰈦"
discord = "󰙯"
"VirtualBox Manager" = ""
"org.inkscape.Inkscape" = "󰕙"
"VirtualBox Machine" = ""
lutris = "󰊗"
"[gG]imp-.*" = ""
[class_active]
"(?i)ExampleOneTerm" = "icon"
[initial_class]
[initial_class_active]
[workspaces_name]
10 = "ten"
4 = "four"
8 = "eight"
9 = "nine"
6 = "six"
1 = "one"
3 = "three"
2 = "two"
0 = "zero"
7 = "seven"
5 = "five"
[title_in_class]
[title_in_class_active]
[title_in_initial_class]
[title_in_initial_class_active]
[initial_title_in_class]
[initial_title_in_class_active]
[initial_title_in_initial_class]
[initial_title_in_initial_class_active]
[exclude]
"(?i)fcitx" = ".*"
aProgram = "^$"
"ueberzug.*" = ""
"" = "^$"
"[Ss]team" = "^(Friends List.*)?$"
"explorer.exe" = ".*"
"(?i)TestApp" = ""
[format]
dedup = false
dedup_inactive_fullscreen = false
delim = " "
workspace = "{id}: {clients}"
workspace_empty = "{id}"
client = "{icon}"
client_fullscreen = "{icon}"
client_active = "{icon}"
client_dup = "{icon}{counter_sup}"
client_dup_active = "*{icon}*{delim}{icon}{counter_unfocused_sup}"
client_dup_fullscreen = "[{icon}]{delim}{icon}{counter_unfocused_sup}"
'';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home
# Manager then you have to manually source 'hm-session-vars.sh' located at
# either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/nx2/etc/profile.d/hm-session-vars.sh
#
# home.sessionVariables = {
systemd.user.sessionVariables = {
EDITOR = "micro";
BROWSER = "firefox";
# YDOTOOL_SOCKET = "/tmp/ydotool_socket";
};
#https://github.com/NixOS/nixpkgs/blob/592047fc9e4f7b74a4dc85d1b9f5243dfe4899e3/pkgs/applications/editors/vscode/extensions/default.nix#L1539
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [
jnoortheen.nix-ide
viktorqvarfordt.vscode-pitch-black-theme
ms-python.python
ms-python.black-formatter
redhat.vscode-yaml
redhat.vscode-xml
ms-python.python
mhutchie.git-graph
github.vscode-pull-request-github
esbenp.prettier-vscode
gencer.html-slim-scss-css-class-completion
donjayamanne.githistory
mads-hartmann.bash-ide-vscode
#jeanp413.open-remote-ssh
# ms-vscode-remote.remote-ssh
# ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
# {
# name = "remote-ssh-edit";
# publisher = "ms-vscode-remote";
# version = "0.47.2";
# sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
# }
];
userSettings = {
workbench.colorTheme = "Just Black";
editor.fontFamily = "'CaskaydiaCove Nerd Font', 'monospace', monospace";
};
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
keybindings = [
{
key = "ctrl+d";
command = "editor.action.deleteLines";
when = "textInputFocus";
}
{
key = "ctrl+shift+d";
command = "editor.action.duplicateSelection";
when = "textInputFocus";
}
{ # unset so that ctrl d is not set twice
key = "";
command = "editor.action.addSelectionToNextFindMatch";
when = "editorFocus";
}
{ # unset so that ctrl shift d is not set twice
key = "";
command = "workbench.view.debug";
}
];
};
gtk = {
enable = true;
theme = {
name = "Adwaita-Dark";
package = pkgs.gnome.gnome-themes-extra;
};
gtk3.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
gtk4.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
};
home.sessionVariables.GTK_THEME = "Adwaita-Dark";
xdg.configFile = {
"gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets";
"gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css";
"gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css";
};
dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
gtk-theme = "Adwaita-Dark";
};
};
};
# Wayland, X, etc. support for session vars
# systemd.user.sessionVariables = home.sessionVariables;
qt = {
platformTheme = "gtk";
};
home.file.".ssh/config".text = ''
HOST nxace
HostName nx2.site
User nx2
Port 50022
HOST nxacel
HostName 192.168.178.32
User nx2
Port 50022
HOST nxrpi
HostName nx2.site
User pi
Port 50023
HOST nxrpil
HostName 192.168.178.31
User pi
Port 50023
'';
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}