misc: Add everything

This commit is contained in:
PapaTutuWawa 2021-07-29 22:21:51 +02:00
parent 8d3efe0058
commit 226c8bb781
41 changed files with 10140 additions and 0 deletions

100
ayame.nix Normal file
View File

@ -0,0 +1,100 @@
{ config, pkgs, modulesPath, lib, ... }:
let
customPkgs = import ./packages/overlay.nix;
unstable = (import ./modules/unstable.nix config);
in {
imports = [
./generic.nix
./modules/hardware/generic.nix ./modules/hardware/bluetooth.nix ./modules/hardware/wifi.nix ./modules/hardware/video.nix ./modules/hardware/mobile.nix
./modules/fonts.nix
./modules/users/alexander.nix
./modules/programs/zsh ./modules/programs/mpv ./modules/programs/tmux ./modules/programs/firefox ./modules/programs/gnome-terminal ./modules/programs/gnome ./modules/programs/nonvm
];
nixpkgs.overlays = [
customPkgs
];
nixpkgs.config.packageOverrides = pkgs: {
nur = (import ./modules/nur.nix pkgs);
unstable = unstable;
};
environment = {
systemPackages = with pkgs; [
unstable.firmwareLinuxNonfree
sof-firmware
];
};
# Disable dhcpcd as NetworkManager will do it for us
networking = {
interfaces.wlan0.useDHCP = false;
hostName = "ayame";
};
boot = {
loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiInstallAsRemovable = true;
device = "nodev";
efiSupport = true;
# The UEFI is pretty wonky
forcei686 = true;
};
};
extraModprobeConfig = "";
initrd = {
availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_acpi" ];
kernelModules = [
"kvm-intel" "i915"
];
};
# This spams the console and takes up so much CPU time
kernelParams = [ "modprobe.blacklist=arizona_spi" ];
kernelModules = [];
extraModulePackages = [];
kernelPackages = pkgs.linuxPackages_zen;
};
hardware = {
opengl = {
extraPackages = with pkgs; [ vaapiIntel intel-media-driver ];
};
};
services = {
xserver.videoDrivers = [ "modesetting" "fbdev" ];
};
systemd.services = {
rfkill-workaround = {
enable = true;
description = "Work around rfkill having the Wifi blocked at boot";
before = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "rfkill unblock all";
};
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/root";
fsType = "btrfs";
};
"/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
};
swapDevices = [
# TODO: Replace by UUID
{ device = "/dev/disk/by-label/swap"; }
];
}

76
generic.nix Normal file
View File

@ -0,0 +1,76 @@
{ config, lib, pkgs, python3Packages, ... }:
let
home-manager = builtins.fetchGit {
url = "https://github.com/nix-community/home-manager.git";
rev = "35a24648d155843a4d162de98c17b1afd5db51e4";
ref = "release-21.05";
};
in
{
# Install home-manager
imports = [
"${home-manager}/nixos"
];
home-manager.useGlobalPkgs = true;
time.timeZone = "Europe/Berlin";
networking = {
useDHCP = false; # Done by the network manager
networkmanager.enable = false;
};
i18n.defaultLocale = "en_GB.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "de";
};
users = {
mutableUsers = false;
extraUsers = {
root = {
# Disable root login
hashedPassword = "*";
};
# Users configured in vm.nix, nishimiya.nix or miku.nix
};
};
environment = {
systemPackages = with pkgs; [
htop
firejail
vim
git # Otherwise we cannot install home-manager
git-crypt
gnupg
python3
];
};
# We don't tolerate non-free software, except for Steam and Linux firmware
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "firmwareLinuxNonfree" ];
services = {
connman = {
enable = true;
extraFlags = [ "--nodnsproxy" ];
};
# TODO: Is this correct? Maybe run once
timesyncd.enable = false;
printing.enable = lib.mkDefault false;
avahi.enable = false;
};
security.sudo.extraConfig = ''
Defaults env_keep += "NIXOS_CONFIG"
'';
system.stateVersion = "21.05";
}

160
miku.nix Normal file
View File

@ -0,0 +1,160 @@
{ config, pkgs, modulesPath, lib, ... }:
let
unstable = (import ./modules/unstable.nix config);
customPkgs = import ./packages/overlay.nix;
gamemode = pkgs.callPackage ./packages/gamemode {};
in {
imports = [
./generic.nix
./modules/hardware/generic.nix ./modules/hardware/video.nix
./modules/fonts.nix
./modules/users/alexander.nix
./modules/programs/zsh ./modules/programs/git ./modules/programs/mpv ./modules/programs/tmux ./modules/programs/emacs ./modules/programs/firefox ./modules/programs/gnome-terminal ./modules/programs/gnome ./modules/programs/nonvm
./modules/programs/distributed-build/builder.nix
#./modules/programs/music
];
nixpkgs.overlays = [
(import (builtins.fetchGit {
url = "https://github.com/nix-community/emacs-overlay.git";
ref = "master";
rev = "ce0e9482d53d69bedc8416d8a984d00e17607826";
}))
customPkgs
];
nixpkgs.config.packageOverrides = pkgs: {
nur = (import ./modules/nur.nix pkgs);
unstable = unstable;
};
environment = {
systemPackages = with pkgs; [
emacsPgtkGcc
unstable.firmwareLinuxNonfree
gajim
libvirt virt-manager qemu
gamemode # Custom package
key-mapper # Custom package
scream
linuxPackages_zen.vendor-reset
];
sessionVariables = {
# Prevent us from having to always type it out
#NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/miku.nix";
};
};
networking = {
interfaces.enp6s0.useDHCP = false;
hostName = "miku";
# Nix otherwise has a conflict with this option
wireless.enable = lib.mkForce false;
};
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
extraModprobeConfig = ''
options kvm_amd nested=1
options vfio-pci ids=1002:67df,1002:aaf0
'';
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "amdgpu" "vendor-reset" ];
kernelModules = [
"amdgpu" # GPU (duh)
"kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" # Virt
"uinput" # key-mapper
"vendor-reset"
];
};
kernelParams = [
"amd_iommu=on"
"iommu=pt"
"sysrq_always_enabled=1"
"kvm.ignore_msrs=1"
"kvm.report_ignored_msrs=N"
"fbcon=rotate:1"
"quiet"
];
kernelModules = [];
extraModulePackages = [ pkgs.linuxPackages_zen.vendor-reset ];
kernelPackages = pkgs.linuxPackages_zen;
};
services = {
# NOTE: key-mapper has a dbus policy file that we need to include
dbus.packages = [ pkgs.key-mapper ];
emacs.package = pkgs.emacsPgtkGcc;
flatpak.enable = true;
xserver.videoDrivers = [ "amdgpu" ];
udev.extraRules = ''
KERNEL=="uinput", GROUP="input"
'';
sshd.enable = true;
};
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
qemuRunAsRoot = false;
qemuVerbatimConfig = ''
user = "alexander"
cgroup_device_acl = [
"/dev/null", "/dev/zero", "/dev/full",
"/dev/random", "/dev/kvm", "/dev/kqemu",
"/dev/rtc", "/dev/hpet", "dev/ptmx",
"/dev/input/by-id/usb-Logitech_G700s_Rechargeable_Gaming_Mouse_93DF48160007-event-mouse",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-event-kbd",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-if01-event-kbd",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-if02-event-mouse",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-event-if01"
]
'';
};
systemd = {
services.NetworkManager-wait-online.enable = false;
user.services = {
scream = {
enable = false; # Started by the passthrough script
description = "Audio receiver for the Scream virtual network sound card";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
RestartAlways = "always";
};
};
gamemode = {
enable = true;
description = "A daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS.";
serviceConfig = {
Type = "simple";
ExecStart = "${gamemode}/bin/gamemoded";
Restart = "always";
};
};
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/root";
fsType = "btrfs";
};
"/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
"/mnt/Storage" = {
device = "/dev/disk/by-label/storage";
fsType = "ext4";
};
};
swapDevices = [ ];
}

