mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add dotfiles
This commit is contained in:
commit
39fe550b3e
45 changed files with 4363 additions and 0 deletions
30
modules/core/blocker.nix
Normal file
30
modules/core/blocker.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# this should block *most* junk sites
|
||||
# make sure to ALWAYS lock commit hash to avoid fed honeypots
|
||||
# three letter agencies go fuck yourself
|
||||
{
|
||||
networking.extraHosts =
|
||||
builtins.readFile (pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/StevenBlack/hosts/e1bb5f08e6f9f4daef93cc327580a95f83959f38/alternates/fakenews-gambling/hosts";
|
||||
sha256 = "LZt3/AvsbYuW+TWsnGnRQNXhvGYO0tMc7uHY/A19bUc=";
|
||||
# blocks fakenews, gambling and coomer sites
|
||||
})
|
||||
+ builtins.readFile (pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/shreyasminocha/shady-hosts/fc9cc4020e80b3f87024c96178cba0f766b95e7a/hosts";
|
||||
sha256 = "jbsEiIcOjoglqLeptHhwWhvL/p0PI3DVMdGCzSXFgNA=";
|
||||
# blocks some shady fed sites
|
||||
})
|
||||
+ builtins.readFile (pkgs.fetchurl {
|
||||
# blocks crypto phishing scams
|
||||
url = "https://raw.githubusercontent.com/MetaMask/eth-phishing-detect/3be0b9594f0bc6e3e699ee30cb2e809618539597/src/hosts.txt";
|
||||
sha256 = "b3HvaLxnUJZOANUL/p+XPNvu9Aod9YLHYYtCZT5Lan0=";
|
||||
})
|
||||
+ builtins.readFile (pkgs.fetchurl {
|
||||
# generic ads
|
||||
url = "https://raw.githubusercontent.com/AdAway/adaway.github.io/04f783e1d9f48bd9ac156610791d7f55d0f7d943/hosts.txt";
|
||||
sha256 = "mp0ka7T0H53rJ3f7yAep3ExXmY6ftpHpAcwWrRWzWYI=";
|
||||
});
|
||||
}
|
||||
25
modules/core/bootloader.nix
Normal file
25
modules/core/bootloader.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
boot = {
|
||||
tmp.cleanOnBoot = true;
|
||||
bootspec.enable = true;
|
||||
consoleLogLevel = 0;
|
||||
|
||||
kernelParams = [
|
||||
"cgroup_no_v1=all"
|
||||
"systemd.unified_cgroup_hierarchy=yes"
|
||||
];
|
||||
initrd.verbose = false;
|
||||
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.editor = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/core/default.nix
Normal file
18
modules/core/default.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./system.nix
|
||||
./nix.nix
|
||||
./users.nix
|
||||
./xdg.nix
|
||||
|
||||
./schizo.nix
|
||||
./network.nix
|
||||
./blocker.nix
|
||||
|
||||
./display.nix
|
||||
];
|
||||
}
|
||||
111
modules/core/display.nix
Normal file
111
modules/core/display.nix
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
# Display manager
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.displayManager.autoLogin.enable = true;
|
||||
services.xserver.displayManager.autoLogin.user = "muon";
|
||||
|
||||
# Window manager
|
||||
#services.xserver.windowManager.leftwm.enable = true;
|
||||
#services.xserver.windowManager.herbstluftwm.enable = true;
|
||||
|
||||
services.xserver.windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
};
|
||||
systemd.user.services.xmobar = {
|
||||
script = "${lib.getExe pkgs.xmobar}";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
# system.activationScripts = {
|
||||
# screenlayout.text = ''
|
||||
# ${lib.getExe pkgs.xrandr} --output DVI-D-0 --off --output HDMI-0 --off --output HDMI-1 --mode 1920x1080 --pos 2560x0 --rotate right --output DP-0 --off --output DP-1 --off --output DP-2 --primary --mode 2560x1440 --pos 0x480 --rotate normal --output DP-3 --off
|
||||
# '';
|
||||
# };
|
||||
systemd.services.screensetter = {
|
||||
enable = true;
|
||||
description = "sets correct screen resolution";
|
||||
wantedBy = [ "graphical-session.target"];
|
||||
# Add this line in your nixos configuration (E.G. the "configuration.nix" file or a module imported into it)
|
||||
# this allows you to use `xrandr` inside of scripts called by this service
|
||||
# https://www.reddit.com/r/NixOS/comments/w4fj6p/comment/ih1oa5e/?utm_source=reddit&utm_medium=web2x&context=3
|
||||
path = [ pkgs.xorg.xrandr ];
|
||||
|
||||
unitConfig = {
|
||||
type = "simple";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
# ExecStart = "/home/<this_user>/.screenlayout/nixos-screenlayout.sh";
|
||||
ExecStart = "${config.users.users.muon.home}/.screenlayout/main.sh";
|
||||
};
|
||||
};
|
||||
|
||||
# systemd.user.services.screenlayout = {
|
||||
# script = "${config.users.users.muon.home}/.screenlayout/main.sh";
|
||||
# wantedBy = [ "graphical-session.target" ];
|
||||
# partOf = [ "graphical-session.target" ];
|
||||
# };
|
||||
|
||||
# Wayland
|
||||
# services.xserver.displayManager.gdm.wayland = true;
|
||||
# programs.hyprland.package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
# programs.hyprland.enable = true;
|
||||
|
||||
# environment.variables = {
|
||||
# GDK_SCALE="2";
|
||||
# XCURSOR_SIZE="24";
|
||||
# };
|
||||
|
||||
# hardware = {
|
||||
# opengl = {
|
||||
# enable = true;
|
||||
# driSupport = true;
|
||||
# driSupport32Bit = true;
|
||||
# extraPackages = with pkgs; [
|
||||
# vaapiVdpau
|
||||
# libvdpau-va-gl
|
||||
# ];
|
||||
# };
|
||||
# pulseaudio.support32Bit = true;
|
||||
# };
|
||||
|
||||
# xdg.portal = {
|
||||
# enable = true;
|
||||
# wlr.enable = false;
|
||||
# extraPortals = [
|
||||
# pkgs.xdg-desktop-portal-gtk
|
||||
# ];
|
||||
# };
|
||||
|
||||
# sound = {
|
||||
# enable = true;
|
||||
# mediaKeys.enable = true;
|
||||
# };
|
||||
|
||||
# Hide cursor
|
||||
services.xbanish.enable = true;
|
||||
|
||||
# Install fonts
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
mononoki
|
||||
openmoji-color
|
||||
(nerdfonts.override { fonts = [ "Mononoki" ]; })
|
||||
];
|
||||
fontconfig = {
|
||||
hinting.autohint = true;
|
||||
defaultFonts = {
|
||||
emoji = [ "OpenMoji Color" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
80
modules/core/network.nix
Normal file
80
modules/core/network.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
networking = {
|
||||
interfaces.enp0s31f6.mtu = 1200;
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.macAddress = "random";
|
||||
};
|
||||
firewall = {
|
||||
enable = true;
|
||||
# if your minecraft server is not worky
|
||||
# this is probably why
|
||||
# Steam Remote UDP ports 27031 and 27036 and TCP ports 27036 and 27037
|
||||
allowedTCPPorts = [443 80 22 7000 8080 5432 27036 27037 9122];
|
||||
allowedUDPPorts = [443 80 44857 8080 27031 51820];
|
||||
allowPing = true;
|
||||
logReversePathDrops = true;
|
||||
};
|
||||
# nameservers = ["10.8.0.1"];
|
||||
};
|
||||
environment.etc = {
|
||||
"resolv.conf".text = ''
|
||||
options timeout:1
|
||||
nameserver 192.168.1.1
|
||||
'';
|
||||
};
|
||||
|
||||
# slows down boot time
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
|
||||
# services.openvpn.servers = {
|
||||
# remote = { config = ''config ${config.users.users.muon.home}/documents/openvpn/muon.ovpn''; };
|
||||
# };
|
||||
|
||||
# services.openssh = {
|
||||
# enable = true;
|
||||
# ports = [9122];
|
||||
# };
|
||||
|
||||
# # Enable WireGuard
|
||||
# networking.wireguard.interfaces = {
|
||||
# # "wg0" is the network interface name. You can name the interface arbitrarily.
|
||||
# wg0 = {
|
||||
# # Determines the IP address and subnet of the client's end of the tunnel interface.
|
||||
# ips = [ "10.10.10.2/24" ];
|
||||
# listenPort = 51820; # to match firewall allowedUDPPorts (without this wg uses random port numbers)
|
||||
|
||||
# # Path to the private key file.
|
||||
# #
|
||||
# # Note: The private key can also be included inline via the privateKey option,
|
||||
# # but this makes the private key world-readable; thus, using privateKeyFile is
|
||||
# # recommended.
|
||||
# privateKeyFile = ''${config.users.users.muon.home}/documents/wireguard/vpn-client-private.key'';
|
||||
|
||||
# peers = [
|
||||
# # For a client configuration, one peer entry for the server will suffice.
|
||||
|
||||
# {
|
||||
# # Public key of the server (not a file path).
|
||||
# publicKey = "iBuHEKkNftQHXHJbj1wJS2D/PwXHkldvkdQQCPsCRH0=";
|
||||
|
||||
# # Forward all the traffic via VPN.
|
||||
# allowedIPs = [ "0.0.0.0/0" ];
|
||||
# # Or forward only particular subnets
|
||||
# #allowedIPs = [ "10.100.0.1" "91.108.12.0/22" ];
|
||||
|
||||
# # Set this to the server IP and port.
|
||||
# endpoint = "93.95.230.11:51820"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577
|
||||
|
||||
# # Send keepalives every 25 seconds. Important to keep NAT tables alive.
|
||||
# persistentKeepalive = 25;
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
}
|
||||
98
modules/core/nix.nix
Normal file
98
modules/core/nix.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
environment = {
|
||||
# set channels (backwards compatibility)
|
||||
etc = {
|
||||
"nix/flake-channels/nixpkgs".source = inputs.nixpkgs;
|
||||
"nix/flake-channels/home-manager".source = inputs.home-manager;
|
||||
};
|
||||
|
||||
systemPackages = with pkgs; [git deadnix alejandra statix];
|
||||
defaultPackages = [];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = false;
|
||||
allowBroken = true;
|
||||
};
|
||||
};
|
||||
|
||||
# faster rebuilding
|
||||
documentation = {
|
||||
enable = true;
|
||||
doc.enable = false;
|
||||
man.enable = true;
|
||||
dev.enable = false;
|
||||
};
|
||||
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 3d";
|
||||
};
|
||||
package = pkgs.nixUnstable;
|
||||
|
||||
# Make builds run with low priority so my system stays responsive
|
||||
daemonCPUSchedPolicy = "idle";
|
||||
daemonIOSchedClass = "idle";
|
||||
|
||||
# pin the registry to avoid downloading and evaling a new nixpkgs version every time
|
||||
registry = lib.mapAttrs (_: v: {flake = v;}) inputs;
|
||||
|
||||
# This will additionally add your inputs to the system's legacy channels
|
||||
# Making legacy nix commands consistent as well, awesome!
|
||||
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
||||
|
||||
# Free up to 1GiB whenever there is less than 100MiB left.
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
keep-outputs = true
|
||||
warn-dirty = false
|
||||
keep-derivations = true
|
||||
min-free = ${toString (100 * 1024 * 1024)}
|
||||
max-free = ${toString (1024 * 1024 * 1024)}
|
||||
use-xdg-base-directories = true
|
||||
'';
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
# use binary cache, its not gentoo
|
||||
builders-use-substitutes = true;
|
||||
# allow sudo users to mark the following values as trusted
|
||||
allowed-users = ["@wheel"];
|
||||
# only allow sudo users to manage the nix store
|
||||
trusted-users = ["@wheel"];
|
||||
sandbox = true;
|
||||
max-jobs = "auto";
|
||||
# continue building derivations if one fails
|
||||
keep-going = true;
|
||||
log-lines = 20;
|
||||
extra-experimental-features = ["flakes" "nix-command" "recursive-nix" "ca-derivations"];
|
||||
|
||||
# use binary cache, its not gentoo
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://nixpkgs-unfree.cachix.org"
|
||||
"https://oxalica.cachix.org"
|
||||
"https://hyprland.cachix.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs="
|
||||
"oxalica.cachix.org-1:h0iRBw6tQD8+51ZvnNEBPbwLR58UD7klauDBWzBdugQ="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
};
|
||||
};
|
||||
system.autoUpgrade.enable = false;
|
||||
system.stateVersion = "23.05"; # DONT TOUCH THIS
|
||||
}
|
||||
152
modules/core/schizo.nix
Normal file
152
modules/core/schizo.nix
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.tor = {
|
||||
enable = true;
|
||||
client.enable = true;
|
||||
torsocks.enable = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeScriptBin "sudo" ''exec doas "$@"'')
|
||||
];
|
||||
security = {
|
||||
protectKernelImage = true;
|
||||
lockKernelModules = false;
|
||||
rtkit.enable = true;
|
||||
apparmor = {
|
||||
enable = true;
|
||||
killUnconfinedConfinables = true;
|
||||
packages = [pkgs.apparmor-profiles];
|
||||
};
|
||||
pam = {
|
||||
loginLimits = [
|
||||
{
|
||||
domain = "@wheel";
|
||||
item = "nofile";
|
||||
type = "soft";
|
||||
value = "524288";
|
||||
}
|
||||
{
|
||||
domain = "@wheel";
|
||||
item = "nofile";
|
||||
type = "hard";
|
||||
value = "1048576";
|
||||
}
|
||||
];
|
||||
services = {
|
||||
login.enableGnomeKeyring = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
doas = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
groups = ["wheel"];
|
||||
persist = true;
|
||||
keepEnv = false;
|
||||
}
|
||||
{
|
||||
groups = ["power"];
|
||||
noPass = true;
|
||||
cmd = "${pkgs.systemd}/bin/poweroff";
|
||||
}
|
||||
{
|
||||
groups = ["power"];
|
||||
noPass = true;
|
||||
cmd = "${pkgs.systemd}/bin/reboot";
|
||||
}
|
||||
{
|
||||
groups = ["nix"];
|
||||
cmd = "nix-collect-garbage";
|
||||
noPass = true;
|
||||
}
|
||||
{
|
||||
groups = ["nix"];
|
||||
cmd = "nixos-rebuild";
|
||||
keepEnv = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
sudo.enable = false;
|
||||
};
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"kernel.yama.ptrace_scope" = 2;
|
||||
"kernel.kptr_restrict" = 2;
|
||||
"kernel.sysrq" = 0;
|
||||
"net.core.bpf_jit_enable" = false;
|
||||
"kernel.ftrace_enabled" = false;
|
||||
"net.ipv4.conf.all.log_martians" = true;
|
||||
"net.ipv4.conf.all.rp_filter" = "1";
|
||||
"net.ipv4.conf.default.log_martians" = true;
|
||||
"net.ipv4.conf.default.rp_filter" = "1";
|
||||
"net.ipv4.icmp_echo_ignore_broadcasts" = true;
|
||||
"net.ipv4.conf.all.accept_redirects" = false;
|
||||
"net.ipv4.conf.all.secure_redirects" = false;
|
||||
"net.ipv4.conf.default.accept_redirects" = false;
|
||||
"net.ipv4.conf.default.secure_redirects" = false;
|
||||
"net.ipv6.conf.all.accept_redirects" = false;
|
||||
"net.ipv6.conf.default.accept_redirects" = false;
|
||||
"net.ipv4.conf.all.send_redirects" = false;
|
||||
"net.ipv4.conf.default.send_redirects" = false;
|
||||
"net.ipv6.conf.default.accept_ra" = 0;
|
||||
"net.ipv6.conf.all.accept_ra" = 0;
|
||||
"net.ipv4.tcp_syncookies" = 1;
|
||||
"net.ipv4.tcp_timestamps" = 0;
|
||||
"net.ipv4.tcp_rfc1337" = 1;
|
||||
"net.ipv4.tcp_fastopen" = 3;
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"net.core.default_qdisc" = "cake";
|
||||
};
|
||||
|
||||
# Security
|
||||
boot.blacklistedKernelModules = [
|
||||
# Obscure network protocols
|
||||
"ax25"
|
||||
"netrom"
|
||||
"rose"
|
||||
# Old or rare or insufficiently audited filesystems
|
||||
"adfs"
|
||||
"affs"
|
||||
"bfs"
|
||||
"befs"
|
||||
"cramfs"
|
||||
"efs"
|
||||
"erofs"
|
||||
"exofs"
|
||||
"freevxfs"
|
||||
"f2fs"
|
||||
"vivid"
|
||||
"gfs2"
|
||||
"ksmbd"
|
||||
"nfsv4"
|
||||
"nfsv3"
|
||||
"cifs"
|
||||
"nfs"
|
||||
"cramfs"
|
||||
"freevxfs"
|
||||
"jffs2"
|
||||
"hfs"
|
||||
"hfsplus"
|
||||
"squashfs"
|
||||
"udf"
|
||||
"bluetooth"
|
||||
"btusb"
|
||||
# "uvcvideo" # thats why your webcam not worky
|
||||
"hpfs"
|
||||
"jfs"
|
||||
"minix"
|
||||
"nilfs2"
|
||||
"omfs"
|
||||
# "uvcvideo"
|
||||
"qnx4"
|
||||
"qnx6"
|
||||
"sysv"
|
||||
];
|
||||
}
|
||||
258
modules/core/system.nix
Normal file
258
modules/core/system.nix
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
xdg,
|
||||
...
|
||||
}: {
|
||||
# compress half of the ram to use as swap
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
algorithm = "zstd";
|
||||
};
|
||||
|
||||
# TODO Move?
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
BROWSER = "chromium";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [ inputs.rust-overlay.overlays.default ];
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
clang
|
||||
llvmPackages_16.bintools
|
||||
rust-bin.nightly.latest.default
|
||||
# support both 32- and 64-bit applications
|
||||
wineWowPackages.stable
|
||||
# winetricks (all versions)
|
||||
winetricks
|
||||
texlive.combined.scheme-small
|
||||
];
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
users.extraGroups.vboxusers.members = [ "muon" ];
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Atlantic/Reykjavik";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_DK.UTF-8";
|
||||
LC_IDENTIFICATION = "en_DK.UTF-8";
|
||||
LC_MEASUREMENT = "en_DK.UTF-8";
|
||||
LC_MONETARY = "en_DK.UTF-8";
|
||||
LC_NAME = "en_DK.UTF-8";
|
||||
LC_NUMERIC = "en_DK.UTF-8";
|
||||
LC_PAPER = "en_DK.UTF-8";
|
||||
LC_TELEPHONE = "en_DK.UTF-8";
|
||||
LC_TIME = "en_DK.UTF-8";
|
||||
};
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
layout = "us";
|
||||
xkbVariant = "";
|
||||
xkbOptions = "caps:escape";
|
||||
};
|
||||
|
||||
# Use keymap in console
|
||||
console.useXkbConfig = true;
|
||||
|
||||
programs.thunar.enable = true;
|
||||
services.gvfs.enable = true; # Mount, trash, and other functionalities
|
||||
services.tumbler.enable = true; # Thumbnail support for images
|
||||
|
||||
# Sound
|
||||
sound = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
hardware.pulseaudio.enable = true;
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = false;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
services.syncthing = with config.users.users.muon; {
|
||||
enable = true;
|
||||
user = "muon";
|
||||
dataDir = "${config.xdg.userDirs.documents}";
|
||||
configDir = "${home}/.config/syncthing";
|
||||
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
devices = {
|
||||
"syncthing" = {
|
||||
id = "SDFDQ4N-UPPGKQH-JWVII4O-FT4XTH3-FT2RPMZ-EQC57PQ-VXL7BBD-4LLPTA4";
|
||||
};
|
||||
};
|
||||
|
||||
folders = {
|
||||
"documents" = {
|
||||
path = "${home}/documents";
|
||||
devices = ["syncthing"];
|
||||
};
|
||||
"librewolf" = {
|
||||
path = "${home}/.librewolf";
|
||||
devices = ["syncthing"];
|
||||
};
|
||||
"logseq" = {
|
||||
path = "${home}/.logseq";
|
||||
devices = ["syncthing"];
|
||||
};
|
||||
"zotero" = {
|
||||
path = "${home}/Zotero";
|
||||
devices = ["syncthing"];
|
||||
};
|
||||
"zotero-conf" = {
|
||||
path = "${home}/.zotero";
|
||||
devices = ["syncthing"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.nix-ld = {
|
||||
enable = true;
|
||||
libraries = with pkgs; [
|
||||
stdenv.cc.cc
|
||||
openssl
|
||||
curl
|
||||
glib
|
||||
util-linux
|
||||
glibc
|
||||
icu
|
||||
libunwind
|
||||
libuuid
|
||||
zlib
|
||||
libsecret
|
||||
# graphical
|
||||
freetype
|
||||
libglvnd
|
||||
libnotify
|
||||
SDL2
|
||||
vulkan-loader
|
||||
gdk-pixbuf
|
||||
xorg.libX11
|
||||
];
|
||||
};
|
||||
|
||||
systemd = let
|
||||
extraConfig = ''
|
||||
DefaultTimeoutStopSec=15s
|
||||
'';
|
||||
in {
|
||||
inherit extraConfig;
|
||||
user = {inherit extraConfig;};
|
||||
services."getty@tty1".enable = false;
|
||||
services."autovt@tty1".enable = false;
|
||||
services."getty@tty7".enable = false;
|
||||
services."autovt@tty7".enable = false;
|
||||
# Systemd OOMd
|
||||
# Fedora enables these options by default. See the 10-oomd-* files here:
|
||||
# https://src.fedoraproject.org/rpms/systemd/tree/acb90c49c42276b06375a66c73673ac3510255
|
||||
oomd = {
|
||||
enableRootSlice = true;
|
||||
enableUserServices = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.udev.extraRules = ''
|
||||
# Atmel DFU
|
||||
### ATmega16U2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fef", TAG+="uaccess"
|
||||
### ATmega32U2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess"
|
||||
### ATmega16U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff3", TAG+="uaccess"
|
||||
### ATmega32U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess"
|
||||
### AT90USB64
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff9", TAG+="uaccess"
|
||||
### AT90USB162
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffa", TAG+="uaccess"
|
||||
### AT90USB128
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess"
|
||||
|
||||
# Input Club
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess"
|
||||
|
||||
# STM32duino
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess"
|
||||
# STM32 DFU
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess"
|
||||
|
||||
# BootloadHID
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess"
|
||||
|
||||
# USBAspLoader
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", TAG+="uaccess"
|
||||
|
||||
# USBtinyISP
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1782", ATTRS{idProduct}=="0c9f", TAG+="uaccess"
|
||||
|
||||
# ModemManager should ignore the following devices
|
||||
# Atmel SAM-BA (Massdrop)
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
|
||||
# Caterina (Pro Micro)
|
||||
## pid.codes shared PID
|
||||
### Keyboardio Atreus 2 Bootloader
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2302", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Spark Fun Electronics
|
||||
### Pro Micro 3V3/8MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### Pro Micro 5V/16MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### LilyPad 3V3/8MHz (and some Pro Micro clones)
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9207", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Pololu Electronics
|
||||
### A-Star 32U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1ffb", ATTRS{idProduct}=="0101", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Arduino SA
|
||||
### Leonardo
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### Micro
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Adafruit Industries LLC
|
||||
### Feather 32U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000c", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### ItsyBitsy 32U4 3V3/8MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000d", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### ItsyBitsy 32U4 5V/16MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000e", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## dog hunter AG
|
||||
### Leonardo
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### Micro
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
|
||||
# hid_listen
|
||||
KERNEL=="hidraw*", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
|
||||
|
||||
# hid bootloaders
|
||||
## QMK HID
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2067", TAG+="uaccess"
|
||||
## PJRC's HalfKay
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0478", TAG+="uaccess"
|
||||
|
||||
# APM32 DFU
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="0106", TAG+="uaccess"
|
||||
|
||||
# GD32V DFU
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", TAG+="uaccess"
|
||||
|
||||
# WB32 DFU
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess"
|
||||
'';
|
||||
}
|
||||
31
modules/core/users.nix
Normal file
31
modules/core/users.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
users.users.root.initialPassword = "changeme";
|
||||
programs.zsh.enable = true;
|
||||
programs.adb.enable = true;
|
||||
users.users.muon = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"systemd-journal"
|
||||
"vboxusers"
|
||||
"audio"
|
||||
"plugdev"
|
||||
"wireshark"
|
||||
"video"
|
||||
"input"
|
||||
"lp"
|
||||
"networkmanager"
|
||||
"power"
|
||||
"nix"
|
||||
"docker"
|
||||
"adbusers"
|
||||
];
|
||||
uid = 1000;
|
||||
shell = pkgs.zsh;
|
||||
initialPassword = "changeme";
|
||||
};
|
||||
}
|
||||
17
modules/core/xdg.nix
Normal file
17
modules/core/xdg.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
environment.variables = with config.users.users.muon; {
|
||||
WINIT_X11_SCALE_FACTOR="1";
|
||||
|
||||
# XDG Base
|
||||
XDG_CONFIG_HOME="${home}/.config";
|
||||
XDG_CACHE_HOME="${home}/.cache";
|
||||
XDG_DATA_HOME="${home}/.local/share";
|
||||
XDG_STATE_HOME="${home}/.local/state";
|
||||
};
|
||||
}
|
||||
48
modules/home/alacritty/default.nix
Normal file
48
modules/home/alacritty/default.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
cursor = {
|
||||
style.shape = "Beam";
|
||||
vi_mode_style = "Block";
|
||||
unfocused_hollow = true;
|
||||
};
|
||||
window = {
|
||||
padding.x = 6;
|
||||
padding.y = 6;
|
||||
};
|
||||
key_bindings = [
|
||||
{
|
||||
key = "U";
|
||||
mods = "Control";
|
||||
mode = "Vi|~Search";
|
||||
action = "ScrollHalfPageUp";
|
||||
}
|
||||
{
|
||||
key = "D";
|
||||
mods = "Control";
|
||||
mode = "Vi|~Search";
|
||||
action = "ScrollHalfPageDown";
|
||||
}
|
||||
{
|
||||
key = "U";
|
||||
mods = "Control";
|
||||
mode = "~Alt";
|
||||
action = "ScrollHalfPageUp";
|
||||
}
|
||||
{
|
||||
key = "D";
|
||||
mods = "Control";
|
||||
mode = "~Alt";
|
||||
action = "ScrollHalfPageDown";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
36
modules/home/default.nix
Normal file
36
modules/home/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
self,
|
||||
stylix,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config.home.stateVersion = "23.05";
|
||||
config.home.extraOutputsToInstall = ["doc" "devdoc"];
|
||||
|
||||
imports = [
|
||||
./packages.nix
|
||||
|
||||
./git
|
||||
./shell
|
||||
./alacritty
|
||||
./helix
|
||||
./tools
|
||||
./qutebrowser
|
||||
|
||||
stylix.homeManagerModules.stylix
|
||||
./theme
|
||||
|
||||
# ./herbstluftwm
|
||||
# ./leftwm
|
||||
./xmonad
|
||||
# ./hyprland
|
||||
# inputs.hyprland.homeManagerModules.default
|
||||
|
||||
inputs.nix-doom-emacs.hmModule
|
||||
./doom-emacs
|
||||
];
|
||||
}
|
||||
12
modules/home/doom-emacs/default.nix
Normal file
12
modules/home/doom-emacs/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomPrivateDir = ./doom;
|
||||
};
|
||||
}
|
||||
121
modules/home/doom-emacs/doom/config.el
Normal file
121
modules/home/doom-emacs/doom/config.el
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||
;; sync' after modifying this file!
|
||||
|
||||
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets.
|
||||
(setq user-full-name "Muonis"
|
||||
user-mail-address "user@muon.host")
|
||||
|
||||
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
|
||||
;; are the three important ones:
|
||||
;;
|
||||
;; + `doom-font'
|
||||
;; + `doom-variable-pitch-font'
|
||||
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
||||
;; presentations or streaming.
|
||||
;;
|
||||
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
|
||||
;; font string. You generally only need these two:
|
||||
;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
|
||||
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
|
||||
(setq doom-font (font-spec :family "Mononoki Nerd Font" :size 14 :weight 'regular))
|
||||
|
||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||
;; `load-theme' function. This is the default:
|
||||
(setq doom-theme 'doom-gruvbox)
|
||||
|
||||
;; If you use `org' and don't want your org files in the default location below,
|
||||
;; change `org-directory'. It must be set before org loads!
|
||||
(setq org-directory "~/documents/org/")
|
||||
|
||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||
; (setq display-line-numbers-type t)
|
||||
;; (setq display-line-numbers-type relative)
|
||||
(setq display-line-numbers-type 'relative)
|
||||
(setq doom-line-numbers-style 'relative)
|
||||
|
||||
;; Company coc mode
|
||||
(company-tng-configure-default)
|
||||
|
||||
;; Unbind jk bind jj, Dutch :/
|
||||
(setq evil-escape-key-sequence "jj")
|
||||
|
||||
;; Here are some additional functions/macros that could help you configure Doom:
|
||||
;;
|
||||
;; - `load!' for loading external *.el files relative to this one
|
||||
;; - `use-package!' for configuring packages
|
||||
;; - `after!' for running code after a package has loaded
|
||||
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
||||
;; this file. Emacs searches the `load-path' when you load packages with
|
||||
;; `require' or `use-package'.
|
||||
;; - `map!' for binding new keys
|
||||
;;
|
||||
;; To get information about any of these functions/macros, move the cursor over
|
||||
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
|
||||
;; This will open documentation for it, including demos of how they are used.
|
||||
;;
|
||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||
;; they are implemented.
|
||||
|
||||
;; Window nav
|
||||
(map! :g "C-h" 'evil-window-left)
|
||||
(map! :g "C-j" 'evil-window-down)
|
||||
(map! :g "C-k" 'evil-window-up)
|
||||
(map! :g "C-l" 'evil-window-right)
|
||||
|
||||
;; org-roam
|
||||
(setq org-roam-directory "~/documents/roam")
|
||||
(org-roam-db-autosync-enable)
|
||||
(org-roam-complete-everywhere)
|
||||
|
||||
(map! :leader
|
||||
"r f" 'org-roam-node-find
|
||||
"r g" 'org-roam-graph
|
||||
"r b" 'org-roam-buffer-toggle
|
||||
"r i" 'org-roam-node-insert
|
||||
"r c" 'org-roam-capture
|
||||
)
|
||||
|
||||
;; vterm
|
||||
(after! vterm
|
||||
(set-evil-initial-state! 'vterm-mode
|
||||
'emacs))
|
||||
|
||||
;; Autocomplete region buffer
|
||||
(defun narrow-to-region-indirect (start end)
|
||||
"Restrict editing in this buffer to the current region, indirectly."
|
||||
(interactive "r")
|
||||
(deactivate-mark)
|
||||
(let ((buf (clone-indirect-buffer nil nil)))
|
||||
(with-current-buffer buf
|
||||
(narrow-to-region start end))
|
||||
(switch-to-buffer buf)))
|
||||
|
||||
;; EIN
|
||||
(setq ein:output-area-inlined-images t)
|
||||
(setq ein:slice-image t)
|
||||
(setq ein:completion-backend 'ein:use-company-backend)
|
||||
(setq ein:polymode t)
|
||||
|
||||
;; ORG
|
||||
(require 'org)
|
||||
(require 'ox-latex)
|
||||
(add-to-list 'org-latex-packages-alist '("" "minted"))
|
||||
(setq org-latex-listings 'minted)
|
||||
|
||||
(setq org-latex-pdf-process
|
||||
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
|
||||
|
||||
(setq org-src-fontify-natively t)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((R . t)
|
||||
(latex . t)))
|
||||
16
modules/home/doom-emacs/doom/custom.el
Normal file
16
modules/home/doom-emacs/doom/custom.el
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(custom-safe-themes
|
||||
'("7a424478cb77a96af2c0f50cfb4e2a88647b3ccca225f8c650ed45b7f50d9525" "a138ec18a6b926ea9d66e61aac28f5ce99739cf38566876dc31e29ec8757f6e2" "b54376ec363568656d54578d28b95382854f62b74c32077821fdfd604268616a" "2e05569868dc11a52b08926b4c1a27da77580daa9321773d92822f7a639956ce" "5f128efd37c6a87cd4ad8e8b7f2afaba425425524a68133ac0efd87291d05874" "680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426" "4ff1c4d05adad3de88da16bd2e857f8374f26f9063b2d77d38d14686e3868d8d" "8d3ef5ff6273f2a552152c7febc40eabca26bae05bd12bc85062e2dc224cde9a" "944d52450c57b7cbba08f9b3d08095eb7a5541b0ecfb3a0a9ecd4a18f3c28948" "2721b06afaf1769ef63f942bf3e977f208f517b187f2526f0e57c1bd4a000350" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "afa47084cb0beb684281f480aa84dab7c9170b084423c7f87ba755b15f6776ef" "a44e2d1636a0114c5e407a748841f6723ed442dc3a0ed086542dc71b92a87aee" "60ada0ff6b91687f1a04cc17ad04119e59a7542644c7c59fc135909499400ab8" "467dc6fdebcf92f4d3e2a2016145ba15841987c71fbe675dcfe34ac47ffb9195" "e19ac4ef0f028f503b1ccafa7c337021834ce0d1a2bca03fcebc1ef635776bea" "b5803dfb0e4b6b71f309606587dd88651efe0972a5be16ece6a958b197caeed8" "6c531d6c3dbc344045af7829a3a20a09929e6c41d7a7278963f7d3215139f6a7" "1f1b545575c81b967879a5dddc878783e6ebcca764e4916a270f9474215289e5" "3d47380bf5aa650e7b8e049e7ae54cdada54d0637e7bac39e4cc6afb44e8463b" "6c98bc9f39e8f8fd6da5b9c74a624cbb3782b4be8abae8fd84cbc43053d7c175" "97db542a8a1731ef44b60bc97406c1eb7ed4528b0d7296997cbb53969df852d6" "028c226411a386abc7f7a0fba1a2ebfae5fe69e2a816f54898df41a6a3412bb5" "7a7b1d475b42c1a0b61f3b1d1225dd249ffa1abb1b7f726aec59ac7ca3bf4dae" "da186cce19b5aed3f6a2316845583dbee76aea9255ea0da857d1c058ff003546" "4699e3a86b1863bbc695236036158d175a81f0f3ea504e2b7c71f8f7025e19e3" "234dbb732ef054b109a9e5ee5b499632c63cc24f7c2383a849815dacc1727cb6" "1704976a1797342a1b4ea7a75bdbb3be1569f4619134341bd5a4c1cfb16abad4" "f6665ce2f7f56c5ed5d91ed5e7f6acb66ce44d0ef4acfaa3a42c7cfe9e9a9013" "c4063322b5011829f7fdd7509979b5823e8eea2abf1fe5572ec4b7af1dd78519" default))
|
||||
'(package-selected-packages '(jekyll-modes))
|
||||
'(warning-suppress-log-types '((lsp-mode) (lsp-mode)))
|
||||
'(warning-suppress-types '((emacs) (defvaralias) (lsp-mode))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
)
|
||||
190
modules/home/doom-emacs/doom/init.el
Normal file
190
modules/home/doom-emacs/doom/init.el
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
;;; init.el -*- lexical-binding: t; -*-
|
||||
;; This file controls what Doom modules are enabled and what order they load
|
||||
;; in. Remember to run 'doom sync' after modifying it!
|
||||
|
||||
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
||||
;; documentation. There you'll find a "Module Index" link where you'll find
|
||||
;; a comprehensive list of Doom's modules and what flags they support.
|
||||
|
||||
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
||||
;; 'C-c c k' for non-vim users) to view its documentation. This works on
|
||||
;; flags as well (those symbols that start with a plus).
|
||||
;;
|
||||
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
|
||||
;; directory (for easy access to its source code).
|
||||
|
||||
(doom! :input
|
||||
;;chinese
|
||||
;;japanese
|
||||
;;layout ; auie,ctsrnm is the superior home row
|
||||
|
||||
:completion
|
||||
company ; the ultimate code completion backend
|
||||
(helm +fuzzy) ; the *other* search engine for love and life
|
||||
;; ido ; the other *other* search engine...
|
||||
;; (ivy +fuzzy) ; a search engine for love and life
|
||||
;; (vertico +fuzzy) ; the search engine of the future
|
||||
|
||||
:ui
|
||||
;;deft ; notational velocity for Emacs
|
||||
doom ; what makes DOOM look the way it does
|
||||
doom-dashboard ; a nifty splash screen for Emacs
|
||||
doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||
;;(emoji +unicode) ; 🙂
|
||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||
;;hydra
|
||||
;;indent-guides ; highlighted indent columns
|
||||
(ligatures +hasklig) ; ligatures and symbols to make your code pretty again
|
||||
;;minimap ; show a map of the code on the side
|
||||
modeline ; snazzy, Atom-inspired modeline, plus API
|
||||
;;nav-flash ; blink cursor line after big motions
|
||||
neotree ; a project drawer, like NERDTree for vim
|
||||
ophints ; highlight the region an operation acts on
|
||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||
;;tabs ; a tab bar for Emacs
|
||||
;;treemacs ; a project drawer, like neotree but cooler
|
||||
;;unicode ; extended unicode support for various languages
|
||||
vc-gutter ; vcs diff in the fringe
|
||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||
;;window-select ; visually switch windows
|
||||
workspaces ; tab emulation, persistence & separate workspaces
|
||||
;;zen ; distraction-free coding or writing
|
||||
|
||||
:editor
|
||||
(evil +everywhere); come to the dark side, we have cookies
|
||||
file-templates ; auto-snippets for empty files
|
||||
fold ; (nigh) universal code folding
|
||||
(format +onsave) ; automated prettiness
|
||||
;;god ; run Emacs commands without modifier keys
|
||||
;;lispy ; vim for lisp, for people who don't like vim
|
||||
;;multiple-cursors ; editing in many places at once
|
||||
;;objed ; text object editing for the innocent
|
||||
;;parinfer ; turn lisp into python, sort of
|
||||
;;rotate-text ; cycle region at point between text candidates
|
||||
snippets ; my elves. They type so I don't have to
|
||||
;;word-wrap ; soft wrapping with language-aware indent
|
||||
|
||||
:emacs
|
||||
dired ; making dired pretty [functional]
|
||||
electric ; smarter, keyword-based electric-indent
|
||||
;;ibuffer ; interactive buffer management
|
||||
undo ; persistent, smarter undo for your inevitable mistakes
|
||||
vc ; version-control and Emacs, sitting in a tree
|
||||
|
||||
:term
|
||||
;;eshell ; the elisp shell that works everywhere
|
||||
;;shell ; simple shell REPL for Emacs
|
||||
term ; basic terminal emulator for Emacs
|
||||
vterm ; the best terminal emulation in Emacs
|
||||
|
||||
:checkers
|
||||
syntax ; tasing you for every semicolon you forget
|
||||
;;(spell +flyspell) ; tasing you for misspelling mispelling
|
||||
;;grammar ; tasing grammar mistake every you make
|
||||
|
||||
:tools
|
||||
;;ansible
|
||||
biblio ; Writes a PhD for you (citation needed)
|
||||
debugger ; FIXME stepping through code, to help you add bugs
|
||||
;;direnv
|
||||
;;docker
|
||||
;;editorconfig ; let someone else argue about tabs vs spaces
|
||||
ein ; tame Jupyter notebooks with emacs
|
||||
(eval +overlay) ; run code, run (also, repls)
|
||||
;;gist ; interacting with github gists
|
||||
lookup ; navigate your code and its documentation
|
||||
lsp ; M-x vscode
|
||||
magit ; a git porcelain for Emacs
|
||||
;;make ; run make tasks from Emacs
|
||||
;;pass ; password manager for nerds
|
||||
pdf ; pdf enhancements
|
||||
;;prodigy ; FIXME managing external services & code builders
|
||||
;;rgb ; creating color strings
|
||||
;;taskrunner ; taskrunner for all your projects
|
||||
;;terraform ; infrastructure as code
|
||||
;;tmux ; an API for interacting with tmux
|
||||
;;upload ; map local to remote projects via ssh/ftp
|
||||
|
||||
:os
|
||||
(:if IS-MAC macos) ; improve compatibility with macOS
|
||||
tty ; improve the terminal Emacs experience
|
||||
|
||||
:lang
|
||||
;;agda ; types of types of types of types...
|
||||
;;beancount ; mind the GAAP
|
||||
cc ; C > C++ == 1
|
||||
;;clojure ; java with a lisp
|
||||
;;common-lisp ; if you've seen one lisp, you've seen them all
|
||||
;;coq ; proofs-as-programs
|
||||
;;crystal ; ruby at the speed of c
|
||||
;;csharp ; unity, .NET, and mono shenanigans
|
||||
;;data ; config/data formats
|
||||
;;(dart +flutter) ; paint ui and not much else
|
||||
;;dhall
|
||||
;;elixir ; erlang done right
|
||||
;;elm ; care for a cup of TEA?
|
||||
emacs-lisp ; drown in parentheses
|
||||
;;erlang ; an elegant language for a more civilized age
|
||||
;;ess ; emacs speaks statistics
|
||||
;;factor
|
||||
;;faust ; dsp, but you get to keep your soul
|
||||
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
|
||||
;;fsharp ; ML stands for Microsoft's Language
|
||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||
;;gdscript ; the language you waited for
|
||||
;;(go +lsp) ; the hipster dialect
|
||||
(haskell +lsp) ; a language that's lazier than I am
|
||||
;;hy ; readability of scheme w/ speed of python
|
||||
;;idris ; a language you can depend on
|
||||
json ; At least it ain't XML
|
||||
(java +lsp) ; the poster child for carpal tunnel syndrome
|
||||
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
|
||||
;;julia ; a better, faster MATLAB
|
||||
kotlin ; a better, slicker Java(Script)
|
||||
latex ; writing papers in Emacs has never been so fun
|
||||
;;lean ; for folks with too much to prove
|
||||
;;ledger ; be audit you can be
|
||||
lua ; one-based indices? one-based indices
|
||||
markdown ; writing docs for people to ignore
|
||||
;;nim ; python + lisp at the speed of c
|
||||
;;nix ; I hereby declare "nix geht mehr!"
|
||||
;;ocaml ; an objective camel
|
||||
(org +present) ; organize your plain life in plain text
|
||||
;;php ; perl's insecure younger brother
|
||||
;;plantuml ; diagrams for confusing people more
|
||||
;;purescript ; javascript, but functional
|
||||
python ; beautiful is better than ugly
|
||||
;;qt ; the 'cutest' gui framework ever
|
||||
;;racket ; a DSL for DSLs
|
||||
;;raku ; the artist formerly known as perl6
|
||||
;;rest ; Emacs as a REST client
|
||||
;;rst ; ReST in peace
|
||||
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
||||
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||
;;scala ; java, but good
|
||||
;;(scheme +guile) ; a fully conniving family of lisps
|
||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
||||
;;sml
|
||||
;;solidity ; do you need a blockchain? No.
|
||||
;;swift ; who asked for emoji variables?
|
||||
;;terra ; Earth and Moon in alignment for performance.
|
||||
web ; the tubes
|
||||
yaml ; JSON, but readable
|
||||
zig ; C, but simpler
|
||||
|
||||
:email
|
||||
;;(mu4e +org +gmail)
|
||||
;;notmuch
|
||||
;;(wanderlust +gmail)
|
||||
|
||||
:app
|
||||
;;calendar
|
||||
;;emms
|
||||
;;everywhere ; *leave* Emacs!? You must be joking
|
||||
;;irc ; how neckbeards socialize
|
||||
;;(rss +org) ; emacs as an RSS reader
|
||||
;;twitter ; twitter client https://twitter.com/vnought
|
||||
|
||||
:config
|
||||
;;literate
|
||||
(default +bindings +smartparens))
|
||||
56
modules/home/doom-emacs/doom/packages.el
Normal file
56
modules/home/doom-emacs/doom/packages.el
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; $DOOMDIR/packages.el
|
||||
|
||||
;; To install a package with Doom you must declare them here and run 'doom sync'
|
||||
;; on the command line, then restart Emacs for the changes to take effect -- or
|
||||
;; use 'M-x doom/reload'.
|
||||
|
||||
|
||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||
;(package! some-package)
|
||||
|
||||
;; To install a package directly from a remote git repo, you must specify a
|
||||
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
||||
;; https://github.com/raxod502/straight.el#the-recipe-format
|
||||
;(package! another-package
|
||||
; :recipe (:host github :repo "username/repo"))
|
||||
|
||||
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
||||
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
||||
;; `:files' in the `:recipe':
|
||||
;(package! this-package
|
||||
; :recipe (:host github :repo "username/repo"
|
||||
; :files ("some-file.el" "src/lisp/*.el")))
|
||||
|
||||
;; If you'd like to disable a package included with Doom, you can do so here
|
||||
;; with the `:disable' property:
|
||||
;(package! builtin-package :disable t)
|
||||
|
||||
;; You can override the recipe of a built in package without having to specify
|
||||
;; all the properties for `:recipe'. These will inherit the rest of its recipe
|
||||
;; from Doom or MELPA/ELPA/Emacsmirror:
|
||||
;(package! builtin-package :recipe (:nonrecursive t))
|
||||
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
|
||||
|
||||
;; Specify a `:branch' to install a package from a particular branch or tag.
|
||||
;; This is required for some packages whose default branch isn't 'master' (which
|
||||
;; our package manager can't deal with; see raxod502/straight.el#279)
|
||||
;(package! builtin-package :recipe (:branch "develop"))
|
||||
|
||||
;; Use `:pin' to specify a particular commit to install.
|
||||
;(package! builtin-package :pin "1a2b3c4d5e")
|
||||
|
||||
|
||||
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||
;(unpin! pinned-package)
|
||||
;; ...or multiple packages
|
||||
;(unpin! pinned-package another-pinned-package)
|
||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||
;(unpin! t)
|
||||
|
||||
(package! evil-tutor)
|
||||
|
||||
(package! org-roam)
|
||||
|
||||
(package! platformio-mode)
|
||||
68
modules/home/git/default.nix
Normal file
68
modules/home/git/default.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [zsh-forgit gitflow];
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "muon";
|
||||
userEmail = "admin@muon.host";
|
||||
ignores = [
|
||||
".cache/"
|
||||
".DS_Store"
|
||||
".idea/"
|
||||
"*.swp"
|
||||
"*.elc"
|
||||
"auto-save-list"
|
||||
".direnv/"
|
||||
"node_modules"
|
||||
"result"
|
||||
"result-*"
|
||||
];
|
||||
extraConfig = {
|
||||
init = {defaultBranch = "main";};
|
||||
delta = {
|
||||
line-numbers = true;
|
||||
};
|
||||
branch.autosetupmerge = "true";
|
||||
push.default = "current";
|
||||
merge.stat = "true";
|
||||
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
|
||||
repack.usedeltabaseoffset = "true";
|
||||
pull.ff = "only";
|
||||
rebase = {
|
||||
autoSquash = true;
|
||||
autoStash = true;
|
||||
};
|
||||
rerere = {
|
||||
autoupdate = true;
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
lfs.enable = true;
|
||||
delta.enable = true;
|
||||
aliases = {
|
||||
co = "checkout";
|
||||
c = "commit -m";
|
||||
ca = "commit -am";
|
||||
graph = "log --all --decorate --graph --oneline";
|
||||
l = "log";
|
||||
r = "rebase";
|
||||
s = "status --short";
|
||||
ss = "status";
|
||||
d = "diff";
|
||||
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
|
||||
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
|
||||
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
|
||||
st = "status";
|
||||
br = "branch";
|
||||
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
|
||||
hist = ''
|
||||
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
|
||||
llog = ''
|
||||
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
|
||||
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
|
||||
};
|
||||
};
|
||||
}
|
||||
177
modules/home/helix/default.nix
Normal file
177
modules/home/helix/default.nix
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
keys.normal = {
|
||||
"C" = ["collapse_selection" "extend_to_line_end" "change_selection"];
|
||||
"D" = ["extend_to_line_end" "delete_selection"];
|
||||
"Y" = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "goto_line_start" "collapse_selection"];
|
||||
"V" = ["select_mode" "extend_to_line_bounds"];
|
||||
|
||||
"{" = "goto_prev_paragraph";
|
||||
"}" = "goto_next_paragraph";
|
||||
"X" = "extend_line_above";
|
||||
"esc" = ["collapse_selection" "keep_primary_selection"];
|
||||
space.space = "file_picker";
|
||||
space.w = ":w";
|
||||
# space.q = ":bc";
|
||||
"C-q" = ":xa";
|
||||
space.u = {
|
||||
f = ":format"; # format using LSP formatter
|
||||
w = ":set whitespace.render all";
|
||||
W = ":set whitespace.render none";
|
||||
};
|
||||
};
|
||||
keys.select = {
|
||||
"%" = "match_brackets";
|
||||
};
|
||||
editor = {
|
||||
color-modes = true;
|
||||
cursorline = true;
|
||||
mouse = false;
|
||||
idle-timeout = 1;
|
||||
line-number = "relative";
|
||||
scrolloff = 5;
|
||||
completion-replace = true;
|
||||
bufferline = "always";
|
||||
true-color = true;
|
||||
rulers = [80];
|
||||
soft-wrap.enable = true;
|
||||
indent-guides = {
|
||||
render = true;
|
||||
};
|
||||
lsp = {
|
||||
display-messages = true;
|
||||
display-inlay-hints = true;
|
||||
};
|
||||
statusline = {
|
||||
separator = "|";
|
||||
left = ["mode" "selections" "spinner" "file-name" "total-line-numbers"];
|
||||
center = [];
|
||||
right = ["diagnostics" "file-encoding" "file-line-ending" "file-type" "position-percentage" "position"];
|
||||
mode = {
|
||||
normal = "NORMAL";
|
||||
insert = "INSERT";
|
||||
select = "SELECT";
|
||||
};
|
||||
};
|
||||
|
||||
whitespace.characters = {
|
||||
space = "·";
|
||||
nbsp = "⍽";
|
||||
tab = "→";
|
||||
newline = "⤶";
|
||||
};
|
||||
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "block";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
language = [
|
||||
{
|
||||
name = "bash";
|
||||
auto-format = true;
|
||||
formatter = {
|
||||
command = "${pkgs.shfmt}/bin/shfmt";
|
||||
args = ["-i" "2" "-"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "html";
|
||||
file-types = ["html" "tera"];
|
||||
}
|
||||
{
|
||||
name = "clojure";
|
||||
injection-regex = "(clojure|clj|edn|boot|yuck)";
|
||||
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
|
||||
}
|
||||
{
|
||||
name = "latex";
|
||||
file-types = ["tex"];
|
||||
config.texlab = {
|
||||
build = {
|
||||
forwardSearchAfter = true;
|
||||
onSave = true;
|
||||
};
|
||||
chktex = {
|
||||
onEdit = true;
|
||||
};
|
||||
forwardSearch = {
|
||||
executable = "zathura";
|
||||
args = [ "--synctex-forward" "%l:1:%f" "%p" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
language-server = {
|
||||
bash-language-server = {
|
||||
command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server";
|
||||
args = ["start"];
|
||||
};
|
||||
|
||||
clangd = {
|
||||
command = "${pkgs.clang-tools}/bin/clangd";
|
||||
clangd.fallbackFlags = ["-std=c++2b"];
|
||||
};
|
||||
|
||||
nil = {
|
||||
command = lib.getExe pkgs.nil;
|
||||
config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
themes = {
|
||||
ui.selection = {bg = "white"; modifiers = ["reversed"];};
|
||||
ui.primary = {bg = "light-cyan"; modifiers = ["reversed"];};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# some other lsp related packages / dev tools
|
||||
typst
|
||||
shellcheck
|
||||
lldb
|
||||
gopls
|
||||
clang-tools
|
||||
nodejs
|
||||
guile
|
||||
nim
|
||||
zig
|
||||
texlab
|
||||
zls
|
||||
jre8
|
||||
gcc
|
||||
uncrustify
|
||||
black
|
||||
shellcheck
|
||||
gawk
|
||||
haskellPackages.haskell-language-server
|
||||
java-language-server
|
||||
kotlin-language-server
|
||||
nodePackages.vls
|
||||
nodePackages.jsonlint
|
||||
nodePackages.yarn
|
||||
|
||||
# Nix
|
||||
alejandra
|
||||
nil
|
||||
|
||||
# Rust
|
||||
cargo
|
||||
rust-analyzer
|
||||
];
|
||||
}
|
||||
192
modules/home/herbstluftwm/autostart
Executable file
192
modules/home/herbstluftwm/autostart
Executable file
|
|
@ -0,0 +1,192 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# this is a simple config for herbstluftwm
|
||||
|
||||
hc() {
|
||||
herbstclient "$@"
|
||||
}
|
||||
|
||||
hc emit_hook reload
|
||||
|
||||
xsetroot -solid '#5A8E3A'
|
||||
|
||||
# remove all existing keybindings
|
||||
hc keyunbind --all
|
||||
|
||||
# keybindings
|
||||
# if you have a super key you will be much happier with Mod set to Mod4
|
||||
#Mod=Mod1 # Use alt as the main modifier
|
||||
Mod=Mod4 # Use the super key as the main modifier
|
||||
|
||||
hc keybind $Mod-Shift-e quit
|
||||
hc keybind $Mod-Shift-r reload
|
||||
hc keybind $Mod-Shift-q close
|
||||
hc keybind $Mod-Return spawn "${TERMINAL:-alacritty}" # use your $TERMINAL with xterm as fallback
|
||||
|
||||
# basic movement in tiling and floating mode
|
||||
# focusing clients
|
||||
hc keybind $Mod-Left focus left
|
||||
hc keybind $Mod-Down focus down
|
||||
hc keybind $Mod-Up focus up
|
||||
hc keybind $Mod-Right focus right
|
||||
hc keybind $Mod-h focus left
|
||||
hc keybind $Mod-j focus down
|
||||
hc keybind $Mod-k focus up
|
||||
hc keybind $Mod-l focus right
|
||||
|
||||
# moving clients in tiling and floating mode
|
||||
hc keybind $Mod-Shift-Left shift left
|
||||
hc keybind $Mod-Shift-Down shift down
|
||||
hc keybind $Mod-Shift-Up shift up
|
||||
hc keybind $Mod-Shift-Right shift right
|
||||
hc keybind $Mod-Shift-h shift left
|
||||
hc keybind $Mod-Shift-j shift down
|
||||
hc keybind $Mod-Shift-k shift up
|
||||
hc keybind $Mod-Shift-l shift right
|
||||
|
||||
# splitting frames
|
||||
# create an empty frame at the specified direction
|
||||
hc keybind $Mod-u split bottom 0.5
|
||||
hc keybind $Mod-o split right 0.5
|
||||
# let the current frame explode into subframes
|
||||
hc keybind $Mod-Control-space split explode
|
||||
|
||||
# resizing frames and floating clients
|
||||
resizestep=0.02
|
||||
hc keybind $Mod-Control-h resize left +$resizestep
|
||||
hc keybind $Mod-Control-j resize down +$resizestep
|
||||
hc keybind $Mod-Control-k resize up +$resizestep
|
||||
hc keybind $Mod-Control-l resize right +$resizestep
|
||||
hc keybind $Mod-Control-Left resize left +$resizestep
|
||||
hc keybind $Mod-Control-Down resize down +$resizestep
|
||||
hc keybind $Mod-Control-Up resize up +$resizestep
|
||||
hc keybind $Mod-Control-Right resize right +$resizestep
|
||||
|
||||
# tags
|
||||
tag_names=({1..9})
|
||||
tag_keys=({1..9} 0)
|
||||
|
||||
hc rename default "${tag_names[0]}" || true
|
||||
for i in "${!tag_names[@]}"; do
|
||||
hc add "${tag_names[$i]}"
|
||||
key="${tag_keys[$i]}"
|
||||
if [ -n "$key" ]; then
|
||||
hc keybind "$Mod-$key" use_index "$i"
|
||||
hc keybind "$Mod-Shift-$key" move_index "$i"
|
||||
fi
|
||||
done
|
||||
|
||||
# cycle through tags
|
||||
hc keybind $Mod-period use_index +1 --skip-visible
|
||||
hc keybind $Mod-comma use_index -1 --skip-visible
|
||||
|
||||
# layouting
|
||||
hc keybind $Mod-r remove
|
||||
hc keybind $Mod-s floating toggle
|
||||
hc keybind $Mod-f fullscreen toggle
|
||||
hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
|
||||
hc keybind $Mod-Shift-d set_attr clients.focus.decorated toggle
|
||||
hc keybind $Mod-Shift-m set_attr clients.focus.minimized true
|
||||
hc keybind $Mod-Control-m jumpto last-minimized
|
||||
hc keybind $Mod-p pseudotile toggle
|
||||
# The following cycles through the available layouts within a frame, but skips
|
||||
# layouts, if the layout change wouldn't affect the actual window positions.
|
||||
# I.e. if there are two windows within a frame, the grid layout is skipped.
|
||||
hc keybind $Mod-space \
|
||||
or , and . compare tags.focus.curframe_wcount = 2 \
|
||||
. cycle_layout +1 horizontal max vertical grid \
|
||||
, cycle_layout +1
|
||||
|
||||
# mouse
|
||||
hc mouseunbind --all
|
||||
hc mousebind $Mod-Button1 move
|
||||
hc mousebind $Mod-Button2 zoom
|
||||
hc mousebind $Mod-Button3 resize
|
||||
|
||||
# focus
|
||||
hc keybind $Mod-BackSpace cycle_monitor
|
||||
hc keybind $Mod-Tab cycle_all +1
|
||||
hc keybind $Mod-Shift-Tab cycle_all -1
|
||||
hc keybind $Mod-c cycle
|
||||
hc keybind $Mod-i jumpto urgent
|
||||
|
||||
# theme
|
||||
hc attr theme.tiling.reset 1
|
||||
hc attr theme.floating.reset 1
|
||||
hc set frame_border_active_color '#222222cc'
|
||||
hc set frame_border_normal_color '#101010cc'
|
||||
hc set frame_bg_normal_color '#565656aa'
|
||||
hc set frame_bg_active_color '#345F0Caa'
|
||||
hc set frame_border_width 1
|
||||
hc set show_frame_decorations 'focused_if_multiple'
|
||||
hc set frame_bg_transparent on
|
||||
hc set frame_transparent_width 5
|
||||
hc set frame_gap 4
|
||||
|
||||
hc attr theme.title_height 0
|
||||
hc attr theme.title_when never
|
||||
hc attr theme.title_font 'Dejavu Sans:pixelsize=12' # example using Xft
|
||||
# hc attr theme.title_font '-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
|
||||
hc attr theme.title_depth 3 # space below the title's baseline
|
||||
hc attr theme.active.color '#345F0Cef'
|
||||
hc attr theme.title_color '#ffffff'
|
||||
hc attr theme.normal.color '#323232dd'
|
||||
hc attr theme.urgent.color '#7811A1dd'
|
||||
hc attr theme.tab_color '#1F1F1Fdd'
|
||||
hc attr theme.active.tab_color '#2B4F0Add'
|
||||
hc attr theme.active.tab_outer_color '#6C8257dd'
|
||||
hc attr theme.active.tab_title_color '#ababab'
|
||||
hc attr theme.normal.title_color '#898989'
|
||||
hc attr theme.inner_width 1
|
||||
hc attr theme.inner_color black
|
||||
hc attr theme.border_width 1
|
||||
hc attr theme.floating.border_width 1
|
||||
hc attr theme.floating.outer_width 1
|
||||
hc attr theme.floating.outer_color black
|
||||
hc attr theme.active.inner_color '#789161'
|
||||
hc attr theme.urgent.inner_color '#9A65B0'
|
||||
hc attr theme.normal.inner_color '#606060'
|
||||
# copy inner color to outer_color
|
||||
for state in active urgent normal; do
|
||||
hc substitute C theme.${state}.inner_color \
|
||||
attr theme.${state}.outer_color C
|
||||
done
|
||||
hc attr theme.tiling.outer_width 1
|
||||
hc attr theme.background_color '#141414'
|
||||
|
||||
hc set window_gap 0
|
||||
hc set frame_padding 0
|
||||
hc set smart_window_surroundings on
|
||||
hc set smart_frame_surroundings on
|
||||
hc set mouse_recenter_gap 0
|
||||
|
||||
# rules
|
||||
hc unrule -F
|
||||
#hc rule class=XTerm tag=3 # move all xterms to tag 3
|
||||
hc rule focus=on # normally focus new clients
|
||||
hc rule floatplacement=smart
|
||||
#hc rule focus=off # normally do not focus new clients
|
||||
# give focus to most common terminals
|
||||
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
|
||||
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
|
||||
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
|
||||
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
|
||||
hc rule fixedsize floating=on
|
||||
|
||||
hc set tree_style '╾│ ├└╼─┐'
|
||||
|
||||
# unlock, just to be sure
|
||||
hc unlock
|
||||
|
||||
# do multi monitor setup here, e.g.:
|
||||
# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
|
||||
# or simply:
|
||||
# hc detect_monitors
|
||||
|
||||
# find the panel
|
||||
#panel=~/.config/herbstluftwm/panel.sh
|
||||
#[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
|
||||
#for monitor in $(hc list_monitors | cut -d: -f1) ; do
|
||||
# # start it on each monitor
|
||||
# "$panel" "$monitor" &
|
||||
#done
|
||||
9
modules/home/herbstluftwm/default.nix
Normal file
9
modules/home/herbstluftwm/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.file.".config/herbstluftwm/autostart".source = ./autostart;
|
||||
}
|
||||
48
modules/home/hyprland/default.nix
Normal file
48
modules/home/hyprland/default.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
wayland.windowManager.hyprland = with lib; with pkgs; {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
nvidiaPatches = true;
|
||||
recommendedEnvironment = true;
|
||||
|
||||
extraConfig = ''
|
||||
monitor=,preferred,auto,1
|
||||
|
||||
input {
|
||||
kb_layout = us
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_options = caps:escape
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 1
|
||||
|
||||
touchpad {
|
||||
natural_scroll = false
|
||||
}
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0
|
||||
}
|
||||
|
||||
bind = SUPER, Return, exec, ${getExe alacritty}
|
||||
bind = SUPER, b, exec, ${getExe chromium}
|
||||
'';
|
||||
};
|
||||
|
||||
home.pointerCursor = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
size = 24;
|
||||
x11 = {
|
||||
enable = true;
|
||||
defaultCursor = "Adwaita";
|
||||
};
|
||||
};
|
||||
}
|
||||
109
modules/home/leftwm/default.nix
Normal file
109
modules/home/leftwm/default.nix
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
xdg.configFile."leftwm/themes/current/theme.toml".source = ./theme.toml;
|
||||
xdg.configFile."leftwm/themes/current/up".source = ./up;
|
||||
xdg.configFile."leftwm/themes/current/down".source = ./down;
|
||||
|
||||
xdg.configFile."leftwm/config.ron".text = ''
|
||||
#![enable(implicit_some)]
|
||||
(
|
||||
modkey: "Mod4",
|
||||
mousekey: "Mod4",
|
||||
workspaces: [],
|
||||
tags: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
],
|
||||
max_window_width: None,
|
||||
layouts: [
|
||||
MainAndVertStack,
|
||||
MainAndHorizontalStack,
|
||||
MainAndDeck,
|
||||
GridHorizontal,
|
||||
EvenHorizontal,
|
||||
EvenVertical,
|
||||
Fibonacci,
|
||||
LeftMain,
|
||||
CenterMain,
|
||||
CenterMainBalanced,
|
||||
CenterMainFluid,
|
||||
Monocle,
|
||||
RightWiderLeftStack,
|
||||
LeftWiderRightStack,
|
||||
],
|
||||
layout_mode: Tag,
|
||||
insert_behavior: Bottom,
|
||||
scratchpad: [
|
||||
(name: "Alacritty", value: "alacritty", x: 860, y: 390, height: 300, width: 200),
|
||||
],
|
||||
window_rules: [],
|
||||
disable_current_tag_swap: false,
|
||||
disable_tile_drag: false,
|
||||
disable_window_snap: true,
|
||||
focus_behaviour: Sloppy,
|
||||
focus_new_windows: true,
|
||||
single_window_border: true,
|
||||
sloppy_mouse_follows_focus: true,
|
||||
auto_derive_workspaces: true,
|
||||
keybind: [
|
||||
(command: Execute, value: "dmenu_run", modifier: ["modkey"], key: "p"),
|
||||
(command: Execute, value: "alacritty", modifier: ["modkey"], key: "Return"),
|
||||
(command: CloseWindow, value: "", modifier: ["modkey", "Shift"], key: "q"),
|
||||
(command: SoftReload, value: "", modifier: ["modkey", "Shift"], key: "r"),
|
||||
(command: Execute, value: "loginctl kill-session $XDG_SESSION_ID", modifier: ["modkey", "Shift"], key: "x"),
|
||||
(command: Execute, value: "slock", modifier: ["modkey", "Control"], key: "l"),
|
||||
(command: MoveToLastWorkspace, value: "", modifier: ["modkey", "Shift"], key: "w"),
|
||||
(command: SwapTags, value: "", modifier: ["modkey"], key: "w"),
|
||||
(command: MoveWindowUp, value: "", modifier: ["modkey", "Shift"], key: "k"),
|
||||
(command: MoveWindowDown, value: "", modifier: ["modkey", "Shift"], key: "j"),
|
||||
(command: MoveWindowTop, value: "", modifier: ["modkey", "Shift"], key: "Return"),
|
||||
(command: FocusWindowUp, value: "", modifier: ["modkey"], key: "k"),
|
||||
(command: FocusWindowDown, value: "", modifier: ["modkey"], key: "j"),
|
||||
(command: NextLayout, value: "", modifier: ["modkey", "Control"], key: "k"),
|
||||
(command: PreviousLayout, value: "", modifier: ["modkey", "Control"], key: "j"),
|
||||
(command: FocusWorkspaceNext, value: "", modifier: ["modkey"], key: "l"),
|
||||
(command: FocusWorkspacePrevious, value: "", modifier: ["modkey"], key: "h"),
|
||||
(command: MoveWindowUp, value: "", modifier: ["modkey", "Shift"], key: "Up"),
|
||||
(command: MoveWindowDown, value: "", modifier: ["modkey", "Shift"], key: "Down"),
|
||||
(command: FocusWindowUp, value: "", modifier: ["modkey"], key: "Up"),
|
||||
(command: FocusWindowDown, value: "", modifier: ["modkey"], key: "Down"),
|
||||
(command: NextLayout, value: "", modifier: ["modkey", "Control"], key: "Up"),
|
||||
(command: PreviousLayout, value: "", modifier: ["modkey", "Control"], key: "Down"),
|
||||
(command: FocusWorkspaceNext, value: "", modifier: ["modkey"], key: "Right"),
|
||||
(command: FocusWorkspacePrevious, value: "", modifier: ["modkey"], key: "Left"),
|
||||
(command: GotoTag, value: "1", modifier: ["modkey"], key: "1"),
|
||||
(command: GotoTag, value: "2", modifier: ["modkey"], key: "2"),
|
||||
(command: GotoTag, value: "3", modifier: ["modkey"], key: "3"),
|
||||
(command: GotoTag, value: "4", modifier: ["modkey"], key: "4"),
|
||||
(command: GotoTag, value: "5", modifier: ["modkey"], key: "5"),
|
||||
(command: GotoTag, value: "6", modifier: ["modkey"], key: "6"),
|
||||
(command: GotoTag, value: "7", modifier: ["modkey"], key: "7"),
|
||||
(command: GotoTag, value: "8", modifier: ["modkey"], key: "8"),
|
||||
(command: GotoTag, value: "9", modifier: ["modkey"], key: "9"),
|
||||
(command: MoveToTag, value: "1", modifier: ["modkey", "Shift"], key: "1"),
|
||||
(command: MoveToTag, value: "2", modifier: ["modkey", "Shift"], key: "2"),
|
||||
(command: MoveToTag, value: "3", modifier: ["modkey", "Shift"], key: "3"),
|
||||
(command: MoveToTag, value: "4", modifier: ["modkey", "Shift"], key: "4"),
|
||||
(command: MoveToTag, value: "5", modifier: ["modkey", "Shift"], key: "5"),
|
||||
(command: MoveToTag, value: "6", modifier: ["modkey", "Shift"], key: "6"),
|
||||
(command: MoveToTag, value: "7", modifier: ["modkey", "Shift"], key: "7"),
|
||||
(command: MoveToTag, value: "8", modifier: ["modkey", "Shift"], key: "8"),
|
||||
(command: MoveToTag, value: "9", modifier: ["modkey", "Shift"], key: "9"),
|
||||
],
|
||||
state_path: None,
|
||||
)
|
||||
'';
|
||||
}
|
||||
6
modules/home/leftwm/down
Executable file
6
modules/home/leftwm/down
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPTPATH="$HOME/config/leftwm/themes/current"
|
||||
|
||||
leftwm-command "UnloadTheme"
|
||||
|
||||
3
modules/home/leftwm/theme.toml
Normal file
3
modules/home/leftwm/theme.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
border_width = 1
|
||||
margin = 4
|
||||
focused_border_color = "#2cb8b5"
|
||||
13
modules/home/leftwm/up
Executable file
13
modules/home/leftwm/up
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
export SCRIPTPATH="$HOME/.config/leftwm/themes/current"
|
||||
|
||||
#down the last running theme
|
||||
if [ -f "/tmp/leftwm-theme-down" ]; then
|
||||
/tmp/leftwm-theme-down
|
||||
rm /tmp/leftwm-theme-down
|
||||
fi
|
||||
ln -s $SCRIPTPATH/down /tmp/leftwm-theme-down
|
||||
|
||||
#set the theme.toml config
|
||||
leftwm-command "LoadTheme $SCRIPTPATH/theme.toml"
|
||||
|
||||
91
modules/home/packages.nix
Normal file
91
modules/home/packages.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
|
||||
nixpkgs.config.allowUnfree = false;
|
||||
home.packages = with pkgs; [
|
||||
# system
|
||||
wget
|
||||
unzip
|
||||
neovim
|
||||
python3
|
||||
dconf
|
||||
libnotify
|
||||
i3lock-fancy-rapid
|
||||
pkg-config
|
||||
alsa-utils
|
||||
|
||||
# cli
|
||||
zellij
|
||||
fd
|
||||
glow
|
||||
trash-cli
|
||||
thefuck
|
||||
xclip
|
||||
fend
|
||||
broot
|
||||
unar
|
||||
bottom
|
||||
|
||||
# gui
|
||||
feh
|
||||
rofi
|
||||
dunst
|
||||
yq
|
||||
imagemagick
|
||||
ungoogled-chromium
|
||||
librewolf
|
||||
mullvad-browser
|
||||
tor-browser-bundle-bin
|
||||
gimp
|
||||
logseq
|
||||
zotero
|
||||
armcord
|
||||
freetube
|
||||
texstudio
|
||||
texlive.combined.scheme-full
|
||||
mpv
|
||||
inkscape
|
||||
dolphin
|
||||
qgis
|
||||
obs-studio
|
||||
mumble
|
||||
onionshare-gui
|
||||
freetube
|
||||
kotatogram-desktop
|
||||
signal-desktop
|
||||
|
||||
# dev
|
||||
psmisc
|
||||
qmk
|
||||
python311Packages.pip
|
||||
cmake
|
||||
texlab
|
||||
|
||||
# gaming
|
||||
gamemode
|
||||
gamehub
|
||||
lutris
|
||||
prismlauncher
|
||||
airshipper
|
||||
bottles
|
||||
minigalaxy
|
||||
cemu
|
||||
mindustry
|
||||
|
||||
# media
|
||||
ffmpeg
|
||||
pulseaudio
|
||||
playerctl
|
||||
pavucontrol
|
||||
pulsemixer
|
||||
pamixer
|
||||
alsa-utils
|
||||
alsa-tools
|
||||
cava
|
||||
];
|
||||
}
|
||||
41
modules/home/qutebrowser/default.nix
Normal file
41
modules/home/qutebrowser/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.qutebrowser = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
content.cookies.accept = "no-3rdparty";
|
||||
url = {
|
||||
default_page = "https://searx.be/";
|
||||
start_pages = "https://searx.be/";
|
||||
};
|
||||
};
|
||||
|
||||
searchEngines = {
|
||||
DEFAULT = "https://searx.be/?q={}";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
host = c.content.blocking.hosts.lists.append
|
||||
host("https://www.github.developerdan.com/hosts/lists/facebook-extended.txt")
|
||||
|
||||
abp = c.content.blocking.adblock.lists.append
|
||||
abp("https://fanboy.co.nz/r/fanboy-ultimate.txt")
|
||||
abp("https://fanboy.co.nz/fanboy-antifacebook.txt")
|
||||
abp("https://fanboy.co.nz/fanboy-annoyance.txt")
|
||||
abp("https://fanboy.co.nz/fanboy-cookiemonster.txt")
|
||||
abp("https://easylist-downloads.adblockplus.org/antiadblockfilters.txt")
|
||||
abp("https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt")
|
||||
|
||||
abp("https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt")
|
||||
abp("https://github.com/DandelionSprout/adfilt/raw/master/AnnoyancesList")
|
||||
abp("https://github.com/DandelionSprout/adfilt/raw/master/SocialShareList.txt")
|
||||
abp("https://github.com/DandelionSprout/adfilt/raw/master/ExtremelyCondensedList.txt")
|
||||
'';
|
||||
};
|
||||
}
|
||||
137
modules/home/shell/default.nix
Normal file
137
modules/home/shell/default.nix
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [comma ripgrep];
|
||||
home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
|
||||
programs = {
|
||||
nix-index.enable = false;
|
||||
|
||||
exa.enable = true;
|
||||
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
dircolors = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
skim = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
defaultCommand = "rg --files --hidden";
|
||||
changeDirWidgetOptions = [
|
||||
"--preview 'exa --icons --git --color always -T -L 3 {} | head -200'"
|
||||
"--exact"
|
||||
];
|
||||
};
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = true;
|
||||
scan_timeout = 1;
|
||||
#character = {
|
||||
#error_symbol = "[](bold red)";
|
||||
#success_symbol = "[](bold green)";
|
||||
#vicmd_symbol = "[](bold yellow)";
|
||||
#format = "$symbol [|](bold bright-black) ";
|
||||
#};
|
||||
git_commit = {commit_hash_length = 4;};
|
||||
line_break.disabled = false;
|
||||
lua.symbol = "[](blue) ";
|
||||
python.symbol = "[](blue) ";
|
||||
hostname = {
|
||||
ssh_only = true;
|
||||
format = "[$hostname](bold blue) ";
|
||||
disabled = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
zsh = {
|
||||
enable = true;
|
||||
|
||||
dotDir = ".config/zsh";
|
||||
|
||||
enableCompletion = true;
|
||||
enableAutosuggestions = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
initExtra = ''
|
||||
autoload -U compinit
|
||||
setopt no_auto_remove_slash
|
||||
|
||||
fuck () {
|
||||
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
|
||||
export TF_SHELL=zsh;
|
||||
export TF_ALIAS=fuck;
|
||||
TF_SHELL_ALIASES=$(alias);
|
||||
export TF_SHELL_ALIASES;
|
||||
TF_HISTORY="$(fc -ln -10)";
|
||||
export TF_HISTORY;
|
||||
export PYTHONIOENCODING=utf-8;
|
||||
TF_CMD=$(
|
||||
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
|
||||
) && eval $TF_CMD;
|
||||
unset TF_HISTORY;
|
||||
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
|
||||
test -n "$TF_CMD" && print -s $TF_CMD
|
||||
}
|
||||
'';
|
||||
|
||||
history = {
|
||||
save = 2000000;
|
||||
size = 2000000;
|
||||
expireDuplicatesFirst = true;
|
||||
ignoreDups = true;
|
||||
ignoreSpace = true;
|
||||
path = "$HOME/.local/state/zsh/history";
|
||||
};
|
||||
|
||||
shellAliases = with pkgs; with lib; {
|
||||
rebuild = "doas nix-store --verify; pushd ~/.config/dotfiles && doas nixos-rebuild switch --flake .# && notify-send \"Done\" && bat cache --build; popd";
|
||||
update = "doas nix-store --verify; pushd ~/.config/dotfiles && doas nixos-rebuild switch --upgrade-all --flake .# && notify-send \"Done\" && bat cache --build; popd";
|
||||
cleanup = "doas nix-collect-garbage --delete-older-than 7d";
|
||||
bloat = "nix path-info -Sh /run/current-system";
|
||||
cat = "${getExe bat} --style=plain";
|
||||
vpn = getExe mullvad;
|
||||
grep = getExe ripgrep;
|
||||
fzf = getExe skim;
|
||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||
du = getExe du-dust;
|
||||
ps = getExe procs;
|
||||
m = "mkdir -p";
|
||||
fcd = "cd $(find -type d | fzf)";
|
||||
l = "ls -lF --time-style=long-iso --icons";
|
||||
sc = "sudo systemctl";
|
||||
scu = "systemctl --user ";
|
||||
la = "${getExe exa} -lah";
|
||||
ls = "${getExe exa} -h --git --icons --color=auto --group-directories-first -s extension";
|
||||
tree = "${getExe exa} --tree --icons --tree";
|
||||
burn = "pkill -9";
|
||||
diff = "diff --color=auto";
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../../";
|
||||
"...." = "cd ../../../";
|
||||
"....." = "cd ../../../../";
|
||||
"......" = "cd ../../../../../";
|
||||
v = "${getExe neovim}";
|
||||
vim = "${getExe neovim}";
|
||||
};
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
name = "zsh-vi-mode";
|
||||
src = zsh-vi-mode;
|
||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
47
modules/home/theme/default.nix
Normal file
47
modules/home/theme/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
stylix,
|
||||
...
|
||||
}:
|
||||
let
|
||||
theme-name = "mocha";
|
||||
theme = "${pkgs.base16-schemes}/share/themes/${theme-name}.yaml";
|
||||
wallpaper = pkgs.runCommand "image.png" {} ''
|
||||
COLOR=$(${pkgs.yq}/bin/yq -r .base00 ${theme})
|
||||
COLOR="#"$COLOR
|
||||
${pkgs.imagemagick}/bin/magick convert -size 1920x1080 xc:$COLOR $out
|
||||
'';
|
||||
in {
|
||||
stylix = {
|
||||
image = wallpaper;
|
||||
# polarity = "light";
|
||||
# base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
||||
base16Scheme = theme;
|
||||
|
||||
fonts = {
|
||||
monospace = {
|
||||
package = pkgs.mononoki;
|
||||
name = "Mononoki Nerd Font";
|
||||
};
|
||||
emoji = {
|
||||
package = pkgs.noto-fonts-emoji;
|
||||
name = "Noto Color Emoji";
|
||||
};
|
||||
serif = config.stylix.fonts.monospace;
|
||||
sansSerif = config.stylix.fonts.monospace;
|
||||
};
|
||||
};
|
||||
|
||||
services.random-background = {
|
||||
enable = true;
|
||||
imageDirectory = "${wallpaper}";
|
||||
};
|
||||
|
||||
programs.zellij.enable = true;
|
||||
programs.rofi.enable = true;
|
||||
|
||||
# config.services.xserver.desktopManager.wallpaper = ./wallpaper.jpg;
|
||||
}
|
||||
BIN
modules/home/theme/wallpaper.jpg
Normal file
BIN
modules/home/theme/wallpaper.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
93
modules/home/tools/default.nix
Normal file
93
modules/home/tools/default.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
browser = ["chromium.desktop"];
|
||||
|
||||
associations = {
|
||||
"text/html" = browser;
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
"x-scheme-handler/ftp" = browser;
|
||||
"x-scheme-handler/about" = browser;
|
||||
"x-scheme-handler/unknown" = browser;
|
||||
"application/x-extension-htm" = browser;
|
||||
"application/x-extension-html" = browser;
|
||||
"application/x-extension-shtml" = browser;
|
||||
"application/xhtml+xml" = browser;
|
||||
"application/x-extension-xhtml" = browser;
|
||||
"application/x-extension-xht" = browser;
|
||||
|
||||
"audio/*" = ["mpv.desktop"];
|
||||
"video/*" = ["mpv.dekstop"];
|
||||
"image/*" = ["imv.desktop"];
|
||||
"application/json" = browser;
|
||||
#"application/pdf" = ["org.pwmt.zathura.desktop.desktop"];
|
||||
#"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
||||
#"x-scheme-handler/spotify" = ["spotify.desktop"];
|
||||
#"x-scheme-handler/discord" = ["WebCord.desktop"];
|
||||
};
|
||||
|
||||
texlive = pkgs.texlive.combine {
|
||||
inherit
|
||||
(pkgs.texlive)
|
||||
scheme-small
|
||||
noto
|
||||
mweights
|
||||
cm-super
|
||||
cmbright
|
||||
fontaxes
|
||||
beamer
|
||||
;
|
||||
};
|
||||
|
||||
in {
|
||||
# home.packages = [texlive];
|
||||
services = {
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "gnome3";
|
||||
enableSshSupport = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
gpg.enable = true;
|
||||
man.enable = true;
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
tealdeer = {
|
||||
enable = true;
|
||||
settings = {
|
||||
display = {
|
||||
compact = false;
|
||||
use_pager = true;
|
||||
};
|
||||
updates = {
|
||||
auto_update = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
bat.enable = true;
|
||||
};
|
||||
xdg = {
|
||||
userDirs = {
|
||||
enable = true;
|
||||
documents = "$HOME/documents";
|
||||
download = "$HOME/downloads";
|
||||
videos = "$HOME/misc/videos";
|
||||
music = "$HOME/misc/music";
|
||||
pictures = "$HOME/misc/pictures";
|
||||
desktop = "$HOME/misc/desktop";
|
||||
publicShare = "$HOME/misc/public";
|
||||
templates = "$HOME/misc/templates";
|
||||
};
|
||||
mimeApps.enable = true;
|
||||
mimeApps.associations.added = associations;
|
||||
mimeApps.defaultApplications = associations;
|
||||
};
|
||||
}
|
||||
165
modules/home/xmonad/default.nix
Normal file
165
modules/home/xmonad/default.nix
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with config.lib.stylix.colors; {
|
||||
xsession.windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
};
|
||||
|
||||
xsession.windowManager.xmonad.config =
|
||||
pkgs.writeText "xmonad.hs" ''
|
||||
import XMonad
|
||||
|
||||
import XMonad.Config.Desktop
|
||||
|
||||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Layout.NoBorders
|
||||
import XMonad.Layout.Gaps
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Layout.PerScreen
|
||||
|
||||
import XMonad.Util.EZConfig
|
||||
import XMonad.Util.Ungrab
|
||||
import XMonad.Util.Loggers
|
||||
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.DynamicLog
|
||||
import XMonad.Hooks.ManageDocks
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.StatusBar
|
||||
import XMonad.Hooks.StatusBar.PP
|
||||
|
||||
import System.Exit
|
||||
|
||||
import qualified XMonad.StackSet as W
|
||||
|
||||
mobarStart = "xmobar ~/.config/xmobar/xmobarrc"
|
||||
|
||||
main :: IO()
|
||||
main = xmonad
|
||||
. ewmhFullscreen
|
||||
. ewmh
|
||||
. docks
|
||||
. withEasySB mySB defToggleStrutsKey
|
||||
$ myConfig
|
||||
where
|
||||
mySB = statusBarProp mobarStart (pure myXmobarPP)
|
||||
|
||||
myConfig = def
|
||||
{ modMask = mod4Mask
|
||||
, terminal = "alacritty"
|
||||
|
||||
-- Border
|
||||
, borderWidth = 1
|
||||
, normalBorderColor = "#${base03}"
|
||||
, focusedBorderColor = "#${base0B}"
|
||||
|
||||
-- Hooks
|
||||
, manageHook = myHook
|
||||
-- , layoutHook = desktopLayoutModifiers $ smartBorders myLayout
|
||||
, layoutHook = myLayout
|
||||
-- , startupHook = myStartup
|
||||
}
|
||||
`additionalKeysP`
|
||||
[ ("M-b", spawn "chromium")
|
||||
, ("M-<Return>", spawn "alacritty")
|
||||
, ("M-d", spawn "rofi -show drun")
|
||||
|
||||
-- Windows
|
||||
, ("M-S-<Return>", windows W.swapMaster)
|
||||
, ("M-S-q", kill)
|
||||
, ("M-S-x", io (exitWith ExitSuccess))
|
||||
|
||||
-- Media keys
|
||||
, ("<XF86AudioMute>", spawn "pamixer -t")
|
||||
, ("<XF86AudioLowerVolume>", spawn "pamixer -d2")
|
||||
, ("<XF86AudioRaiseVolume>", spawn "pamixer -i2")
|
||||
]
|
||||
|
||||
myLayout = avoidStruts $ lessBorders Screen $ smartBorders $ tall ||| Full
|
||||
where
|
||||
addSpaces = spacingRaw True (Border 2 2 2 2) True (Border 2 2 2 2) True
|
||||
-- addGaps = gaps [(U,10),(R,10),(L,10),(D,10)]
|
||||
-- tall = ResizableTall 2 (1/10) 1 []
|
||||
tall = ifWider 1280 (tiled) (Mirror tiled)
|
||||
tiled = Tall nmaster delta ratio
|
||||
nmaster = 1
|
||||
ratio = 1/2
|
||||
delta = 3/100
|
||||
|
||||
myHook :: ManageHook
|
||||
myHook = composeAll
|
||||
[ isDialog --> doFloat
|
||||
, isFullscreen --> (doF W.focusDown <+> doFullFloat)
|
||||
]
|
||||
|
||||
-- myStartup :: X ()
|
||||
-- myStartup = do
|
||||
-- spawn mobarStart
|
||||
|
||||
myXmobarPP :: PP
|
||||
myXmobarPP = def
|
||||
{ ppSep = magenta " • "
|
||||
, ppTitleSanitize = xmobarStrip
|
||||
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#${base0C}" 2
|
||||
, ppHidden = white . wrap " " ""
|
||||
, ppHiddenNoWindows = lowWhite . wrap " " ""
|
||||
, ppUrgent = red . wrap (yellow "!") (yellow "!")
|
||||
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
|
||||
, ppExtras = [logTitles formatFocused formatUnfocused]
|
||||
}
|
||||
where
|
||||
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
|
||||
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
|
||||
|
||||
-- | Windows should have *some* title, which should not not exceed a
|
||||
-- sane length.
|
||||
ppWindow :: String -> String
|
||||
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
|
||||
|
||||
blue, lowWhite, magenta, red, white, yellow :: String -> String
|
||||
magenta = xmobarColor "#${base0E}" ""
|
||||
blue = xmobarColor "#${base0D}" ""
|
||||
white = xmobarColor "#${base05}" ""
|
||||
yellow = xmobarColor "#${base0A}" ""
|
||||
red = xmobarColor "#${base08}" ""
|
||||
lowWhite = xmobarColor "#${base04}" ""
|
||||
'';
|
||||
|
||||
programs.xmobar.enable = true;
|
||||
programs.xmobar.extraConfig = ''
|
||||
Config
|
||||
{ overrideRedirect = False
|
||||
, font = "Mononoki"
|
||||
, bgColor = "#${base00}"
|
||||
, fgColor = "#${base05}"
|
||||
, position = BottomH 20
|
||||
, lowerOnStart = True
|
||||
, commands =
|
||||
[ Run Cpu
|
||||
[ "-L", "3"
|
||||
, "-H", "50"
|
||||
, "--high" , "red"
|
||||
, "--normal", "green"
|
||||
] 10
|
||||
, Run Alsa "default" "Master"
|
||||
[ "--template", "Vol: <volumestatus>"
|
||||
, "--suffix" , "True"
|
||||
, "--"
|
||||
, "--on", ""
|
||||
]
|
||||
, Run Memory ["--template", "Mem: <usedratio>%"] 10
|
||||
, Run Swap [] 10
|
||||
, Run Date "%Y-%m-%d %a <fc=#${base0C}>%H:%M:%S</fc>" "date" 1
|
||||
, Run XMonadLog
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = "%XMonadLog% }{ %cpu% | %memory% | %swap% | %date% "
|
||||
}
|
||||
'';
|
||||
}
|
||||
10
modules/unfree/default.nix
Normal file
10
modules/unfree/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./nvidia.nix
|
||||
./flatpak.nix
|
||||
];
|
||||
}
|
||||
12
modules/unfree/flatpak.nix
Normal file
12
modules/unfree/flatpak.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Don't like flatpak, even though it's free
|
||||
# Only used to contain unfree packages
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
services.flatpak.enable = true;
|
||||
}
|
||||
71
modules/unfree/nvidia.nix
Normal file
71
modules/unfree/nvidia.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Unfree </3
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-run"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
# environment.variables = {
|
||||
# GBM_BACKEND = "nvidia-drm";
|
||||
# LIBVA_DRIVER_NAME = "nvidia";
|
||||
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
# };
|
||||
|
||||
services.picom = {
|
||||
enable = true;
|
||||
vSync = true;
|
||||
settings = {
|
||||
"unredir-if-possible" = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.steam.enable = true;
|
||||
|
||||
hardware = {
|
||||
opengl = {
|
||||
# this fixes the "glXChooseVisual failed" bug, context: https://github.com/NixOS/nixpkgs/issues/47932
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
# optionally enable 32bit pulseaudio support if pulseaudio is enabled
|
||||
pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
|
||||
|
||||
nvidia = {
|
||||
open = false;
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = true;
|
||||
forceFullCompositionPipeline = true;
|
||||
|
||||
# powerManagement.enable = true;
|
||||
# prime = {
|
||||
# reverseSync.enable = true;
|
||||
# # offload = {
|
||||
# # enable = true;
|
||||
# # enableOffloadCmd = true;
|
||||
# # };
|
||||
|
||||
# intelBusId = "PCI:0:2:0";
|
||||
# nvidiaBusId = "PCI:1:0:0";
|
||||
# };
|
||||
};
|
||||
|
||||
opengl.extraPackages = with pkgs; [nvidia-vaapi-driver];
|
||||
};
|
||||
}
|
||||
20
modules/unfree/prime.nix
Normal file
20
modules/unfree/prime.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
hardware.nvidia = {
|
||||
powerManagement.enable = true;
|
||||
prime = {
|
||||
reverseSync.enable = true;
|
||||
# offload = {
|
||||
# enable = true;
|
||||
# enableOffloadCmd = true;
|
||||
# };
|
||||
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue