2023-05-03 07:19:19 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
2023-05-10 02:13:24 +02:00
|
|
|
imports = [ ./hosts/laptop.nix ];
|
2023-05-03 07:19:19 +02:00
|
|
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
networking.hostName = "nixos";
|
|
|
|
networking.networkmanager.enable = true;
|
2023-05-08 19:50:47 +02:00
|
|
|
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
|
|
|
networking.networkmanager.dns = "none";
|
|
|
|
networking.useHostResolvConf = true;
|
|
|
|
|
|
|
|
services.vnstat.enable = true;
|
|
|
|
services.tumbler.enable = true;
|
|
|
|
services.xserver.displayManager.sddm.enable = true;
|
2023-05-03 07:19:19 +02:00
|
|
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
users.defaultUserShell = pkgs.fish;
|
|
|
|
environment.shells = with pkgs; [ fish ];
|
2023-05-08 20:18:38 +02:00
|
|
|
programs.fish.shellAbbrs = {
|
|
|
|
g = "git";
|
|
|
|
ga = "git add";
|
|
|
|
gaa = "git add --all";
|
|
|
|
gap = "git add --patch";
|
|
|
|
gb = "git branch"; # List all branches
|
|
|
|
gc = "git commit -m";
|
|
|
|
gca = "git commit --amend";
|
|
|
|
gcl = "git clone";
|
|
|
|
gco = "git checkout";
|
|
|
|
gd = "git diff"; # Show all file changes not staged yet
|
|
|
|
gdi = "git difftool --no-symlinks --dir-diff";
|
|
|
|
gds = "git diff --staged"; # Show changes staged but not committed
|
|
|
|
gdsi = "git difftool --no-symlinks --dir-diff --staged";
|
|
|
|
gi = "git init";
|
|
|
|
gl = "git log --oneline --decorate --all --graph -n 10";
|
|
|
|
gm = "git merge";
|
|
|
|
gp = "git push"; # Push your commits to a remote server
|
|
|
|
gr = "git reset HEAD~"; # Undo the last commit but keep changed files
|
|
|
|
gra = "git remote add";
|
|
|
|
gre = "git remote --verbose"; # List all remotes
|
|
|
|
grh = "git reset HEAD";
|
|
|
|
grr =
|
|
|
|
"git reset --hard HEAD~"; # Remove the last commit and all changes with it
|
|
|
|
gs = "git status";
|
|
|
|
gst = "git stash";
|
|
|
|
gstp = "git stash pop";
|
|
|
|
gt = "git tag";
|
|
|
|
gts = "git tag -s";
|
|
|
|
|
|
|
|
d = "sudo docker";
|
|
|
|
dc = "sudo docker-compose";
|
|
|
|
dcu = "sudo docker-compose up";
|
|
|
|
dcd = "sudo docker-compose down";
|
|
|
|
dcp = "sudo docker-compose pull";
|
|
|
|
dcl = "sudo docker-compose logs";
|
|
|
|
|
|
|
|
y = "yarn";
|
|
|
|
ya = "yarn add";
|
|
|
|
yar = "yarn remove";
|
|
|
|
yi = "yarn init";
|
|
|
|
yin = "yarn install";
|
|
|
|
yu = "yarn upgrade-interactive";
|
|
|
|
|
|
|
|
v = "vagrant";
|
|
|
|
vu = "vagrant up";
|
|
|
|
vh = "vagrant halt";
|
|
|
|
vs = "vagrant ssh";
|
|
|
|
vp = "vagrant provision";
|
|
|
|
|
|
|
|
dl = "yt-dlp";
|
|
|
|
vol =
|
|
|
|
"amixer set 'Master'"; # Change the volume, e.g. vol 10%+, vol 10%-, vol 100%
|
|
|
|
copy = "xclip -sel clip <"; # Easily copy the contents of any file
|
|
|
|
cf = "tput reset"; # Clear the terminal completely
|
|
|
|
nf =
|
|
|
|
"tput reset; and neofetch --size 56%; and xdotool key --delay 100 Ctrl+Shift+Page_Up";
|
|
|
|
df = "df --human-readable --type=ext4 --total";
|
|
|
|
du = "du --human-readable --summarize";
|
|
|
|
jis =
|
|
|
|
"recode shift_jis..utf8"; # Easily convert shift_jis-encoded files to utf8
|
|
|
|
utf16 =
|
|
|
|
"recode utf16..utf8"; # Rarely, some files from Japan are utf16 instead
|
|
|
|
jp = "LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8";
|
|
|
|
|
|
|
|
a = "ansible-playbook";
|
|
|
|
b = "feh --bg-fill"; # Change the background
|
|
|
|
c = "clear"; # Because 5 letters is too much
|
|
|
|
e = "exit";
|
|
|
|
k = "kitty @ set-colors -c -a ~/.cache/wal/kitty";
|
|
|
|
l = "ls -l";
|
|
|
|
p = "paru";
|
|
|
|
r = "ranger";
|
|
|
|
w = "wal -o ~/.config/wal/done.sh";
|
|
|
|
T = "tree";
|
|
|
|
|
|
|
|
nano = "vim"; # The explanation is in the name
|
|
|
|
emacs = "vim"; # No need to start another operating system
|
|
|
|
};
|
2023-05-03 07:19:19 +02:00
|
|
|
|
|
|
|
time.timeZone = "America/New_York";
|
|
|
|
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
2023-05-08 19:50:47 +02:00
|
|
|
i18n.supportedLocales =
|
|
|
|
[ "en_US.UTF-8/UTF-8" "ja_JP.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ];
|
2023-05-03 07:19:19 +02:00
|
|
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
programs.thunar.enable = true;
|
|
|
|
|
2023-05-08 20:24:19 +02:00
|
|
|
programs.starship = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
add_newline = false;
|
|
|
|
directory = {
|
|
|
|
style = "purple";
|
|
|
|
read_only = " ro";
|
|
|
|
};
|
|
|
|
|
|
|
|
git_branch = {
|
|
|
|
style = "yellow";
|
|
|
|
symbol = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
character = {
|
|
|
|
#success_symbol = "[➤](red)[➤](green)[➤](blue)";
|
|
|
|
#error_symbol = "[➤](cyan)[➤](purple)[➤](yellow)";
|
|
|
|
success_symbol = "[>](red)[>](green)[>](blue)";
|
|
|
|
error_symbol = "[>](cyan)[>](purple)[>](yellow)";
|
|
|
|
vicmd_symbol = "[<](bold green)";
|
|
|
|
};
|
|
|
|
|
|
|
|
line_break = { disabled = true; };
|
|
|
|
|
|
|
|
nodejs = {
|
|
|
|
format = "with [$symbol($version )]($style)";
|
|
|
|
symbol = "node ";
|
|
|
|
version_format = "\${major}";
|
|
|
|
disabled = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
2023-05-08 19:50:47 +02:00
|
|
|
programs.neovim.enable = true;
|
|
|
|
programs.git.enable = true;
|
|
|
|
programs.firejail.enable = true;
|
|
|
|
|
2023-05-03 07:19:19 +02:00
|
|
|
nix.package = pkgs.nixFlakes;
|
2023-05-08 19:50:47 +02:00
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
2023-05-03 07:19:19 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
2023-05-08 19:50:47 +02:00
|
|
|
fluent-icon-theme
|
|
|
|
fluent-gtk-theme
|
|
|
|
maple-mono-NF
|
2023-05-03 07:19:19 +02:00
|
|
|
tmux
|
|
|
|
fish
|
|
|
|
wget
|
|
|
|
librewolf
|
|
|
|
kitty
|
|
|
|
mullvad-vpn
|
|
|
|
mullvad-browser
|
|
|
|
papirus-icon-theme
|
2023-05-08 19:50:47 +02:00
|
|
|
mediainfo
|
2023-05-03 07:19:19 +02:00
|
|
|
pywal
|
|
|
|
mpv
|
|
|
|
neofetch
|
|
|
|
anki
|
2023-05-08 19:50:47 +02:00
|
|
|
htop-vim
|
2023-05-03 07:19:19 +02:00
|
|
|
logseq
|
|
|
|
wl-clipboard
|
2023-05-08 19:50:47 +02:00
|
|
|
sox
|
|
|
|
spek
|
|
|
|
ripgrep
|
|
|
|
phinger-cursors
|
|
|
|
rsync
|
|
|
|
jq
|
|
|
|
keepassxc
|
|
|
|
feh
|
|
|
|
stow
|
|
|
|
lf
|
|
|
|
exa
|
|
|
|
fd
|
|
|
|
fzf
|
|
|
|
unar
|
|
|
|
gdu
|
|
|
|
ranger
|
|
|
|
nixfmt
|
|
|
|
whois
|
|
|
|
wofi
|
2023-05-03 07:19:19 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
fonts.enableDefaultFonts = true;
|
|
|
|
fonts.fonts = with pkgs; [
|
|
|
|
noto-fonts
|
2023-05-08 19:50:47 +02:00
|
|
|
noto-fonts-cjk-sans
|
|
|
|
noto-fonts-cjk-serif
|
2023-05-03 07:19:19 +02:00
|
|
|
noto-fonts-emoji
|
|
|
|
hack-font
|
|
|
|
];
|
|
|
|
|
|
|
|
fonts.fontconfig = {
|
|
|
|
defaultFonts = {
|
2023-05-08 19:50:47 +02:00
|
|
|
serif = [ "Noto Serif CJK JP" "Noto Serif" ];
|
|
|
|
sansSerif = [ "Noto Sans CJK JP" "Noto Sans" ];
|
|
|
|
monospace = [ "Noto Mono CJK JP" "Noto Mono" ];
|
2023-05-03 07:19:19 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts.fontconfig.hinting.style = "hintfull";
|
|
|
|
|
2023-05-10 01:30:58 +02:00
|
|
|
i18n.inputMethod.enabled = "fcitx5";
|
2023-05-03 07:19:19 +02:00
|
|
|
|
|
|
|
services.mullvad-vpn.enable = true;
|
2023-05-08 19:50:47 +02:00
|
|
|
services.mullvad-vpn.enableExcludeWrapper = false;
|
2023-05-03 07:19:19 +02:00
|
|
|
|
2023-05-04 19:10:56 +02:00
|
|
|
networking.networkmanager.wifi.macAddress = "random";
|
|
|
|
networking.networkmanager.ethernet.macAddress = "random";
|
|
|
|
services.resolved.llmnr = "false";
|
|
|
|
|
2023-05-08 19:50:47 +02:00
|
|
|
environment.defaultPackages = [ ];
|
|
|
|
services.xserver.excludePackages = [ pkgs.xterm ];
|
|
|
|
|
|
|
|
# Force containers to use mullvad
|
|
|
|
networking.nat.enable = true;
|
|
|
|
networking.nat.internalInterfaces = ["ve-+"];
|
|
|
|
networking.nat.externalInterface = "wg-mullvad";
|
|
|
|
|
|
|
|
services.interception-tools = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [ pkgs.interception-tools-plugins.dual-function-keys ];
|
|
|
|
udevmonConfig = ''
|
|
|
|
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c /etc/dual-function-keys.yaml | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
|
|
|
|
DEVICE:
|
|
|
|
EVENTS:
|
|
|
|
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.etc."dual-function-keys.yaml".text = ''
|
|
|
|
TIMING:
|
|
|
|
- TAP_MILLISEC: 1000
|
|
|
|
- DOUBLE_TAP_MILLISEC: 0
|
|
|
|
MAPPINGS:
|
|
|
|
- KEY: KEY_CAPSLOCK
|
|
|
|
TAP: KEY_ESC
|
|
|
|
HOLD: KEY_LEFTCTRL
|
|
|
|
- KEY: KEY_SYSRQ
|
|
|
|
TAP: KEY_SYSRQ
|
|
|
|
HOLD: KEY_RIGHTMETA
|
|
|
|
'';
|
|
|
|
|
|
|
|
containers.test = let hostCfg = config;
|
|
|
|
in {
|
|
|
|
autoStart = true;
|
|
|
|
privateNetwork = true;
|
|
|
|
hostAddress = "192.168.100.10";
|
|
|
|
localAddress = "192.168.100.11";
|
|
|
|
|
|
|
|
bindMounts = {
|
|
|
|
waylandDisplay = rec {
|
|
|
|
hostPath = "/run/user/1000";
|
|
|
|
mountPoint = hostPath;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = { config, pkgs, ... }: {
|
|
|
|
programs.fish.enable = true;
|
|
|
|
users.defaultUserShell = pkgs.fish;
|
|
|
|
environment.shells = with pkgs; [ fish ];
|
|
|
|
|
|
|
|
programs.npm.enable = true;
|
|
|
|
|
|
|
|
nix.package = pkgs.nixFlakes;
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
p7zip
|
|
|
|
kitty
|
|
|
|
neovim
|
|
|
|
git
|
|
|
|
unzip
|
|
|
|
ripgrep
|
|
|
|
gcc
|
|
|
|
trashy
|
|
|
|
mullvad-browser
|
|
|
|
alacritty
|
|
|
|
logseq
|
|
|
|
feh
|
|
|
|
wget
|
|
|
|
exa
|
|
|
|
fd
|
|
|
|
fzf
|
|
|
|
gdu
|
|
|
|
ranger
|
|
|
|
wofi
|
|
|
|
lf
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.variables = { TERM = "xterm-kitty"; };
|
|
|
|
|
|
|
|
environment.sessionVariables = {
|
2023-05-10 01:30:58 +02:00
|
|
|
WAYLAND_DISPLAY = "wayland-1";
|
2023-05-08 19:50:47 +02:00
|
|
|
QT_QPA_PLATFORM = "wayland";
|
|
|
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
|
|
|
SDL_VIDEODRIVER = "wayland";
|
|
|
|
CLUTTER_BACKEND = "wayland";
|
|
|
|
MOZ_ENABLE_WAYLAND = "1";
|
|
|
|
XDG_RUNTIME_DIR = "/run/user/1000";
|
2023-05-10 01:30:58 +02:00
|
|
|
DISPLAY = ":1";
|
2023-05-08 19:50:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = hostCfg.hardware.opengl.extraPackages;
|
|
|
|
};
|
|
|
|
|
|
|
|
users.mutableUsers = false;
|
|
|
|
users.allowNoPasswordLogin = true;
|
|
|
|
|
|
|
|
users.users.user = {
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/user";
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.defaultPackages = [ ];
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-05-03 07:19:19 +02:00
|
|
|
system.stateVersion = "22.11";
|
|
|
|
}
|