8
modules/fonts.nix Normal file
View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# CJK fonts
source-han-sans source-han-serif
];
}

View File

@ -0,0 +1,5 @@
{ ... }:
{
hardware.bluetooth.enable = true;
}

View File

@ -0,0 +1,37 @@
{ lib, pkgs, ... }:
{
# NOTE: This assumes that the devices are x86_64 (cough i686 UEFI cough)
hardware = {
enableRedistributableFirmware = true;
# This is a Pipewire household!
pulseaudio.enable = false;
opengl = {
enable = true;
driSupport32Bit = true;
driSupport = true;
extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ];
};
# Only a subset of my devices have bluetooth
#bluetooth.enable = lib.mkDefault false;
};
services = {
# Everyone needs sound
pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
# On desktop: Monitor keyboards, mice, ...
# On portable devices: Monitor their battery
upower.enable = true;
# What generated entropy?
haveged.enable = true;
};
}

View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
# Special options for mobile devices
{
# Battery savings
services.tlp.enable = true;
# TODO: Maybe move this out of here
environment.systemPackages = [ pkgs.iio-sensor-proxy ];
}

View File

@ -0,0 +1,7 @@
{ config, ... }:
let
unstable = (import ../unstable.nix config);
in {
environment.systemPackages = [ unstable.mesa ];
}

BIN
modules/hardware/wifi.nix Normal file

Binary file not shown.

9
modules/network.nix Normal file
View File

@ -0,0 +1,9 @@
rec {
network-base = "192.168.178";
# A collection of IP addresses for various uses
miku = "${network-base}.38";
nishimiya = "${network-base}.21";
ayame = "${network-base}.35"; # TODO: That one's wrong
tamaki = "${network-base}.27";
}

8
modules/nur.nix Normal file
View File

@ -0,0 +1,8 @@
pkgs:
import (builtins.fetchTarball {
url = "https://github.com/nix-community/NUR/archive/master.tar.gz";
sha256 = "1p0qa9bs8k0jhkdkyvxfcpi2hz2n8d61c63ps7mavk9z3zgnx20j";
}) {
inherit pkgs;
}

View File

