PNKSVM5EGSTD6ZIRPJD233SGJDNPE2VMUHTA5F2C3Y7HEYKBZLGQC
{ self, ... }:
{
home-manager.users.valts = { suites, profiles, ... }: {
imports = suites.base ++ (with profiles; [
graphical.common
graphical.godot
kakoune
pijul
smos
]);
};
age.secrets = {
valts.file = "${self}/secrets/valts.age";
};
users.users.valts = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "video" "input" "docker" "libvirtd" "scanner" "lp" ];
passwordFile = "/run/agenix/valts";
};
}
{ self, lib, ... }:
{
age.secrets = {
root.file = "${self}/secrets/root.age";
};
users.users.root.passwordFile = lib.mkDefault "/run/agenix/root";
}
{ hmUsers, ... }:
{
home-manager.users = { inherit (hmUsers) nixos; };
users.users.nixos = {
password = "nixos";
description = "default";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
}
{ ... }: {
services.postgresql = {
enable = true;
ensureDatabases = [ "personal" ];
};
}
{ self, pkgs, ... }: {
age.secrets = {
paperless-admin.file = "${self}/secrets/paperless-admin.age";
};
services.paperless-ng.enable = true;
services.paperless-ng.port = 28981;
services.paperless-ng.passwordFile = "/run/agenix/paperless-admin";
services.paperless-ng.extraConfig = {
PAPERLESS_AUTO_LOGIN_USERNAME = "admin";
PAPERLESS_OCR_LANGUAGE = "lav+eng";
};
}
{ ... }: {
services.hledger-web.enable = true;
services.hledger-web.port = 5000;
}
{ ... }: {
services.openssh = {
enable = true;
openFirewall = true;
};
}
{ ... }: {
networking.networkmanager.enable = true;
}
{ ... }: {
networking.extraHosts = ''
127.0.0.1 test_client-test_network-tty.ws.gigops-dev.net
127.0.0.1 test_client-test_network-http-7992.ws.gigops-dev.net
'';
}
{ ... }: {
networking.dhcpcd.wait = "background";
}
{ ... }: {
imports = [
./networkmanager
./dhcpcd
];
}
{
programs.light.enable = true;
}
{ ... }: {
hardware.sane.enable = true;
}
{ pkgs, ... }: {
services.printing.enable = true;
services.printing.drivers = with pkgs; [
gutenprint
samsungUnifiedLinuxDriver
];
nixpkgs.allowUnfreeWhitelist = [ "samsung-UnifiedLinuxDriver" ];
}
{ pkgs, ... }: {
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.opengl.driSupport32Bit = true;
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.lightdm.enable = true;
# Allow home manager to provide window manager
desktopManager.session = [
{
name = "home-manager";
start = ''
${pkgs.runtimeShell} $HOME/.hm-xsession &
waitPID=$!
'';
}
];
};
}
{ pkgs, ... }: {
programs.steam.enable = true;
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
xlibs.libXcursor
xlibs.libXinerama
xlibs.libXi
xlibs.libXScrnSaver
libpulseaudio
libpng
libvorbis
];
};
};
}
{ pkgs, lib, ... }: {
imports = [ ./xserver ];
nixpkgs.allowUnfreeWhitelist = [
"spotify"
"spotify-unwrapped"
"teams"
"zoom"
"faac" # required for zoom
"steam"
"steam-original"
"steam-runtime"
];
# Dump of graphical packages without profiles
environment.systemPackages = with pkgs; [
chromium
feh
gimp
inkscape
libreoffice
paraview
pavucontrol
spotify
teams
transmission-qt
virt-manager
vlc
xsel
zathura
zoom-us
];
}
{
virtualisation.docker.enable = true;
}
{ pkgs, ... }:
{
virtualisation.libvirtd = {
enable = true;
qemu.package = pkgs.qemu_kvm;
};
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.stack ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.python38 ];
}
{ pkgs, ... }:
{
services.udev = {
packages = with pkgs; [ platformio ];
extraRules = ''
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#####################################################################################
#
# INSTALLATION
#
# Please visit > https://docs.platformio.org/en/latest/faq.html#platformio-udev-rules
#
#####################################################################################
#
# Boards
#
# CP210X USB UART
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# FT231XS USB UART
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Prolific Technology, Inc. PL2303 Serial Port
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# QinHeng Electronics HL-340 USB-Serial adapter
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Arduino boards
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][02]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Arduino SAM-BA
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{MTP_NO_PROBE}="1"
# Digistump boards
ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Maple with DFU
ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="000[34]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# USBtiny
ATTRS{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# USBasp V2.0
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Teensy boards
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
#TI Stellaris Launchpad
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
#TI MSP430 Launchpad
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
#GD32V DFU Bootloader
ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
#
# Debuggers
#
# Black Magic Probe
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic GDB Server", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# opendous and estick
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Original FT232/FT245 VID:PID
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Original FT2232 VID:PID
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Original FT4232 VID:PID
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Original FT232H VID:PID
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# DISTORTEC JTAG-lock-pick Tiny 2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TUMPA, TUMPA Lite
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# XDS100v2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI/Luminary Stellaris Evaluation Board FTDI (several)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# egnite Turtelizer 2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Section5 ICEbear
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Amontec JTAGkey and JTAGkey-tiny
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI ICDI
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# STLink probes
ATTRS{idVendor}=="0483", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Hilscher NXHX Boards
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Hitex probes
ATTRS{idVendor}=="0640", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Altera USB Blaster
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Amontec JTAGkey-HiSpeed
ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# SEGGER J-Link
ATTRS{idVendor}=="1366", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Raisonance RLink
ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Debug Board for Neo1973
ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Olimex probes
ATTRS{idVendor}=="15ba", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# USBprog with OpenOCD firmware
ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Marvell Sheevaplug
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Keil Software, Inc. ULink
ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# CMSIS-DAP compatible adapters
ATTRS{product}=="*CMSIS-DAP*", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Atmel AVR Dragon
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
'';
};
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.ghc ];
}
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.arangodb ];
}
[aws]
symbol = " "
[character]
success_symbol = "[❯](bold purple)"
vicmd_symbol = "[❮](bold purple)"
[battery]
full_symbol = ""
charging_symbol = ""
discharging_symbol = ""
[conda]
symbol = " "
[directory]
style = "cyan"
read_only = " 🔒"
[elixir]
symbol = " "
[elm]
symbol = " "
[git_branch]
format = "[$symbol$branch]($style) "
symbol = " "
style = "bold dimmed white"
[git_status]
format = '([「$all_status$ahead_behind」]($style) )'
conflicted = "⚠️"
ahead = "⟫${count} "
behind = "⟪${count}"
diverged = "🔀 "
untracked = "📁 "
stashed = "↪ "
modified = "𝚫 "
staged = "✔ "
renamed = "⇆ "
deleted = "✘ "
style = "bold bright-white"
[golang]
symbol = " "
[hg_branch]
symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[memory_usage]
symbol = " "
disabled = false
[nim]
symbol = " "
[nix_shell]
format = '[$symbol$state]($style) '
symbol = " "
pure_msg = "λ"
impure_msg = "⎔"
[nodejs]
symbol = " "
[package]
symbol = " "
[php]
symbol = " "
[python]
symbol = " "
[ruby]
symbol = " "
[rust]
symbol = " "
[status]
disabled = false
{ self, config, lib, pkgs, ... }:
let inherit (lib) fileContents;
in
{
imports = [ ../cachix ];
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
environment = {
systemPackages = with pkgs; [
agenix
binutils
coreutils
curl
direnv
dnsutils
dosfstools
fd
git
bottom
gptfdisk
iputils
jq
manix
moreutils
nix-index
nmap
ripgrep
skim
tealdeer
usbutils
utillinux
whois
];
shellInit = ''
export STARSHIP_CONFIG=${
pkgs.writeText "starship.toml"
(fileContents ./starship.toml)
}
'';
shellAliases =
let ifSudo = lib.mkIf config.security.sudo.enable;
in
{
# quick cd
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
"....." = "cd ../../../..";
# git
g = "git";
# grep
grep = "rg";
gi = "grep -i";
# internet ip
myip = "dig +short myip.opendns.com @208.67.222.222 2>&1";
# nix
n = "nix";
np = "n profile";
ni = "np install";
nr = "np remove";
ns = "n search --no-update-lock-file";
nf = "n flake";
nepl = "n repl '<nixpkgs>'";
srch = "ns nixos";
orch = "ns override";
nrb = ifSudo "sudo nixos-rebuild";
mn = ''
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="manix '{}'" | xargs manix
'';
# fix nixos-option
nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat";
# sudo
s = ifSudo "sudo -E ";
si = ifSudo "sudo -i";
se = ifSudo "sudoedit";
# top
top = "btm";
# systemd
ctl = "systemctl";
stl = ifSudo "s systemctl";
utl = "systemctl --user";
ut = "systemctl --user start";
un = "systemctl --user stop";
up = ifSudo "s systemctl start";
dn = ifSudo "s systemctl stop";
jtl = "journalctl";
};
};
fonts = {
fonts = with pkgs; [ powerline-fonts dejavu_fonts ];
fontconfig.defaultFonts = {
monospace = [ "DejaVu Sans Mono for Powerline" ];
sansSerif = [ "DejaVu Sans" ];
};
};
nix = {
autoOptimiseStore = true;
gc.automatic = true;
optimise.automatic = true;
useSandbox = true;
allowedUsers = [ "@wheel" ];
trustedUsers = [ "root" "@wheel" ];
extraOptions = ''
min-free = 536870912
keep-outputs = true
keep-derivations = true
fallback = true
'';
};
programs.bash = {
promptInit = ''
eval "$(${pkgs.starship}/bin/starship init bash)"
'';
interactiveShellInit = ''
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
'';
};
# For rage encryption, all hosts need a ssh key pair
services.openssh = {
enable = true;
openFirewall = lib.mkDefault false;
};
services.earlyoom.enable = true;
# Preferably use passwords from users definitions
users.mutableUsers = lib.mkDefault false;
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.zip ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.wget ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.unar ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.tree ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.tig ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.rsync ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.ripgrep ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.patchelf ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.pandoc ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.openssl ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.openconnect ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.nixpkgs-fmt ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.nix-tree ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.nix-top ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.nix-prefetch ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.niv ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.haskellPackages.neuron ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.jq ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.imagemagick ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.hledger ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.hledger ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.graphviz ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.fzf ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.file ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.dolt ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.dnsutils ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.curl ];
}
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.croc ];
}
{ ... }: {
imports = [
./dnsutils
./file
./fzf
./htop
./jq
./nix-prefetch
./nix-top
./nix-tree
./nixpkgs-fmt
./openssl
./patchelf
./ripgrep
./rsync
./tig
./tree
./unar
./wget
./zip
];
}
{
nix = {
binaryCaches = [
"https://nrdxp.cachix.org"
];
binaryCachePublicKeys = [
"nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4="
];
};
}
{
nix = {
binaryCaches = [
"https://nix-community.cachix.org"
];
binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}
{ pkgs, lib, ... }:
let
folder = ./.;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix";
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in
{
inherit imports;
nix.binaryCaches = [ "https://cache.nixos.org/" ];
}
{
nix = {
binaryCaches = [
"https://cipharius.cachix.org"
];
binaryCachePublicKeys = [
"cipharius.cachix.org-1:g/0MTHiKffFGd4bnVWX2E3rXqXL3xfjkYlCgq8/5PvM="
];
};
}
{ config, lib, ... }:
let
getName = drv:
if builtins.hasAttr "pname" drv
then drv.pname
else if builtins.hasAttr "name" drv
then (builtins.parseDrvName drv.name).name
else throw "Cannot figure out name of: ${drv}";
in
{
options = {
nixpkgs.allowUnfreeWhitelist = lib.mkOption {
default = [ ];
description = "A whitelist of allowed unfree packages";
type = with lib.types; listOf string;
};
};
config = {
nixpkgs.config.allowUnfreePredicate = (pkg:
builtins.elem (getName pkg) config.nixpkgs.allowUnfreeWhitelist
);
};
}
let
mcg-valts = {
root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIGxaUQc7BEZhcmXNcqSHzbKmlmUSLZQ9F4j/ECy4Poy root@mcg-valts";
valts = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmPt95vTEmI3eT0YALlDN3WWEFdLX1VKUTCbmrKmF7e+1Hy+rN1ln3ELi0kNmj9PEOM4aE7llIDXr8yE3kqMIHJudX1i3kKI9gKySbX8haT8u9MQsC4Nfc2oMz3BKsLvGkrBgCd9PMrTcx7iNC1HNF6RYXO8vP04wncHNRYffMD63t7FUoRkLqSDN9oOpHJ0pXrk1X97413zqcXpW997ASVuJEV6qADkdZXqOpZPPOI0Jav8uAXlsS0qsqwy7srxxeDSDSzUgwoeattLPBfpwQL1zatfTAWkWManvuulxHkybjWs68cnCQbGpUQlX945tTm+YpQtcE2fvtCL+DOigH95iH7hff/YWd72cipuY6VwyyxIMBK5qsPKehENPLb2B6r+jOxd3NedxZMzGYZob48uo1rMcGTJpckTCHFDZ/p3rVIrOIvXazHzXcMoEFvCiQNwiQkALXqvG+9PrSJ86rqu85eUfeGXQErYHpsANma/rw1n9/T3rJ1GRlmxAYZSU= valts@mcg-valts";
};
armarium = {
root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIARs2WSLSiz0FeS2aCSIDG+nDjQkmLca0v2KvH908B6C root@armarium";
};
allKeys = [
mcg-valts.root
mcg-valts.valts
armarium.root
];
in
{
"valts.age".publicKeys = allKeys;
"root.age".publicKeys = allKeys;
"paperless-admin.age".publicKeys = allKeys;
"wireless.age".publicKeys = allKeys;
}
final: prev: {
}
channels: final: prev: {
__dontExport = true;
inherit (channels.nixos-latest)
libreoffice # Broken in 21.11, remove from here once fixed
;
}
{ lib }:
lib.makeExtensible (self: { })
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock); # TODO Use more digga compliant method
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ../../.; }
)
{ suites, lib, profiles, ... }:
{
imports = suites.laptop ++ (with profiles; [
docker
development.platformio
graphical.steam
]);
fileSystems."/" = {
device = "/dev/disk/by-uuid/2c251e55-0255-4ff4-89aa-07a5127b0748";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/3927-C499";
fsType = "vfat";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/fc051fc4-8ca6-48cf-a425-6e913c23ed51"; }
];
boot.initrd.luks.devices = {
"root".device = "/dev/disk/by-uuid/9a8fd4e3-3f40-4246-ab85-59a4e1b31b93";
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
networking.useDHCP = false;
networking.interfaces.enp1s0.useDHCP = true;
networking.interfaces.wlp2s0.useDHCP = true;
time.timeZone = "Europe/Riga";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
nix.maxJobs = lib.mkDefault 4;
}
{ self, suites, lib, profiles, ... }:
{
imports = suites.server ++ (with profiles; [
server.personal-database
server.paperless-ng
server.hledger-web
hardware.scanner
cli.hledger
]);
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
age.secrets = {
wireless.file = "${self}/secrets/wireless.age";
};
networking.wireless.enable = true;
networking.wireless.environmentFile = "/run/agenix/wireless";
networking.wireless.networks = {
Ciphus = { psk = "@WLAN_PSK_CIPHUS@"; };
};
networking.dhcpcd.enable = false;
networking.useDHCP = false;
networking.interfaces.wlp1s0.ipv4.addresses = [{
address = "192.168.8.10";
prefixLength = 24;
}];
networking.defaultGateway = "192.168.8.1";
networking.nameservers = [
"194.8.2.2"
"9.9.9.9"
"8.8.8.8"
];
networking.firewall.allowedTCPPorts = [ 80 ];
services.hledger-web.baseUrl = "http://ledger.home.tase.lv";
services.nginx.enable = true;
services.nginx.virtualHosts = {
"ledger.home.tase.lv" = {
locations."/" = {
proxyPass = "http://localhost:5000";
};
};
"documents.home.tase.lv" = {
locations."/" = {
proxyPass = "http://localhost:28981";
};
};
"scanner.home.tase.lv" = {
locations."/" = {
proxyPass = "http://localhost:8000";
};
};
};
time.timeZone = "Europe/Riga";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
services.logind.lidSwitch = "ignore";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
nix.maxJobs = lib.mkDefault 4;
}
{ pkgs, ... }: {
home.packages = with pkgs; [ smos ];
}
{ pkgs, ... }: {
home.packages = with pkgs; [ pijul ];
home.file = {
".config/pijul/config.toml".source = ./config.toml;
};
}
[author]
name = "valts.liepins"
full_name = "Valts Liepiņš"
email = "valts.liepins@pm.me"
# Lf launcher
provide-module lf %{
require-module connect
require-module connect-lf
declare-option -hidden str lf_params %{-command "set preview!; set ratios 1"}
declare-user-mode lf-mode
map global -docstring 'Open in pwd' \
lf-mode w ': lf %opt{lf_params}<a-!><ret>'
map global -docstring 'Open in file dir' \
lf-mode d ': lf %opt{lf_params} %sh{dirname $kak_buffile}<a-!><ret>'
map global -docstring 'Open in git root' \
lf-mode p ': lf %opt{lf_params} %sh{git rev-parse --show-toplevel}<a-!><ret>'
}
# Kakoune LSP Client
# eval %sh{kak-lsp --kakoune -s $kak_session}
# define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings }
# define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings }
# define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings }
# define-command lsp-restart -docstring 'restart lsp server' %{ lsp-stop; lsp-start }
# hook global WinSetOption filetype=(haskell|python) %{
# # set-option window lsp_auto_highlight_references true # NOTE Not supported by JSON
# set-option window lsp_hover_anchor false
# map window user , %{: enter-user-mode lsp<ret>}
# echo -debug "Enabling LSP for filtetype %opt{filetype}"
# lsp-enable-window
# }
# SCRIPTS #
hook global KakBegin .* %{
source "%val{config}/scripts/lf.kak"
require-module lf
}
# source "%val{config}/scripts/neuron.kak"
# require-module neuron
# hook global WinSetOption filetype=markdown %{
# map window normal <ret> %{: neuron-follow-link<ret>}
# }
# VISUAL #
colorscheme zenburn
add-highlighter global/number-lines number-lines -relative
# add-highlighter global/ wrap -word -indent -marker '↪ ' -width 80
add-highlighter global/todos regex (?:TODO|NOTE)\s 0:red+bf
add-highlighter global/trailing-whitespace regex "[ ]+$" 0:BufferPadding
set-face global PrimarySelection default+bu
set-option global autowrap_fmtcmd 'fmt --width %c'
set-option -add global ui_options ncurses_assistant=cat
# HOOKS #
hook global ModeChange "push:normal:prompt" %{
map -docstring 'Insert selection' \
window prompt <a-i> "%reg{.}<a-!>"
}
# hook global WinSetOption "filetype=(?:c|cpp)" %{
# map -docstring "describe symbol at point" \
# window user d ": rtags-symbol-info<ret>"
# map -docstring "symbol definition" \
# window goto s "<esc>: rtags-follow<ret>"
# }
hook global WinSetOption "filetype=kak" %{
map -docstring "evaluate whole buffer" \
window user e %{%: eval %reg{.}<ret>}
}
hook global ModuleLoaded "kitty" %{
# Let WM handle terminals
unalias global terminal kitty-terminal
alias global terminal x11-terminal
}
# COMMANDS #
define-command split -params 0 -docstring \
"Creates new client with current buffer" \
%{
new %sh{
line=$(echo "$kak_window_range" | cut -d' ' -f 1)
column=$(echo "$kak_window_range" | cut -d' ' -f 2)
printf 'buffer -- %s;' "$kak_bufname"
printf 'execute-keys %s jvt;' "$line"
printf 'select -- %s;' "$kak_selection_desc"
printf 'execute-keys V %s <esc>;' "$(printf "%""$column""s" | tr ' ' 'l')"
}
}
define-command change-filetype \
-params 1..1 \
-docstring "change-filetype <filetype>: set filetype of current buffer" \
%{ set buffer filetype %arg{1} }
define-command edit-config \
-docstring "edit-config: open the user config file" \
%{ edit "%val{config}/kakrc" }
define-command -params 1.. cheat %{
try %{ delete-buffer! *cheat* }
edit -scratch *cheat*
execute-keys "!curl https://cheat.sh/%sh{echo $@ | tr ' ' '+'}<ret>"
ansi-render
}
define-command clear-trailing-whitespaces \
-docstring "deletes all trailing whitespaces in current buffer" \
%{ try %{ execute-keys -draft '%s[ \t]+$<ret>d' } }
# OPTIONS #
require-module x11
declare-option str term 'kitty'
set-option global termcmd "%opt{term} -e bash -c "
set-option global indentwidth 2
set-option global grepcmd 'rg -Hn'
alias global tag ctags-search
# MAPPINGS #
map global normal / "/(?i)"
map -docstring 'Search cheatsheet' \
global user c ":cheat "
map -docstring 'Search filetype cheatsheet' \
global user C ":cheat %opt{filetype}/"
map -docstring 'Calculate selection' \
global user = '| calc -p<ret>'
map -docstring 'System copy' \
global user y '<a-|> xsel --input --clipboard<ret>'
map -docstring 'System paste' \
global user p '! xsel --output --clipboard<ret>'
map -docstring 'lf' \
global user d ': enter-user-mode lf-mode<ret>'
map -docstring 'Split window' \
global user s ': split<ret>'
# map -docstring 'Tagbar toggle' \
# global user t ': try tagbar-toggle catch tagbar-enable<ret>'
# Old config
# hook global KakEnd .* lsp-exit
# }
# plug "TeddyDD/kakoune-edit-or-dir" config %{
# unalias global e edit
# alias global e edit-or-dir
# hook global WinSetOption filetype=file_select %{
# map window normal l ':<space>edit-or-dir-forward<ret>'
# map window normal h ':<space>edit-or-dir-back<ret>'
# map window normal q ':<space>delete-buffer<ret>'
# }
# }
# plug "andreyorst/fzf.kak" config %{
# map -docstring "fzf" \
# global user <space> ': fzf-mode<ret>'
# }
# plug "andreyorst/tagbar.kak" defer tagbar %{
# set-option global tagbar_sort false
# set-option global tagbar_size 40
# set-option global tagbar_display_anon false
# }
# plug "cipharius/buffer-by-name.kak" defer buffer-by-name %{
# alias global b buffer-by-name
# } demand
# plug "andreyorst/kaktree" config %{
# hook global WinSetOption filetype=kaktree %{
# remove-highlighter buffer/numbers
# remove-highlighter buffer/matching
# remove-highlighter buffer/wrap
# remove-highlighter buffer/show-whitespaces
# }
# kaktree-enable
# }
# plug "https://gitlab.com/notramo/elvish.kak" defer elvish %{} demand
# Dependancy of connect.kak
# plug "alexherbo2/prelude.kak"
# plug "alexherbo2/connect.kak"
# plug "eraserhd/kak-ansi"
# plug "cipharius/restclient.kak" config %{
# hook global WinSetOption filetype=restclient %{
# map window user e %{: restclient-execute<ret>}
# }
# }
{ pkgs, ... }: {
home.packages = with pkgs; [
(kakoune.override {
configure = {
plugins = with kakounePlugins; [
kak-ansi
prelude-kak
connect-kak
];
};
})
lf # For filetree script
universal-ctags # For ctags integration
];
home.file = {
".config/kak/kakrc".source = ./kakrc;
".config/kak/scripts/lf.kak".source = ./lf.kak;
};
}
{-# LANGUAGE NamedFieldPuns #-}
import XMonad
import Graphics.X11.ExtraTypes.XF86
import qualified Data.Map as Map
import qualified XMonad.Actions.DynamicProjects as DProj
import qualified XMonad.Actions.DynamicWorkspaces as DWs
import qualified XMonad.Actions.Navigation2D as Nav2D
import qualified XMonad.Actions.Submap as SubM
import qualified XMonad.Actions.Warp as Warp
import qualified XMonad.Hooks.DynamicLog as DLog
import qualified XMonad.Hooks.EwmhDesktops as Ewmh
import qualified XMonad.Hooks.ManageDocks as MDock
import qualified XMonad.Layout.BinarySpacePartition as BSP
import qualified XMonad.Layout.Fullscreen as Full
import qualified XMonad.Layout.NoBorders as NoB
import qualified XMonad.Prompt as Prompt
import qualified XMonad.Prompt.FuzzyMatch as PFuzzy
import qualified XMonad.Prompt.Man as PMan
import qualified XMonad.Prompt.Shell as PShell
import qualified XMonad.Prompt.Window as PWin
import qualified XMonad.StackSet as WS
import qualified XMonad.Util.EZConfig as EZ
import qualified XMonad.Util.Scratchpad as Scratch
import qualified XMonad.Util.Types as Dir
-- / Entry point / --
main = myXmobar myConfig >>= xmonad
. DProj.dynamicProjects []
. Full.fullscreenSupport
. myNavigation
. Ewmh.ewmh
-- / XMonad config / --
myConfig = def
{ manageHook = myManageHook <+> manageHook def
, startupHook = return () >> EZ.checkKeymap myConfig myKeys
, layoutHook = myLayout
, terminal = myTerminal
, keys = (flip EZ.mkKeymap myKeys) <+> keys def
, modMask = mod4Mask -- Use Windows key as XMonad modifier
, handleEventHook = myHandleEventHook <+> handleEventHook def
}
myLayout
= MDock.avoidStruts
$ NoB.smartBorders
$ Full.fullscreenFull
$ BSP.emptyBSP
myTerminal = "kitty"
myBrowser = "qutebrowser"
myManageHook = Full.fullscreenManageHook <+> MDock.manageDocks <+> manageScratchpad
myHandleEventHook = Full.fullscreenEventHook
manageScratchpad = Scratch.scratchpadManageHook (WS.RationalRect 0 0.8 1 0.2)
myNavigation = Nav2D.navigation2D def
(xK_k, xK_h, xK_j, xK_l)
[ (mod4Mask, Nav2D.windowGo )
, (mod4Mask .|. shiftMask, Nav2D.windowSwap) ]
False
myXmobar = DLog.statusBar "xmobar" xmobarPP' toggleStrutsKey
where
toggleStrutsKey XConfig{modMask = modm} = (modm, xK_b)
xmobarPP' = def
{ DLog.ppCurrent = DLog.xmobarColor "#f0dfaf" "" . DLog.wrap "[" "]"
, DLog.ppVisible = DLog.wrap "(" ")"
, DLog.ppUrgent = DLog.xmobarColor "red" "yellow"
, DLog.ppSep = " | "
}
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
myPrompt :: Prompt.XPConfig
myPrompt = def
{ Prompt.font = "xft:DejaVu Sans Mono-11"
, Prompt.position = Prompt.Top
, Prompt.searchPredicate = PFuzzy.fuzzyMatch
, Prompt.sorter = PFuzzy.fuzzySort }
-- / Key bindings / --
myKeys = let leader = "M-<Space>" in
[ ("<Print>", spawn "screenshot")
, ("M-`", Scratch.scratchpadSpawnActionTerminal myTerminal)
, ("M-c", spawn "xclip -o | xclip -sel clip -i")
, ("M-;", sendMessage $ BSP.Swap)
, ("M-S-;", sendMessage $ BSP.Rotate)
, ("M-C-l", sendMessage $ BSP.MoveSplit Nav2D.R)
, ("M-C-h", sendMessage $ BSP.MoveSplit Nav2D.L)
, ("M-C-j", sendMessage $ BSP.MoveSplit Nav2D.D)
, ("M-C-k", sendMessage $ BSP.MoveSplit Nav2D.U)
, ("M-,", sendMessage $ BSP.SplitShift Dir.Prev)
, ("M-.", sendMessage $ BSP.SplitShift Dir.Next)
, ("M-o", sendMessage $ BSP.FocusParent)
, ("M-=", sendMessage $ BSP.Equalize)
, ("M-S-=", sendMessage $ BSP.Balance)
-- Media keys --
, ("<XF86MonBrightnessUp>", spawn "light -A 10")
, ("<XF86MonBrightnessDown>", spawn "light -U 10")
, ("<XF86AudioPlay>", spawn "playerctl play-pause")
, ("<XF86AudioPrev>", spawn "playerctl previous")
, ("<XF86AudioNext>", spawn "playerctl next")
, ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle")
, ("<XF86AudioMicMute>", spawn "pactl set-source-mute @DEFAULT_SOURCE@ toggle")
, ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%")
, ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%")
-- Leader map --
, ("M-<Space> <Space>", PShell.shellPrompt myPrompt)
, (leader<>" a b", spawn myBrowser)
, (leader<>" a t", spawn myTerminal)
, (leader<>" a e", spawn $ myTerminal <> " kak")
, (leader<>" a m", spawn "spotify")
, (leader<>" a s", spawn $ myTerminal <> " smos")
, (leader<>" l l", DWs.selectWorkspace myPrompt)
, (leader<>" l L", DWs.addWorkspacePrompt myPrompt)
, (leader<>" l r", DWs.renameWorkspace myPrompt)
, (leader<>" l d", DWs.removeWorkspace)
, (leader<>" w w", PWin.windowPrompt myPrompt PWin.Goto PWin.allWindows)
, (leader<>" w S-w", PWin.windowPrompt myPrompt PWin.Bring PWin.allWindows)
, (leader<>" w s", DWs.withWorkspace myPrompt (windows . WS.shift))
, (leader<>" w p", DProj.shiftToProjectPrompt myPrompt)
, (leader<>" m b", Warp.banishScreen Warp.LowerRight)
, (leader<>" m m", Warp.warpToWindow 0.5 0.5)
, (leader<>" p p", DProj.switchProjectPrompt myPrompt)
, (leader<>" p r", DProj.renameProjectPrompt myPrompt)
, (leader<>" p d", DProj.changeProjectDirPrompt myPrompt)
, (leader<>" h m", PMan.manPrompt myPrompt)
]
{ pkgs, ... }: {
xsession = {
enable = true;
scriptPath = ".hm-xsession";
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
};
home = {
packages = with pkgs; [
kitty
libnotify
playerctl
acpi
maim
];
file = {
".xmonad/xmonad.hs".source = ./xmonad.hs;
};
};
# Notifications daemon
services.dunst = {
enable = true;
settings = {
global = {
follow = "keyboard";
geometry = "300x8-0+20";
indicate_hidden = true;
shrink = false;
notification_height = 50;
separator_height = 1;
padding = 8;
horizontal_padding = 8;
frame_width = 1;
frame_color = "#dcdccc";
seperator_color = "frame";
idle_threshold = 120;
font = "DejaVu Sans Mono 8";
line_height = 0;
};
urgency_low = {
background = "#707280";
foreground = "#dcdccc";
timeout = 10;
};
urgency_normal = {
background = "#506070";
foreground = "#ffffff";
timeout = 10;
};
urgency_critical = {
background = "#cc9393";
foreground = "#ffffff";
timeout = 0;
};
};
};
}
{ nixosConfig, ... }:
let
inherit (builtins) attrNames filter readDir match concatStringsSep;
wlanifs = filter
(str: (match "wl\.+" str) != null)
(attrNames nixosConfig.networking.interfaces);
wirelessConfigs = concatStringsSep "\n"
(map
(ifname:
''
, Run Wireless "${ifname}"
[ "-p","3"
, "-t","<fc=#f0dfaf>Wlan:</fc> <essid>[<quality>%]"
] 10
''
)
wlanifs);
wirelessComps = concatStringsSep " | " (map (ifname: "%${ifname}wi%") wlanifs);
in
''
Config
{ font = "xft:DejaVu Sans Mono:size=11:bold:antialias=true"
, bgColor = "#3f3f3f"
, fgColor = "#dcdccc"
, position = TopW L 100
, lowerOnStart = True
, commands =
[ Run Date "%a %b %_d %H:%M" "date" 10
, Run BatteryN ["BAT0"]
[ "-p","3"
, "-t","<fc=#f0dfaf>Batt:</fc> <left>%"
] 10 "battery"
${wirelessConfigs}
, Run StdinReader
, Run Com "sh" ["-c", "cat \"$HOME/CURRENT_TASK\""] "currentTask" 50
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% } <fc=#dfaf8f>%currentTask%</fc> { ${wirelessComps} | %battery% <fc=#dfaf8f>%date%</fc>"
}
''
{ nixosConfig, pkgs, ... }: {
home.packages = with pkgs; [ xmobar ];
home.file = {
".xmobarrc".text = import ./xmobarrc.nix { inherit nixosConfig; };
};
}
{ pkgs, ... }: {
home.packages = with pkgs; [ qutebrowser ];
home.file = {
".config/qutebrowser/config.py".source = ./config.py;
};
}
c.aliases = {}
c.tabs.tabs_are_windows = True
c.tabs.show = "multiple"
c.downloads.location.directory = "~/downloads"
c.content.pdfjs = True
c.editor.command = ["kitty", "kak", "{}"]
config.load_autoconfig()
scrollback_lines 100000
enable_audio_bell no
window_alert_on_bell no
close_on_child_death yes
font_family FiraCode-Regular
bold_font FiraCode-Bold
font_size 11
font_features FiraCode-Regular +zero +ss01 +ss03 +ss04 +ss05 +ss08
font_features FiraCode-Bold +zero +ss01 +ss03 +ss04 +ss05 +ss08
disable_ligatures cursor
shell bash
clear_all_shortcuts yes
map ctrl+shift+c copy_to_clipboard
map ctrl+shift+v paste_from_clipboard
map ctrl+shift+l show_scrollback
map ctrl+shift+u scroll_page_up
map ctrl+shift+d scroll_page_down
map ctrl+shift+k scroll_line_up
map ctrl+shift+j scroll_line_down
map ctrl+shift+o kitten hints
map ctrl+shift+p kitten hints --type path --program -
map ctrl+shift+h kitten hints --type hash --program -
map ctrl+shift+equal change_font_size all +2.0
map ctrl+shift+minus change_font_size all -2.0
map ctrl+shift+0 change_font_size all 0
color0 #3f3f3f
color1 #cc9393
color2 #60b48a
color3 #dfaf8f
color4 #506070
color5 #dc8cc3
color6 #8cd0d3
color7 #dcdccc
color8 #707280
color9 #dca3a3
color10 #c3bf9f
color11 #f0dfaf
color12 #94bff3
color13 #ec93d3
color14 #93e0e3
color15 #ffffff
background #3f3f3f
foreground #dcdccc
{ pkgs, ... }: {
home.packages = with pkgs; [ kitty ];
home.file = {
".config/kitty/kitty.conf".source = ./kitty.conf;
};
}
{ pkgs, ... }: {
home.packages = with pkgs; [ godot ];
}
{
imports = [
./xmobar
./xmonad
./kitty
./qutebrowser
];
}
{
programs.git = {
enable = true;
extraConfig = {
pull.rebase = false;
};
aliases = {
a = "add -p";
co = "checkout";
cob = "checkout -b";
f = "fetch -p";
c = "commit";
p = "push";
ba = "branch -a";
bd = "branch -d";
bD = "branch -D";
d = "diff";
dc = "diff --cached";
ds = "diff --staged";
r = "restore";
rs = "restore --staged";
st = "status -sb";
# reset
soft = "reset --soft";
hard = "reset --hard";
s1ft = "soft HEAD~1";
h1rd = "hard HEAD~1";
# logging
lg =
"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
plog =
"log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'";
tlog =
"log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative";
rank = "shortlog -sn --no-merges";
# delete merged branches
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
};
};
}
function fish_prompt
# - green lines if the last return command is OK, red otherwise
# - your user name, in red if root or yellow otherwise
# - your hostname, in cyan if ssh or blue otherwise
# - the current path (with prompt_pwd)
# - date +%X
# - the current virtual environment, if any
# - the current git status, if any, with __fish_git_prompt
# - the current battery state, if any, and if your power cable is unplugged, and if you have "acpi"
# - current background jobs, if any
# It goes from:
# ┬─[nim@Hattori:~]─[11:39:00]
# ╰─>$ echo here
# To:
# ┬─[nim@Hattori:~/w/dashboard]─[11:37:14]─[V:django20]─[G:master↑1|●1✚1…1]─[B:85%, 05:41:42 remaining]
# │ 2 15054 0% arrêtée sleep 100000
# │ 1 15048 0% arrêtée sleep 100000
# ╰─>$ echo there
set -q __fish_git_prompt_showupstream
or set -g __fish_git_prompt_showupstream auto
function _nim_prompt_wrapper
set retc $argv[1]
set field_name $argv[2]
set field_value $argv[3]
set_color normal
set_color $retc
echo -n '─'
set_color -o green
echo -n '['
set_color normal
test -n $field_name
and echo -n $field_name:
set_color $retc
echo -n $field_value
set_color -o green
echo -n ']'
end
and set retc green
or set retc red
set_color $retc
echo -n '┬─'
set_color -o green
echo -n [
if test "$USER" = root -o "$USER" = toor
set_color -o red
else
set_color -o yellow
end
echo -n $USER
set_color -o white
echo -n @
if [ -z "$SSH_CLIENT" ]
set_color -o blue
else
set_color -o cyan
end
echo -n (prompt_hostname)
set_color -o white
echo -n :(prompt_pwd)
set_color -o green
echo -n ']'
# Date
_nim_prompt_wrapper $retc '' (date +%X)
# Virtual Environment
set -q VIRTUAL_ENV
and _nim_prompt_wrapper $retc V (basename "$VIRTUAL_ENV")
# git
set prompt_git (__fish_git_prompt | string trim -c ' ()')
test -n "$prompt_git"
and _nim_prompt_wrapper $retc G $prompt_git
# Battery status
type -q acpi
and test (acpi -a 2> /dev/null | string match -r off)
and _nim_prompt_wrapper $retc B (acpi -b | cut -d' ' -f 4-)
# New line
echo
# Background jobs
set_color normal
for job in (jobs)
set_color $retc
echo -n '│ '
set_color brown
echo $job
end
set_color normal
set_color $retc
echo -n '╰─>'
set_color -o red
echo -n '$ '
set_color normal
end
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d
SETUVAR __fish_init_3_x:\x1d
SETUVAR __fish_initialized:3100
SETUVAR fish_color_autosuggestion:BD93F9
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:F8F8F2
SETUVAR fish_color_comment:6272A4
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:50FA7B
SETUVAR fish_color_error:FFB86C
SETUVAR fish_color_escape:00a6b2
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:FF79C6
SETUVAR fish_color_quote:F1FA8C
SETUVAR fish_color_redirection:8BE9FD
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_greeting:\x1d
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
{ pkgs, ... }: {
home.packages = with pkgs; [ fish ];
home.file = {
".config/fish/fish_variables".source = ./fish_variables;
".config/fish/functions/fish_prompt.fish".source = ./functions/fish_prompt.fish;
".config/fish/conf.d/environment.fish".source = ./conf.d/environment.fish;
};
}
set EDITOR 'kak'
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}
.git
.DS_Store