@ -0,0 +1,590 @@
{ pkgs, lib, config, ... }:
{
options.services.alacritty = {
fontSize = lib.mkOption {
type = lib.types.float;
default = 12.0;
};
};
config.environment.systemPackages = [ pkgs.alacritty ];
config.home-manager.users.alexander.programs = {
alacritty = {
enable = true;
settings = {
window = {
dimensions = {
columns = 0;
lines = 0;
};
padding = {
x = 2;
y = 2;
};
dynamic_padding = false;
dynamic_title = true;
decorations = "full";
startup_mode = "Windowed";
};
scrolling = {
history = 10000;
multiplier = 3;
};
font = {
size = config.services.alacritty.fontSize;
offset = {
x = 0;
y = 0;
};
glyph_offset = {
x = 0;
y = 0;
};
use_thin_strokes = true;
};
debug = {
render_timer = false;
persistent_logging = false;
};
draw_bold_text_with_bright_colors = true;
colors = {
primary = {
background = "0x1e282d";
foreground = "0xc4c7d1";
};
normal = {
black = "0x666666";
red = "0xeb606b";
green = "0xc3e88d";
yellow = "0xf7eb95";
blue = "0x80cbc4";
magenta = "0xff2f90";
cyan = "0xaeddff";
white = "0xffffff";
};
bright = {
black = "0xff262b";
red = "0xeb606b";
green = "0xc3e88d";
yellow = "0xf7eb95";
blue = "0x7dc6bf";
magenta = "0x6c71c4";
cyan = "0x35434d";
white = "0xffffff";
};
};
background_opacity = 0.7;
mouse_bindings = [ {
mouse = "Middle";
action = "PasteSelection";
} ];
mouse = {
double_click = {
threshold = 300;
};
triple_click = {
threshold = 300;
};
hide_when_typing = false;
};
selection = {
semantic_scape_chars = ",`|:\"' ()[]{}<>";
save_to_clipboard = true;
};
cursor = {
style = "Block";
unfocused_hollow = true;
};
live_config_reload = true;
enable_experimental_conpty_backend = false;
alt_send_esc = true;
key_bindings = [
{
key = "Paste";
action = "Paste";
}
{
key = "Copy";
action = "Copy";
}
{
key = "L";
mods = "Control";
action = "ClearLogNotice";
}
{
key = "L";
mods = "Control";
chars = "\\x0c";
}
{
key = "Home";
chars = "\\x1bOH";
mode = "AppCursor";
}
{
key = "Home";
chars = "\\x1b[H";
mode = "~AppCursor";
}
{
key = "End";
chars = "\\x1bOF";
mode = "AppCursor";
}
{
key = "End";
chars = "\\x1b[F";
mode = "~AppCursor";
}
{
key = "PageUp";
mods = "Shift";
action = "ScrollPageUp";
mode = "~Alt";
}
{
key = "PageUp";
mods = "Shift";
chars = "\\x1b[5;2~";
mode = "Alt";
}
{
key = "PageDown";
mods = "Control";
chars = "\\x1b[6;5~";
}
{
key = "PageDown";
chars = "\\x1b[6~";
}
{
key = "Tab";
mods = "Shift";
chars = "\\x1b[Z";
}
{
key = "Back";
chars= "\\x7f";
}
{
key = "Back";
mods = "Alt";
chars = "\\x1b\\x7f";
}
{
key = "Insert";
chars = "\\x1b[2~";
}
{
key = "Delete";
chars = "\\x1b[3~";
}
{
key = "Left";
mods = "Shift";
chars = "\\x1b[1;2D";
}
{
key = "Left";
mods = "Control";
chars = "\\x1b[1;5D";
}
{
key = "Left";
mods = "Alt";
chars = "\\x1b[1;3D";
}
{
key = "Left";
chars = "\\x1b[D";
mode = "~AppCursor";
}
{
key = "Left";
chars = "\\x1bOD";
mode = "AppCursor";
}
{
key = "Right";
mods = "Shift";
chars = "\\x1b[1;2C";
}
{
key = "Right";
mods = "Control";
chars = "\\x1b[1;5C";
}
{
key = "Right";
mods = "Alt";
chars = "\\x1b[1;3C";
}
{
key = "Right";
chars = "\\x1b[C";
mode = "~AppCursor";
}
{
key = "Right";
chars = "\\x1bOC";
mode = "AppCursor";
}
{
key = "Up";
mods = "Shift";
chars = "\\x1b[1;2A";
}
{
key = "Up";
mods = "Control";
chars = "\\x1b[1;5A";
}
{
key = "Up";
mods = "Alt";
chars = "\\x1b[1;3A";
}
{
key = "Up";
chars = "\\x1b[A";
mode = "~AppCursor";
}
{
key = "Up";
chars = "\\x1bOA";
mode = "AppCursor";
}
{
key = "Down";
mods = "Shift";
chars = "\\x1b[1;2B";
}
{
key = "Down";
mods = "Control";
chars = "\\x1b[1;5B";
}
{
key = "Down";
mods = "Alt";
chars = "\\x1b[1;3B";
}
{
key = "Down";
chars = "\\x1b[B";
mode = "~AppCursor";
}
{
key = "Down";
chars = "\\x1bOB";
mode = "AppCursor";
}
{
key = "F1";
chars = "\\x1bOP";
}
{
key = "F2";
chars = "\\x1bOQ";
}
{
key = "F3";
chars = "\\x1bOR";
}
{
key = "F4";
chars = "\\x1bOS";
}
{
key = "F5";
chars = "\\x1b[15~";
}
{
key = "F6";
chars = "\\x1b[17~";
}
{
key = "F7";
chars = "\\x1b[18~";
}
{
key = "F8";
chars = "\\x1b[19~";
}
{
key = "F9";
chars = "\\x1b[20~";
}
{
key = "F10";
chars = "\\x1b[21~";
}
{
key = "F11";
chars = "\\x1b[23~";
}
{
key = "F12";
chars = "\\x1b[24~";
}
{
key = "F1";
mods = "Shift";
chars = "\\x1b[1;2P";
}
{
key = "F2";
mods = "Shift";
chars = "\\x1b[1;2Q";
}
{
key = "F3";
mods = "Shift";
chars = "\\x1b[1;2R";
}
{
key = "F4";
mods = "Shift";
chars = "\\x1b[1;2S";
}
{
key = "F5";
mods = "Shift";
chars = "\\x1b[15;2~";
}
{
key = "F6";
mods = "Shift";
chars = "\\x1b[17;2~";
}
{
key = "F7";
mods = "Shift";
chars = "\\x1b[18;2~";
}
{
key = "F8";
mods = "Shift";
chars = "\\x1b[19;2~";
}
{
key = "F9";
mods = "Shift";
chars = "\\x1b[20;2~";
}
{
key = "F10";
mods = "Shift";
chars = "\\x1b[21;2~";
}
{
key = "F11";
mods = "Shift";
chars = "\\x1b[23;2~";
}
{
key = "F12";
mods = "Shift";
chars = "\\x1b[24;2~";
}
{
key = "F1";
mods = "Control";
chars = "\\x1b[1;5P";
}
{
key = "F2";
mods = "Control";
chars = "\\x1b[1;5Q";
}
{
key = "F3";
mods = "Control";
chars = "\\x1b[1;5R";
}
{
key = "F4";
mods = "Control";
chars = "\\x1b[1;5S";
}
{
key = "F5";
mods = "Control";
chars = "\\x1b[15;5~";
}
{
key = "F6";
mods = "Control";
chars = "\\x1b[17;5~";
}
{
key = "F7";
mods = "Control";
chars = "\\x1b[18;5~";
}
{
key = "F8";
mods = "Control";
chars = "\\x1b[19;5~";
}
{
key = "F9";
mods = "Control";
chars = "\\x1b[20;5~";
}
{
key = "F10";
mods = "Control";
chars = "\\x1b[21;5~";
}
{
key = "F11";
mods = "Control";
chars = "\\x1b[23;5~";
}
{
key = "F12";
mods = "Control";
chars = "\\x1b[24;5~";
}
{
key = "F1";
mods = "Alt";
chars = "\\x1b[1;6P";
}
{
key = "F2";
mods = "Alt";
chars = "\\x1b[1;6Q";
}
{
key = "F3";
mods = "Alt";
chars = "\\x1b[1;6R";
}
{
key = "F4";
mods = "Alt";
chars = "\\x1b[1;6S";
}
{
key = "F5";
mods = "Alt";
chars = "\\x1b[15;6~";
}
{
key = "F6";
mods = "Alt";
chars = "\\x1b[17;6~";
}
{
key = "F7";
mods = "Alt";
chars = "\\x1b[18;6~";
}
{
key = "F8";
mods = "Alt";
chars = "\\x1b[19;6~";
}
{
key = "F9";
mods = "Alt";
chars = "\\x1b[20;6~";
}
{
key = "F10";
mods = "Alt";
chars = "\\x1b[21;6~";
}
{
key = "F11";
mods = "Alt";
chars = "\\x1b[23;6~";
}
{
key = "F12";
mods = "Alt";
chars = "\\x1b[24;6~";
}
{
key = "F1";
mods = "Super";
chars = "\\x1b[1;3P";
}
{
key = "F2";
mods = "Super";
chars = "\\x1b[1;3Q";
}
{
key = "F3";
mods = "Super";
chars = "\\x1b[1;3R";
}
{
key = "F4";
mods = "Super";
chars = "\\x1b[1;3S";
}
{
key = "F5";
mods = "Super";
chars = "\\x1b[15;3~";
}
{
key = "F6";
mods = "Super";
chars = "\\x1b[17;3~";
}
{
key = "F7";
mods = "Super";
chars = "\\x1b[18;3~";
}
{
key = "F8";
mods = "Super";
chars = "\\x1b[19;3~";
}
{
key = "F9";
mods = "Super";
chars = "\\x1b[20;3~";
}
{
key = "F10";
mods = "Super";
chars = "\\x1b[21;3~";
}
{
key = "F11";
mods = "Super";
chars = "\\x1b[23;3~";
}
{
key = "F12";
mods = "Super";
chars = "\\x1b[24;3~";
}
{
key = "NumpadEnter";
chars = "\\n";
}
];
};
};
};
}

View File

@ -0,0 +1,17 @@
{ pkgs, ... }:
{
boot.binfmt.emulatedSystems = [ "i686-linux" ]; # For remote building
environment.systemPackages = with pkgs; [ openssh ];
nix.trustedUsers = ["builder"];
# TODO: Specify a firewall rule to only allow this from my other NixOS machines
users.extraUsers."builder" = {
isSystemUser = true;
useDefaultShell = true;
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDN8tV/VbCwd5QVoJX+0n3hOCCRhIINZEhyMSrhOishQpDR2H/gtnIuTTYKtNbkxfICFXwxDKmAJv8ThijCBmRZMQHl/Zo4D/ArqbZYSSoEmXpEWMCYnyh6QJ/bE8MLSWJXszla2NmC87/YUJzmGbuk+vaVSwtFhNoS0aZv1KVkcspgX6E488tEM/rXItrSkGE2x0lnzJCDYu2s5r5Ij1b/qorSijT0xLDSWMLEGIPyFSx4L7xtzvWsyh0mGuPnwqSWLc8tVOO6nO6slAs/mDYwZ1JXBV+hCvAm8EVwE0M16WR8ZRg+3XRNieJhkLSOjoFmzB/A1S17h3UPC+jPYWtM6UwMO6679HkoZNzGaAFemVHEpLjZpG8wIrZ2GL+s5g3WJVa7wCI77j8zlfGif2RevmZx4r8f+t36j9EsCPY9Z90Fg/l81Dv6xl/+7R/RUzXN0zXTsk11Dvrz1mvwGKHmOfEZAdiSP4pAWuT8ZgxbsYjCAGTo+7t5OSWBxwPeypSSkKLYMaChkudX3xOTVVlJ3zuRmN5FCdcA3B7hpKt+au7U7Ou0xUtWdc4ICnyXowOCGjZmLfdePR1Mx+/r6aQq7lh0BhT1aVlaHStJseMvDOkz3FRSke94BexHXgSRJ0rI0J6A29JiW+3kuAsdPJcgMHLqT9l0/TKk0x0YHyJd+Q== alexander@mikulinux
"
];
};
}

View File

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
nix = {
distributedBuilds = true;
buildMachines = [{
hostName = "mikulinux";
systems = [ "x86_64-linux" "i686-linux" ];
maxJobs = 4;
speedFactor = 2;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
}];
};
programs.ssh.extraConfig = ''
Host mikulinux
HostName 192.168.178.38
User builder
IdentitiesOnly yes
IdentityFile /root/.ssh/id_builder
'';
}

View File

@ -0,0 +1,9 @@
{ ... }:
{
home-manager.users.alexander.home.file = {
".emacs".source = ./dotemacs;
".emacs.d/early-init.el".source = ./early-init.el;
".emacs.d/mu4e.el".source = ./mu4e.el;
};
}

View File

@ -0,0 +1,276 @@
(defconst dd/using-native-comp-p (fboundp 'native-comp-available-p))
(when dd/using-native-comp-p
(setq comp-async-query-on-exit t)
(setq comp-async-jobs-number 8)
(setq comp-async-report-warnings-errors nil)
(setq comp-deferred-compilation t))
(setq redisplay-dont-pause t)
(setq jit-lock-defer-time 0)
(setq fast-but-imprecise-scrolling t)
(setq make-backup-files nil)
(setq create-lockfiles nil)
;; A trick for faster startup is to just disable GC for the init phase
;;; See: https://github.com/nilcons/emacs-use-package-fast#a-trick-less-gc-during-startup
(setq gc-cons-threshold 64000000)
(add-hook 'after-init-hook #'(lambda ()
;; restore after startup
(setq gc-cons-threshold 800000)))
(defun http-download-verify-and-exec (url sha256-hash name func)
(let ((actual-hash ""))
(with-temp-buffer
;; Somewhat not documented function. Based on https://emacs.stackexchange.com/a/38482
;; The problem is that url-retrieve-synchronously prints the HTTP headers at
;; the top, which are, since they include time, non-deterministic and thus cannot
;; be used for hashing.
(url-insert-file-contents url)
(setq actual-hash (secure-hash 'sha256 (current-buffer)))
(unless (string= sha256-hash actual-hash)
(error "Unexpected hash for %s: Got %s, expected %s" name actual-hash sha256-hash))
func)))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5)
(install-hash ""))
(unless (file-exists-p bootstrap-file)
(http-download-verify-and-exec
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
"5bbeee903a90a0fda88a6b8516697c121400facb36a2c349e9447a53baef154e"
"straight's install.el"
(lambda ()
(goto-char (point-max))
(eval-print-last-sexp))))
(load bootstrap-file nil 'nomessage))
(setq straight-use-package-by-default t)
(straight-use-package 'use-package)
; Visual things
(defvar emacs-font "SourceCodePro:style=Light-7")
(add-to-list 'default-frame-alist `(font . ,emacs-font))
(set-face-attribute 'default t :height 150 :font emacs-font)
(tool-bar-mode -1)
(menu-bar-mode -1)
(toggle-scroll-bar -1)
(setq inhibit-startup-screen t)
;; We cannot exactly use use-package, so we just download it "manually".
(let* ((theme-dir (expand-file-name "themes" user-emacs-directory))
(theme-file (expand-file-name "weyland-yutani-theme.el" theme-dir)))
(unless (file-exists-p theme-file)
(unless (file-exists-p theme-dir)
(make-directory theme-dir))
(http-download-verify-and-exec
"https://raw.githubusercontent.com/jstaursky/weyland-yutani-theme/246410e1c03f7d8d8e76102f7c5e3cda83acb36b/weyland-yutani-theme.el"
"6593a0a7e46710e25f9b9caf9888106c93230bd20f9af87c5fc883a98b187253"
"weyland-yutani-theme.el"
(lambda ()
(write-file theme-file))))
(add-to-list 'custom-theme-load-path theme-dir)
(load-theme 'weyland-yutani t))
(use-package rainbow-delimiters
:straight t
:config
(add-hook 'prog-mode-hook
#'rainbow-delimiters-mode))
(use-package hl-todo
:straight t
:config
(add-hook 'prog-mode-hook
#'hl-todo-mode))
(global-hl-line-mode 1)
(use-package nlinum
:straight t
:config
(add-hook 'prog-mode-hook
(lambda ()
(nlinum-mode 1))))
(add-hook 'prog-mode-hook
(lambda ()
(show-paren-mode 1)
(setq show-parens-delay 0)))
(use-package ivy
:straight t
:config
(defvar ivy-use-virtual-buffers t)
(ivy-mode 1))
(setq enable-recursive-minibuffers t)
; This function allows us to exit EVIL states with C-c
; (https://www.emacswiki.org/emacs/Evil#toc16)
(defun escape (prompt)
(cond ((or (evil-insert-state-p) (evil-normal-state-p) (evil-replace-state-p) (evil-visual-state-p)) [escape])
(t (kbd "C-g"))))
(use-package evil
:init
(setq evil-want-keybinding nil)
:config
(define-key key-translation-map (kbd "C-c") 'escape)
(evil-mode 1))
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
; Vim-like buffer navigation
(global-set-key (kbd "C-h") 'windmove-left)
(global-set-key (kbd "C-l") 'windmove-right)
(global-set-key (kbd "C-k") 'windmove-up)
(global-set-key (kbd "C-j") 'windmove-down)
(use-package rainbow-delimiters
:config
(add-hook 'prog-mode-hook
#'rainbow-delimiters-mode))
(use-package highlight-parentheses
:straight t
:config
(highlight-parentheses-mode))
(use-package smartparens
:straight t
:config
(smartparens-global-mode t))
(use-package undo-tree
:straight t
:config
(global-undo-tree-mode))
(use-package hl-todo
:config
(add-hook 'prog-mode-hook
#'hl-todo-mode))
(global-hl-line-mode 1)
(setq-default indent-tab-mode t)
(setq tab-width 4)
(use-package perspective
:bind
("C-x C-b" . (lambda (arg)
(interactive "P")
(if (fboundp 'persp-bs-show)
(persp-bs-show arg)
(bs-show "all"))))
:config
(message "Persp-mode")
(persp-mode))
;; mu4e config
(unless (string= (system-name) "miku")
; I don't need mu4e on my desktop
(load-file (expand-file-name "mu4e.el" user-emacs-directory))
(use-package mu4e
:straight t
:config
(ptw/init-mu4e)))
(use-package calfw
:straight (calfw
:host github
:repo "kiwanami/emacs-calfw"
:files ("calfw.el" "calfw-cal.el")))
;; Org mode stuff
;(use-package org-evil
; :straight t)
(use-package graphviz-dot-mode
:straight t)
(use-package org
:straight t
:bind
("C-x P" . (lambda ()
(interactive)
(org-babel-execute-src-block)
(org-redisplay-inline-images)))
:config
(org-babel-do-load-languages
'org-babel-load-languages
'((dot . t)))
(add-hook 'org-mode-hook
(lambda ()
(local-set-key
(kbd "C-x q")
(lambda ()
(interactive)
(org-present-quit)))
(local-set-key
(kbd "C-x p")
(lambda ()
(interactive)
(org-present))))))
(use-package org-present
:straight (org-present
:host github
:repo "rlister/org-present"
:files ("org-present.el"))
:config
(add-hook 'org-present-mode-hook
(lambda ()
(org-present-big)
(org-display-inline-images)
(org-present-hide-cursor)
(org-present-read-only)
(org-hide-block-all)
; Disable evil, but bind left (prev) and right (next)
(turn-off-evil-mode)
(local-set-key
(kbd "l")
(lambda ()
(interactive)
(org-present-next)
;; NOTE: Workaround for images not being shown wen
;; the slide has been changed
(org-redisplay-inline-images)))
(local-set-key
(kbd "h")
(lambda ()
(interactive)
(org-present-prev)
;; NOTE: Workaround for images not being shown wen
;; the slide has been changed
(org-redisplay-inline-images)))
;; Disable the modeline. But save it before so that we
;; can restore it
(set (make-local-variable 'saved-mode-line-format) mode-line-format)
(setq mode-line-format nil)))
(add-hook 'org-present-mode-quit-hook
(lambda ()
(org-present-small)
(org-remove-inline-images)
(org-present-show-cursor)
(org-present-read-write)
(org-show-all)
(turn-on-evil-mode)
(local-unset-key (kbd "h"))
(local-unset-key (kbd "l"))
;; Restore the modeline.
;; NOTE: We need to call redraw-display or else the modeline
;; won't be complete
(setq mode-line-format saved-mode-line-format)
(redraw-display))))
(use-package nix-mode
:straight t)
(use-package json-mode
:straight t)
;; Debugging
(use-package explain-pause-mode
:straight
(explain-pause-mode
:type git
:host github
:repo "lastquestion/explain-pause-mode")
:config
(explain-pause-mode))

View File

@ -0,0 +1 @@
(setq package-enable-at-startup nil)

Binary file not shown.

View File

@ -0,0 +1,133 @@
{ pkgs, ... }:
{
environment = {
systemPackages = [ pkgs.firefox-wayland ];
# Deploy a Firefox policy to set the search engine and do some other things
etc."firefox/policies/policies.json".source = ./policies.json;
sessionVariables = {
# TODO: Use pam_environment once I figure out how to enable it.
# Enable multi-touch and stuff
"MOZ_USE_XINPUT2" = "1";
};
};
home-manager.users.alexander.programs.firefox = {
enable = true;
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
https-everywhere
ublock-origin
umatrix
decentraleyes
privacy-redirect
];
profiles.default = {
id = 0; # NOTE: This is important
isDefault = true;
name = "Default Profile";
settings = {
"browser.search.suggest.enabled" = false;
"browser.tabs.drawInTitlebar" = true;
"browser.aboutConfig.showWarning" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
"browser.crashReports.unsubmittedCheck.enabled" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.feeds.topsites" = false;
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts" = false;
"browser.newtabpage.enabled" = false;
"browser.newtabpage.enhanced" = false;
"browser.newtabpage.introShown" = true;
"browser.send_pings" = false;
"browser.shell.checkDefaultBrowser" = false; # NixOS is a bit wonky here
"app.shield.optoutstudies.enabled" = false;
"app.normandy.api_url" = "";
"app.normandy.enabled" = false;
"breakpad.reportURL" = "";
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false;
"signon.autofillForms" = false;
"signon.rememberSignons" = false;
"signon.management.page.breach-alerts.enabled" = false;
"toolkit.telemetry.archive.enabled" = false;
"toolkit.telemetry.bhrPing.enabled" = false;
"toolkit.telemetry.cachedClientID" = "";
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.firstShutdownPing.enabled" = false;
"toolkit.telemetry.hybridContent.enabled" = false;
"toolkit.telemetry.newProfilePing.enabled" = false;
"toolkit.telemetry.prompted" = 2;
"toolkit.telemetry.rejected" = true;
"toolkit.telemetry.reportingpolicy.firstRun" = false;
"toolkit.telemetry.server" = "";
"toolkit.telemetry.shutdownPingSender.enabled" = false;
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.unifiedIsOptIn" = false;
"toolkit.telemetry.updatePing.enabled" = false;
"webgl.disabled" = true;
"webgl.renderer-string-override" = " ";
"webgl.vendor-string-override" = " ";
"experiments.activeExperiment" = false;
"experiments.enabled" = false;
"experiments.manifest.uri" = "";
"experiments.supported" = false;
"extensions.getAddons.cache.enabled" = false;
"extensions.getAddons.showPane" = false;
"extensions.pocket.enabled" = false;
"extensions.screenshots.upload-disabled" = true;
"extensions.shield-recipe-client.api_url" = "";
"extensions.shield-recipe-client.enabled" = false;
"extensions.webservice.discoverURL" = "";
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"media.autoplay.default" = 2;
"media.eme.enabled" = false;
"media.gmp-widevinecdm.enabled" = false;
"media.navigator.enabled" = false;
"media.peerconnection.enabled" = false;
"media.video_stats.enabled" = false;
"network.IDN_show_punycode" = true;
"network.allow-experiments" = false;
"network.captive-portal-service.enabled" = false;
"network.cookie.cookieBehavior" = 1;
"network.dns.disablePrefetch" = true;
"network.dns.disablePrefetchFromHTTPS" = true;
"network.http.referer.spoofSource" = true;
"network.http.speculative-parallel-limit" = 0;
"network.predictor.enable-prefetch" = false;
"network.predictor.enabled" = false;
"network.prefetch-next" = false;
"network.trr.mode" = 5;
"privacy.donottrackheader.enabled" = true;
"privacy.donottrackheader.value" = 1;
"privacy.trackingprotection.cryptomining.enabled" = true;
"privacy.trackingprotection.enabled" = true;
"privacy.trackingprotection.fingerprinting.enabled" = true;
"privacy.trackingprotection.pbmode.enabled" = true;
"privacy.usercontext.about_newtab_segregation.enabled" = true;
"security.ssl.disable_session_identifiers" = true;
# Hardware Video Acceleration
"media.ffmpeg.vaapi.enabled" = true;
"media.ffvpx.enabled" = false;
"media.rdd-vpx.enabled" = false;
"media.navigator.mediadataencoder_vpx_enabled" = true;
# WebRender
"gfx.webrender.all" = true;
# Better smooth scrolling
"general.smoothScroll.msdPhysics.continuousMotionMaxDeltaMS" = 250;
"general.smoothScroll.msdPhysics.enabled" = true;
"general.smoothScroll.msdPhysics.motionBeginSpringConstant" = 450;
"general.smoothScroll.msdPhysics.regularSpringConstant" = 450;
"general.smoothScroll.msdPhysics.slowdownMinDeltaMS" = 50;
"general.smoothScroll.msdPhysics.slowdownMinDeltaRatio;0" = 4;
"general.smoothScroll.msdPhysics.slowdownSpringConstant" = 5000;
"mousewheel.min_line_scroll_amount" = 22;
"toolkit.scrollbox.horizontalScrollDistance" = 4;
"toolkit.scrollbox.verticalScrollDistance" = 5;
# Misc
"layout.spellcheckDefault" = 0; # I don't use spellcheck
"extensions.activeThemeID" = "firefox-alpenglow@mozilla.org"; # It's a nice theme
};
};
};
}

View File

@ -0,0 +1,17 @@
{
"policies": {
"SearchEngines": {
"Default": "DuckDuckGo",
"Remove": ["Google", "Amazon.de", "Bing"]
},
"UserMessaging": {
"WhatsNew": false,
"ExtensionRecommendations": false,
"FeatureRecommendations": false,
"UrlbarInterventions": false
},
"OverrideFirstRunPage": "",
"DisablePocket": true,
"DisableTelemetry": true
}
}

View File

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.diff-so-fancy ];
home-manager.users.alexander.programs.git = {
enable = true;
userEmail = "papatutuwawa@polynom.me";
userName = "Alexander \"PapaTutuWawa\"";
extraConfig = {
init = {
defaultBranch = "master";
};
core = {
editor = "rvim";
filemode = "false";
pager = "diff-so-fancy | less --tabs=4 -RFX";
};
};
};
}

View File

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.gnome.gnome-terminal ];
home-manager.users.alexander.programs.gnome-terminal = {
enable = true;
profile.default = {
visibleName = "default";
audibleBell = false;
#boldIsBright = true;
default = true;
# TODO: Make this configurable
font = "Source Code Pro 12";
};
};
}

View File

@ -0,0 +1,65 @@
{ pkgs, config, lib, ... }:
let
unstable = (import ../../unstable.nix config);
in {
environment = {
systemPackages = with pkgs; [
arc-theme
gnomeExtensions.appindicator
gnomeExtensions.caffeine
gnomeExtensions.gnome-40-ui-improvements
gnomeExtensionsCustom.notification-timeout # Custom package
gnome.eog
gnome.nautilus
unstable.gnome.gnome-shell
gnome.gnome-terminal
pinentry-gnome
dconf # For home-manager
];
gnome.excludePackages = pkgs.gnome.optionalPackages;
};
services = {
accounts-daemon.enable = true;
colord.enable = false;
geoclue2.enable = false;
dleyna-renderer.enable = false;
dleyna-server.enable = false;
gvfs.enable = lib.mkForce false;
telepathy.enable = false;
gnome = {
chrome-gnome-shell.enable = false;
gnome-initial-setup.enable = false;
gnome-remote-desktop.enable = false;
rygel.enable = false;
gnome-online-accounts.enable = false;
evolution-data-server.enable = lib.mkForce false;
tracker.enable = false;
tracker-miners.enable = false;
core-utilities.enable = false;
games.enable = false;
};
udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
xserver = {
enable = true;
layout = "de";
libinput.enable = true;
desktopManager.gnome.enable = true;
displayManager = {
gdm.enable = true;
gdm.wayland = true;
};
};
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
gtkUsePortal = true;
};
}

View File

@ -0,0 +1,37 @@
{ pkgs, ... }:
let
makeMpvProfile = shader: {
glsl-shaders = "~/.config/mpv/shaders/${shader}";
scale = "ewa_lanczossharp";
cscale = "ewa_lanczossharp";
gpu-context = "auto";
gpu-api = "opengl";
hwdec = "vaapi";
vo = "gpu";
video-sync = "display-resample";
interpolation = "";
tscale = "oversample";
};
in {
environment.systemPackages = [ pkgs.mpv ];
home-manager.users.alexander = {
xdg.configFile = {
"mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl".source = ./shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl;
"mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl".source = ./shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl;
};
programs.mpv = {
enable = true;
config = {
script-opts = "try_ytdl_first=no";
};
defaultProfiles = [ "anime" ];
profiles = {
anime = (makeMpvProfile "Anime4K_Upscale_CNN_UL_x2_Deblur.glsl");
"anime-denoise" = (makeMpvProfile "Anime4K_Upscale_CNN_UL_x2_Denoise.glsl");
};
};
};
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
mpdevil
mopidy mopidy-mpd mopidy-funkwhale
];
# TODO
services.mopidy = {
enable = true;
configuration = ''
[funkwhale]
enabled = true
url = https://audio.polynom.me
client_id =
client_secret =
cache_duration = 600
'';
extensionPackages = with pkgs; [
mopidy-mpd mopidy-funkwhale
];
};
}

View File

@ -0,0 +1,24 @@
{ pkgs, ... }:
let
network = import ../../network.nix;
in {
environment = {
systemPackages = with pkgs; [ gopass home-manager ];
sessionVariables = {
# Prevent us from having to always type it out
#NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/mikulinux.nix";
};
shells = [ pkgs.zsh ];
pathsToLink = [ "/share/zsh" ];
};
networking.hosts = {
"${network.miku}" = [ "miku.local" ];
"${network.nishimiya}" = [ "nishimiya.local" ];
"${network.ayame}" = [ "ayame.local" ];
"${network.tamaki}" = [ "tamaki.local" ];
};
}

View File

@ -0,0 +1,56 @@
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.tmux ];
home-manager.users.alexander.programs.tmux = {
enable = true;
extraConfig = ''
set -g mouse on
set -g history-limit 1000
setw -g monitor-activity on
set -g visual-activity on
bind r source-file ~/.config/tmux/config
## Status bar design
# status line
set -g status-justify left
set -g status-interval 2
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
# Info on left (I don't have a session display for now)
set -g status-left ""
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
set -g default-terminal "screen-256color"
# The modes {
setw -g clock-mode-colour colour135
# }
# The statusbar {
set -g status-position bottom
set -g status-left ""
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
# }
'';
};
}

View File

@ -0,0 +1,67 @@
{ pkgs, ... }:
{
environment = {
systemPackages = [ pkgs.zsh ];
shells = [ pkgs.zsh ];
pathsToLink = [ "/share/zsh" ];
};
# Otherwise the user won't appear on the GDM login screen
programs.zsh.enable = true;
home-manager.users.alexander.programs.zsh = {
enable = true;
history.ignoreSpace = true;
shellAliases = {
ls = "ls --color=always";
".." = "cd ..";
"..." = "cd ../../";
dev = "cd $HOME/Development";
home = "cd $HOME";
reload = "$SHELL -l";
gs = "git status";
gd = "git diff";
gds = "git diff --staged";
c = "clear";
suspend = "systemctl suspend";
};
initExtra = ''
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey "\e[3~" delete-char
'';
history.share = true;
plugins = [
{
name = "pure.zsh";
file = "pure.zsh";
src = pkgs.fetchFromGitHub {
owner = "sindresorhus";
repo = "pure";
rev = "v1.17.0";
sha256 = "0qfs7rvpyd8jb7x4ziqrkh0b6g9ldds8sn6qbqgrir80vdk90gpa";
};
}
{
name = "zsh-history-substring-search";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-history-substring-search";
rev = "0f80b8eb3368b46e5e573c1d91ae69eb095db3fb";
sha256 = "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y";
};
}
{
name = "zsh-completions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-completions";
rev = "d4511c23659381b56dec8be8c8553b7ff3dc5fd8";
sha256 = "1y8wkmhgkkyfz91y1f8crh6cg912n87gmcchc8xhnwji11n1mqrq";
};
}
];
};
}

10
modules/unstable.nix Normal file
View File

@ -0,0 +1,10 @@
config:
let
unstableTarball =
fetchTarball
https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
in
import unstableTarball {
config = config.nixpkgs.config;
}

View File

@ -0,0 +1,71 @@
{ pkgs, config, ... }:
{
config = {
users.users.alexander = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" ];
hashedPassword = "$5$i4aZuQ/WXP.rFOc$lCzDqbrVsqBQt5954O.3bFPknD0jn27MmqzmE4DIAEC";
shell = pkgs.zsh;
useDefaultShell = false;
uid = 1000;
isSystemUser = false;
};
# Activate gpg
programs.gnupg.agent.enable = true;
home-manager.users.alexander = {
pam.sessionVariables = {
NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/${config.networking.hostName}.nix";
};
programs.home-manager.enable = true;
programs.ssh = {
enable = true;
extraConfig = ''
IdentityFile ~/.ssh/gitea_papatutuwawa
Host git.polynom.me
HostName git.polynom.me
User git
IdentityFile ~/.ssh/gitea_papatutuwawa
'';
};
services.gpg-agent = {
enable = true;
pinentryFlavor = "gnome3";
};
dconf.settings = {
# The packages come in from modules/programs/gnome
# Theme
"org/gnome/desktop/interface" = {
gtk-theme = "Arc-Dark";
};
# Nightlight (TODO: ?)
"org/gnome/settings-daemon/plugins/color" = {
night-light-enabled = true;
};
# Extensions
"org/gnome/shell" = {
enabled-extensions = [
"caffeine@patapon.info"
"notification-timeout@chlumskyvaclav.gmail.com"
];
};
"org/gnome/shell/extensions/caffeine" = {
show-notifications = false;
inhibit-apps = [ "mpv.desktop" ];
};
"org/gnome/shell/extensions/notification-timeout" = {
timeout = 3000;
};
};
};
};
}

View File

@ -0,0 +1,5 @@
{ pkgs, ... }:
{
# TODO
}

14
packages/default.nix Normal file
View File

@ -0,0 +1,14 @@
{ pkgs ? import <nixpkgs> {} }:
{
gamemode = pkgs.callPackage ./gamemode { };
key-mapper = pkgs.callPackage ./key-mapper { };
vfio-isolate = pkgs.callPackage ./vfio-isolate { };
mopidy-funkwhale = pkgs.callPackage ./mopidy-funkwhale {};
gnomeExtensions = {
notification-timeout = pkgs.callPackage ./gnomeExtensions-notification-timeout {};
};
gnome = {
gnome-terminal = pkgs.callPackage ./gnome-terminal {};
};
}

View File

@ -0,0 +1,33 @@
{ stdenv, lib,
meson, ninja, dbus, systemd, pkgconfig, cmake, inih,
fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "gamemode";
version = "1.6.1";
src = fetchFromGitHub {
owner = "FeralInteractive";
repo = pname;
rev = version;
sha256 = "17dck7dzkmzq52f2yrs930fdg2inr7nipvnwpd0jqrwgk2fhwk9z";
};
nativeBuildInputs = [
meson ninja pkgconfig cmake
];
buildInputs = [
dbus systemd inih
];
mesonFlags = [ "-Dwith-systemd-user-unit-dir=${placeholder "out"}/lib/systemd/user" ];
meta = with lib; {
description = "Optimise Linux system performance on demand";
homepage = "https://github.com/FeralInteractive/gamemode";
license = licenses.bsd3;
maintainers = [ ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,31 @@
{ stdenv
, lib
, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-notification-timeout";
version = "unstable-2021-07-25";
src = fetchFromGitHub {
owner = "vchlum";
repo = "notification-timeout";
rev = "1f8c2a433383f974bd49869db5ae7a6d7a82d302";
sha256 = "1ndr8gn52qggq45lbdc5miz62is8im34nzmzsghcnarrm73naq59";
};
uuid = "notification-timeout@chlumskyvaclav.gmail.com";
dontBuild = true;
installPhase = ''
mkdir -p $out/share/gnome-shell/extensions/${uuid}
cp -r metadata.json extension.js prefs.js schemas/ $out/share/gnome-shell/extensions/${uuid}
'';
meta = with lib; {
description = "Gnome Shell extension for configuring notification timeout. ";
homepage = "https://github.com/vchlum/notification-timeout";
license = licenses.mit;
maintainers = [ ];
};
}

View File

@ -0,0 +1,17 @@
diff --git a/setup.py b/setup.py
index 99d298e..74a7948 100644
--- a/setup.py
+++ b/setup.py
@@ -107,6 +107,12 @@ setup(
('/usr/bin/', ['bin/key-mapper-control']),
('/usr/bin/', ['bin/key-mapper-helper']),
],
+ scripts=[
+ 'bin/key-mapper-gtk',
+ 'bin/key-mapper-service',
+ 'bin/key-mapper-control',
+ 'bin/key-mapper-helper'
+ ],
install_requires=[
'setuptools',
'evdev',

View File

@ -0,0 +1,40 @@
{ pkgs, lib, python3Packages, python3, gtk3, gobject-introspection, git, wrapGAppsHook, gnome }:
python3Packages.buildPythonApplication rec {
pname = "key-mapper";
version = "1.0.0";
buildInputs = [ gobject-introspection gtk3 gnome.adwaita-icon-theme ];
nativeBuildInputs = [ wrapGAppsHook ];
propagatedBuildInputs = with python3.pkgs; [ setuptools pydbus evdev pygobject3 ];
src = builtins.fetchGit {
url = "https://github.com/sezanzeb/key-mapper.git";
ref = version;
};
doCheck = false;
strictDeps = false;
patches = [
./add-scripts.patch
./hack-data-dir.patch
];
# Required as we otherwise don't get the dbus policy installed
# correctly
preInstall = ''
# see https://github.com/pypa/setuptools/issues/130
${python3}/bin/${python3.executable} setup.py install_data --install-dir=$out --root=$out
'';
meta = with lib; {
homepage = "https://github.com/sezanzeb/key-mapper";
description = "A tool to change the mapping of your input device buttons";
license = licenses.gpl3;
maintainers = [ ];
platforms = lib.platforms.linux;
};
}

View File

@ -0,0 +1,12 @@
diff --git a/keymapper/data.py b/keymapper/data.py
index d909399..f7716ac 100644
--- a/keymapper/data.py
+++ b/keymapper/data.py
@@ -68,6 +68,7 @@ def get_data_path(filename=''):
'/usr/share/key-mapper',
'/usr/local/share/key-mapper',
os.path.join(site.USER_BASE, 'share/key-mapper'),
+ os.environ["KEYMAPPER_DATA"],
]
if data is None:

View File

@ -0,0 +1,29 @@
{ lib, python3Packages, mopidy }:
python3Packages.buildPythonApplication rec {
pname = "mopidy-funkwhale";
version = "1.0";
src = builtins.fetchTarball {
url = "https://files.pythonhosted.org/packages/2a/0a/b7cb53fcc5de17f688f249ff9bfa8bf999085187eae360ae1939a8b0bc29/mopidy_funkwhale-1.0.tar.gz";
sha256 = "1migp2xbqv65fw26b8vi8ffwh89h66cx62dpdw6skyn32f5zw4cc";
};
patchPhase = "sed s/vext// -i setup.cfg";
propagatedBuildInputs = [
mopidy
python3Packages.pygobject3
python3Packages.requests
python3Packages.requests_oauthlib
];
doCheck = false;
meta = with lib; {
description = "Mopidy extension for playing music from Funkwhale";
license = licenses.gpl3;
maintainers = [ ];
};
}

11
packages/overlay.nix Normal file
View File

@ -0,0 +1,11 @@
self: super:
{
gamemode = super.callPackage ./gamemode {};
key-mapper = super.callPackage ./key-mapper {};
vfio-isolate = super.callPackage ./vfio-isolate {};
mopidy-funkwhale = super.callPackage ./mopidy-funkwhale {};
gnomeExtensionsCustom = {
notification-timeout = super.callPackage ./gnomeExtensions-notification-timeout {};
};
}