Compare commits

...

21 Commits

Author SHA1 Message Date
98c27ce238 ssh: Fix issues with trying different keys 2023-12-27 00:54:00 +01:00
86ce0ed9e6 nishimiya: Changes 2023-09-18 13:10:15 +02:00
91910ec46e Commits 2023-09-17 13:35:43 +02:00
d2426b4291 gaming: Allow gamescope to run with CAPSYSNICE 2023-09-17 13:35:25 +02:00
7c1113cd09 flake: Expose the sandboxed prismlauncher 2023-08-11 17:43:15 +02:00
4b6290c3c7 git: Use the GPG key on my Yubikey for signing commits 2023-07-23 21:06:10 +02:00
650d566f8d packages: Remove the patched Gajim 2023-07-21 20:11:38 +02:00
45e93b353c miku: Enable YubiKey 2023-07-21 20:03:01 +02:00
dd43d48900 miku: Remove some packages 2023-07-19 16:23:24 +02:00
5e17268044 lib: Add nerdfonts for nvim 2023-07-19 16:23:24 +02:00
6699d5488a yubikey: New module 2023-07-19 16:23:10 +02:00
e429bdb946 cups: Fix scanning on hplip printers 2023-07-19 14:01:58 +02:00
5d868ad1f8 l 2023-07-19 14:01:24 +02:00
0a36b0acb5 lol 2023-07-19 14:01:24 +02:00
dffafa8973 nishimiya: Changes 2023-07-19 14:01:24 +02:00
d0bd1ca8fa nvim: Configure it with everything needed for LazyVim 2023-07-18 21:46:28 +02:00
1346cb93af retroatch: Add pcsx2 2023-04-30 15:23:18 +02:00
1e24a7d6bc nishimiya: Load aesni-intel 2023-04-30 15:23:04 +02:00
b58d5eb12f miku: Disable keypad lights with gamemode 2023-04-30 15:22:52 +02:00
a193b02ce0 base: Fix renamed option 2023-04-15 19:09:57 +02:00
c252c831b5 Update gajim 2023-04-15 19:09:05 +02:00
25 changed files with 398 additions and 251 deletions

153
flake.lock generated
View File

@@ -21,14 +21,15 @@
"emacs": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1680944922,
"narHash": "sha256-Lkt2uvLOzPzz65uKf0ljpU95mRIgCeONqjjpelIVGCw=",
"lastModified": 1693879203,
"narHash": "sha256-0CGMa3MxeG3YsVetUtxg6eZumQIe8FJ+WHVfR2ko9zM=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "1195f952f1d610244a4b1b8b0b9dbd13ef6d553c",
"rev": "3adaef3b1bebdc244a03ee19f705f5a3190a33d9",
"type": "github"
},
"original": {
@@ -59,12 +60,15 @@
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"lastModified": 1692799911,
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"type": "github"
},
"original": {
@@ -74,12 +78,15 @@
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1680946745,
"narHash": "sha256-KqGlwg9UTDsFBZZB8wzXgMnc8XQm95LtSbFvBsnqkPI=",
"lastModified": 1692799911,
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "946da791763db1c306b86a8bd3828bf5814a1247",
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"type": "github"
},
"original": {
@@ -165,15 +172,14 @@
},
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"utils": "utils"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1680667162,
"narHash": "sha256-2vgxK4j42y73S3XB2cThz1dSEyK9J9tfu4mhuEfAw68=",
"lastModified": 1693859358,
"narHash": "sha256-r3Pak/ao3p8weTzR+Ry3qQrfRsmSOwWW5sAe73mrYKs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "440faf5ae472657ef2d8cc7756d77b6ab0ace68d",
"rev": "886ea1d213efd1082f419d066e89ef37635dc970",
"type": "github"
},
"original": {
@@ -211,7 +217,7 @@
"ostylk-home",
"pkg-stable"
],
"utils": "utils_3"
"utils": "utils_2"
},
"locked": {
"lastModified": 1679067101,
@@ -234,7 +240,7 @@
"ostylk-home",
"pkg-unstable"
],
"utils": "utils_4"
"utils": "utils_3"
},
"locked": {
"lastModified": 1680597706,
@@ -381,11 +387,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1680876084,
"narHash": "sha256-eP9yxP0wc7XuVaODugh+ajgbFGaile2O1ihxiLxOuvU=",
"lastModified": 1693718952,
"narHash": "sha256-+nGdJlgTk0MPN7NygopipmyylVuAVi7OItIwTlwtGnw=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "3006d2860a6ed5e01b0c3e7ffb730e9b293116e2",
"rev": "793de77d9f83418b428e8ba70d1e42c6507d0d35",
"type": "github"
},
"original": {
@@ -413,11 +419,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1673540789,
"narHash": "sha256-xqnxBOK3qctIeUVxecydrEDbEXjsvHCPGPbvsl63M/U=",
"lastModified": 1693663421,
"narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0f213d0fee84280d8c3a97f7469b988d6fe5fcdf",
"rev": "e56990880811a451abd32515698c712788be5720",
"type": "github"
},
"original": {
@@ -427,6 +433,22 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1693771906,
"narHash": "sha256-32EnPCaVjOiEERZ+o/2Ir7JH9pkfwJZJ27SKHNvt4yk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "da5adce0ffaff10f6d0fee72a02a5ed9d01b52fc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1649408932,
@@ -445,15 +467,15 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1680487167,
"narHash": "sha256-9FNIqrxDZgSliGGN2XJJSvcDYmQbgOANaZA4UWnTdg4=",
"owner": "nixos",
"lastModified": 1693565476,
"narHash": "sha256-ya00zHt7YbPo3ve/wNZ/6nts61xt7wK/APa6aZAfey0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "53dad94e874c9586e71decf82d972dfb640ef044",
"rev": "aa8aa7e2ea35ce655297e8322dc82bf77a31d04b",
"type": "github"
},
"original": {
"owner": "nixos",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
@@ -461,11 +483,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1680758185,
"narHash": "sha256-sCVWwfnk7zEX8Z+OItiH+pcSklrlsLZ4TJTtnxAYREw=",
"lastModified": 1693663421,
"narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e19daa510e47a40e06257e205965f3b96ce0ac9",
"rev": "e56990880811a451abd32515698c712788be5720",
"type": "github"
},
"original": {
@@ -567,11 +589,11 @@
},
"nur": {
"locked": {
"lastModified": 1680932643,
"narHash": "sha256-vHkZJnPfA788UQ0zsfj4P09pVqBsn4niMp5qhN3ue28=",
"lastModified": 1693907142,
"narHash": "sha256-U3yzshaxSUAC6Hy5xGmlX1TySHoWjH++Y2cC9ujEmZc=",
"owner": "nix-community",
"repo": "nur",
"rev": "c468956d1604fb0182d24448a1cb45ab948bf4ca",
"rev": "283964d2452632c9b0ccc8eff08d242a073b022f",
"type": "github"
},
"original": {
@@ -622,11 +644,11 @@
"rnix-lsp": "rnix-lsp_2"
},
"locked": {
"lastModified": 1680620959,
"narHash": "sha256-P0tG2Js4xq0UIVaso7HeTZugQ7bn8ZDNE+zXtSWSvWI=",
"lastModified": 1683784900,
"narHash": "sha256-h+n0rS4nBFBqlMd1ktn+8UypNP3gQ91e+i/e1zHhbTg=",
"ref": "refs/heads/master",
"rev": "319f35d1900fef34581e0380178beb7fa86be700",
"revCount": 123,
"rev": "3a0f186fca0a88e0a2fd002eabedb418cf9a6f6a",
"revCount": 124,
"type": "git",
"url": "https://destiny.ostylk.de/gitea/NixDistro/Home.git"
},
@@ -690,7 +712,7 @@
"ostylk",
"nixpkgs"
],
"utils": "utils_2"
"utils": "utils"
},
"locked": {
"lastModified": 1640347520,
@@ -711,7 +733,7 @@
"inputs": {
"naersk": "naersk_2",
"nixpkgs": "nixpkgs_8",
"utils": "utils_5"
"utils": "utils_4"
},
"locked": {
"lastModified": 1669555118,
@@ -758,6 +780,36 @@
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tablet-mode": {
"inputs": {
"flake-utils": "flake-utils_4",
@@ -797,21 +849,6 @@
}
},
"utils": {
"locked": {
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
@@ -826,7 +863,7 @@
"type": "github"
}
},
"utils_3": {
"utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
@@ -841,7 +878,7 @@
"type": "github"
}
},
"utils_4": {
"utils_3": {
"locked": {
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
@@ -856,7 +893,7 @@
"type": "github"
}
},
"utils_5": {
"utils_4": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",

View File

@@ -53,10 +53,12 @@
overlays = [
self.overlay
(import ./overlays/sandbox.nix)
];
};
in {
inherit (pkgs) wayqt dfl-ipc dfl-applications dfl-utils qtgreet xwaylandvideobridge obs-cli;
inherit (pkgs) wayqt dfl-ipc dfl-applications dfl-utils qtgreet xwaylandvideobridge obs-cli rgb_keyboard prismlauncher-wrapped anime4k;
};
});
}

View File

@@ -34,23 +34,11 @@
piper trackma # Custom package
anime-dl # Custom package
thunderbird
#nwg-launchers
gnome-podcasts
cantata
newsflash
sublime-music
anki
gnome-podcasts
gimp
xwaylandvideobridge
#psst
evolution
# Proprietary stuff (yikes)
discord-wrapped discord-app-wrapped
spotify-wrapped
zoom-vm
#lapce
];
@@ -63,33 +51,35 @@
};
sway.enable = false;
alacritty.enable = true;
emacs.enable = true;
#emacs.enable = true;
firefox.enable = true;
git.enable = true;
gnome-terminal.enable = true;
#gnome-terminal.enable = true;
tmux.enable = true;
waybar = {
enable = true;
output = "DP-2";
};
neovim.enable = true;
#xournalpp.enable = true;
zsh.enable = true;
direnv.enable = true;
office.enable = true;
plasma = {
enable = true;
sddm = {
/*sddm = {
backgroundImage = pkgs.fetchurl {
url = "https://cdn.donmai.us/original/d3/1b/__manjuu_prinz_eugen_roon_bismarck_friedrich_der_grosse_and_3_more_azur_lane_drawn_by_zaphn__d31bf4ac564d60f8787818842c369e7f.jpg";
sha256 = "sha256-likoJuEaGzGH0RqjPsBE9o5ATwgnOo97PREh3oZBax8=";
};
};
};*/
};
gaming.enable = true;
obs.enable = true;
android.enable = true;
};
services = {
yubikey.enable = true;
gamemode.enable = true;
gnome.enable = false;
logiops.enable = true;
@@ -116,30 +106,34 @@
};
virtualisation = {
podman = {
docker = {
enable = true;
dockerCompat = true;
storageDriver = "btrfs";
};
# docker = {
# enable = true;
# storageDriver = "btrfs";
# };
};
boot = let
kernel = pkgs.linuxPackages_zen;
kernel = pkgs.linuxPackages_xanmod_latest;
in {
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" ];
availableKernelModules = [
"xhci_pci"
"ahci"
"usbhid"
"sd_mod"
"amdgpu"
"vendor-reset"
"winesync"
];
kernelModules = [
"amdgpu" # GPU (duh)
"kvm-amd" /*"vfio_virqfd"*/ "vfio_pci" "vfio_iommu_type1" "vfio" # Virt
"uinput" # key-mapper
"vendor-reset"
"winesync"
];
};
kernelParams = [
@@ -157,23 +151,28 @@
"mitigations=off"
"rhgb"
# Enable ZSwap
"zswap.enabled=1"
#"zswap.enabled=1"
# Enable Apparmor
"lsm=landlock,lockdown,yama,integrity,apparmor,bpf"
# Prevent sequential probing
"libahci.ignore_sss=1"
# Make the system less ready to swap
"sysctl.vm.swappiness=0"
];
kernel.sysctl = {
# League of Legends under Linux
"abi.vsyscall32" = 0;
# Fedora 39
"vm.max_map_count" = 2147483642;
};
extraModulePackages = [ kernel.vendor-reset ];
# NOTE: A regression appears to have happend between 5.10 and 5.12
# which leads to the RX590 to have the fence fallback timer on
# sdma0 time out (whatever this means). Maybe bisect?
kernelPackages = kernel;
binfmt = {
emulatedSystems = [ "aarch64-linux" ];
registrations.aarch64-linux.fixBinary = true;
};
};
services = {
ratbagd.enable = true;
@@ -199,6 +198,17 @@
motherboard = "amd";
};
};
system76-scheduler = {
enable = false;
useStockConfig = true;
};
};
programs = {
cdemu = {
enable = true;
gui = true;
};
};
hardware = {

View File

@@ -19,10 +19,11 @@
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci"
"aesni-intel"
# NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/common/pc/laptop/acpi_call.nix
#"acpi_call" ];
];
kernelModules = [ "dm-snapshot" ];
kernelModules = [ "dm-snapshot" "aesni-intel" ];
luks.devices = {
cryptroot = {
device = "/dev/disk/by-uuid/e1011c40-e1a9-4ce6-b89f-f14b046639c1";
@@ -35,12 +36,14 @@
extraModulePackages = [ ];
# NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/e495/default.nix#L12
kernelParams = [ "acpi_backlight=native" ];
binfmt.emulatedSystems = ["aarch64-linux"];
};
ptw = {
programs = {
alacritty.enable = true;
sway.enable = true;
sway.enable = false;
emacs.enable = true;
firefox.enable = true;
tmux.enable = true;
@@ -55,8 +58,9 @@
direnv.enable = true;
};
services = {
yubikey.enable = true;
cups.enable = true;
gnome.enable = true;
gnome.enable = false;
kanshi = let
horizontal = "Samsung Electric Company C27F398 H4ZR101145";
@@ -122,12 +126,30 @@
};
};
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
dockerSocket.enable = true;
};
};
environment.systemPackages = with pkgs; [
ansible
gnumake
wireguard-tools
(pkgs.callPackage ./wrapper.nix {
inherit (pkgs) retroarch;
cores = with pkgs.libretro; [
mgba mupen64plus melonds desmume dolphin
];
})
];
programs = {
gnupg.agent.pinentryFlavor = "qt";
gnupg.agent = {
pinentryFlavor = "qt";
};
};
}

37
hosts/wrapper.nix Normal file
View File

@@ -0,0 +1,37 @@
{ stdenv, lib, makeWrapper, retroarch, cores ? [ ] }:
stdenv.mkDerivation {
pname = "retroarch";
version = lib.getVersion retroarch;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/lib
for coreDir in $cores
do
ln -s $coreDir/* $out/lib/.
done
ln -s -t $out ${retroarch}/share
if [ -d ${retroarch}/Applications ]; then
ln -s -t $out ${retroarch}/Applications
fi
makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch \
--suffix-each LD_LIBRARY_PATH ':' "$cores" \
--add-flags "-L $out/lib/" \
'';
cores = map (x: x + x.libretroCore) cores;
preferLocalBuild = true;
meta = with retroarch.meta; {
inherit changelog description homepage license maintainers platforms;
longDescription =
"RetroArch is the reference frontend for the libretro API. The following cores are included: "
+ lib.concatStringsSep ", " (map (x: "${x.name}") cores)
+ ".";
};
}

View File

@@ -33,7 +33,14 @@ in {
};
networking = {
useDHCP = false; # Done by the network manager
networkmanager.enable = true;
networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-vpnc
networkmanager-openvpn
networkmanager-openconnect
];
};
#interfaces.*.useDHCP = false;
@@ -98,7 +105,7 @@ in {
# Coding fonts
source-code-pro
# Icon fonts
#nerdfonts
nerdfonts
];
# For home-manager
@@ -237,7 +244,10 @@ in {
};
# Don't wait for a network connection
systemd.services.NetworkManager-wait-online.enable = false;
systemd = {
services.NetworkManager-wait-online.enable = false;
coredump.enable = false;
};
security.sudo.extraConfig = ''
Defaults env_keep += "NIXOS_CONFIG"
@@ -282,7 +292,7 @@ in {
};
boot = {
cleanTmpDir = true;
tmp.cleanOnBoot = true;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -38,6 +38,8 @@ in inputs.nixpkgs.lib.nixosSystem {
# Overlays
(util.mkOverlayFromInput "stable" inputs.stable)
(util.mkOverlayFromInput "unstable" inputs.nixpkgs)
{
nixpkgs.overlays = [
nur.overlay

View File

@@ -13,6 +13,7 @@
./programs/sddm
./programs/gnome-terminal
./programs/mpv
./programs/neovim
./programs/git
./programs/sway
./programs/swaync
@@ -35,6 +36,7 @@
./services/greetd
./services/cups
./services/logiops
./services/yubikey
# User
#./users/default.nix

View File

@@ -14,7 +14,7 @@ in {
description = "Ignore NixOS 'recommendations' and use the Wayland session by default";
};
};
sddm = {
/*sddm = {
backgroundImage = lib.mkOption {
default = "${pkgs.sddm-sugar-dark}/usr/share/sddm/themes/sugar-dark/Background.jpg";
description = "The background image to use with sddm-sugar-dark";
@@ -27,7 +27,7 @@ in {
default = 1080;
description = "Width of the screen";
};
};
};*/
};
config = lib.mkIf cfg.enable {

View File

@@ -30,7 +30,7 @@ in {
dynamic_title = true;
decorations = "full";
startup_mode = "Windowed";
opacity = 0.7;
#opacity = 0.7;
};
scrolling = {
@@ -48,7 +48,6 @@ in {
x = 0;
y = 0;
};
use_thin_strokes = true;
};
debug = {
render_timer = false;
@@ -111,7 +110,6 @@ in {
live_config_reload = true;
enable_experimental_conpty_backend = false;
alt_send_esc = true;
key_bindings = [
{

View File

@@ -20,7 +20,7 @@ in {
(pkgs.callPackage ./wrapper.nix {
inherit (pkgs) retroarch;
cores = with pkgs.libretro; [
mgba mupen64plus melonds desmume dolphin
mgba mupen64plus melonds desmume dolphin pcsx2
];
})
@@ -37,13 +37,16 @@ in {
# Gameplay clip editing
kdenlive
# Better experience
gamescope
# Performance
corectrl
];
programs.gamescope = {
enable = true;
capSysNice = true;
args = ["--rt"];
};
# security.wrappers.gamescope = {
# owner = "alexander";
# group = "alexander";

View File

@@ -12,6 +12,9 @@ in {
enable = true;
userEmail = "papatutuwawa@polynom.me";
userName = "Alexander \"PapaTutuWawa\"";
# The key on my Yubikey
signing.key = "B688F70D0EC87D5A8A9D3D7A56C749835F3CE824";
extraConfig = {
init = {
defaultBranch = "master";

View File

@@ -83,7 +83,7 @@ in {
xdg.portal = {
enable = true;
#extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
gtkUsePortal = true;
#gtkUsePortal = true;
};
qt5 = {

View File

@@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }:
let
mkAnime4kShader = shader: "${pkgs.anime4k}/usr/share/shaders/${shader}";
#mkAnime4kShader = shader: "${pkgs.anime4k}/usr/share/shaders/${shader}";
mkDefaultShader = shader: "${pkgs.mpv-shader-pack}/usr/share/shaders/${shader}";
makeMpvProfile = { shader, gpuContext ? "waylandvk", additional ? {} }: {
glsl-shaders = shader;
makeMpvProfile = { shader ? null, gpuContext ? "waylandvk", additional ? {} }: {
glsl-shaders = lib.mkIf (shader != null) shader;
scale = "ewa_lanczossharp";
cscale = "ewa_lanczossharp";
gpu-context = gpuContext;
@@ -41,13 +41,13 @@ in {
defaultProfiles = [ "anime" ];
profiles = {
anime = (makeMpvProfile {
shader = mkAnime4kShader "Anime4K_Upscale_Denoise_CNN_x2_VL.glsl";
#shader = mkAnime4kShader "Anime4K_Upscale_Denoise_CNN_x2_VL.glsl";
additional = {
fullscreen = "";
};
});
anime-denoise = (makeMpvProfile {
shader = mkAnime4kShader "Anime4K_Upscale_Denoise_CNN_x2_VL.glsl";
#shader = mkAnime4kShader "Anime4K_Upscale_Denoise_CNN_x2_VL.glsl";
});
non-anime = (makeMpvProfile {
shader = mkDefaultShader "FSRCNNX_x2_8-0-4-1.glsl";

View File

@@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ptw.programs.neovim;
in {
options.ptw.programs.neovim = {
enable = lib.mkEnableOption "Enable and configure neovim using HomeManager";
};
config = lib.mkIf cfg.enable {
home-manager.users."${config.ptw.system.singleUser}" = {
programs.neovim = {
enable = true;
extraPackages = with pkgs; [
# For telescope-nvim
fd
lazygit
fish
tree-sitter gcc
nodejs_20
# Clipboard
wl-clipboard
];
};
};
};
}

View File

@@ -15,6 +15,10 @@ in {
drivers = with pkgs; [ hplip ];
};
services.avahi = {
enable = lib.mkForce true;
nssmdns = true;
};
hardware.sane = {
enable = true;
extraBackends = with pkgs; [ sane-airscan hplip ];

View File

@@ -7,7 +7,15 @@ in {
enable = lib.mkEnableOption "Enable and configure gamemode";
};
config = lib.mkIf cfg.enable {
config = let
keyboardBrightnessScript = pkgs.writeShellScript "keyboard-brightness.sh" ''
${pkgs.rgb_keyboard}/bin/rgb_keyboard -l ripple -b "$1"
'';
in lib.mkIf cfg.enable {
security.sudo.extraConfig = ''
${config.ptw.system.singleUser} ALL = (ALL) NOPASSWD: ${keyboardBrightnessScript}
'';
programs.gamemode = {
enable = true;
enableRenice = true;
@@ -29,14 +37,28 @@ in {
};
custom = let
switchScript = groupName: pkgs.writeShellScript "switch-input-group.sh" ''
${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SwitchInputMethodGroup string:'${groupName}'
'';
switchScript = groupName: "${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SwitchInputMethodGroup string:'${groupName}'";
pauseFcitx = switchScript "Group 2";
resumeFcitx = switchScript "Group 1";
# The scripts
start = pkgs.writeShellScript "gamemode-start.sh" ''
# Disable Fcitx's IME
${pauseFcitx}
# Turn on the keyboard lights
${config.security.wrapperDir}/sudo ${keyboardBrightnessScript} 1
'';
end = pkgs.writeShellScript "gamemode-end.sh" ''
# Resume Fcitx's IME
${resumeFcitx}
# Turn off the keyboard lights
${config.security.wrapperDir}/sudo ${keyboardBrightnessScript} 0
'';
in {
start = ''${pauseFcitx}'';
end = ''${resumeFcitx}'';
start = "${start}";
end = "${end}";
};
};
};

View File

@@ -0,0 +1,31 @@
{ lib, config, pkgs, ...}:
let
cfg = config.ptw.services.yubikey;
in {
options.ptw.services.yubikey = {
enable = lib.mkEnableOption "Enable everything for using a YubiKey";
};
config = lib.mkIf cfg.enable {
services = {
# Unprivileged access to the YubiKey
udev.packages = [ pkgs.yubikey-personalization ];
# Allow using the YubiKey as a smart card
pcscd.enable = true;
};
environment.systemPackages = with pkgs; [
# Management
yubikey-manager-qt yubikey-manager yubico-piv-tool
];
programs = {
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
};
}

View File

@@ -4,7 +4,7 @@
config = lib.mkIf (config.ptw.system.singleUser == "alexander") {
users.users.alexander = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" "scanner" "lp" "alexander" ];
extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" "scanner" "lp" "alexander" "cdrom" ];
hashedPassword = "$y$j9T$xhnK648hF0yzDnRy0rTT/.$HbDKvNetiGeY3Xjt6/YPIzoxSmdQ0SzhXengOT1Ga01";
shell = pkgs.zsh;
useDefaultShell = false;
@@ -23,16 +23,15 @@
programs.ssh = {
enable = true;
extraConfig = ''
IdentitiesOnly yes
'';
includes = [
"config.d/*"
];
matchBlocks = let
sshPort = 3434;
sshPort = 1847;
in {
ayame = {
port = sshPort;
hostname = "78.46.184.48";
user = "alexander";
identityFile = "~/.ssh/polynom.me_ayame";
identitiesOnly = true;
};
"git.polynom.me" = {
port = 2222;
user = "gitea";

View File

@@ -26,17 +26,22 @@ in {
enableDesktopFile = true;
};
# prismlauncher-wrapped = wrapInSandbox {
# name = "prismlauncher";
# binary = "${prev.prismlauncher}/bin/prismlauncher";
# launchScriptName = "prismlauncher-wrapped";
# mountInHome = [".local/share/PrismLauncher"];
# additionalMounts = [
# "/etc/profile"
# ];
# additionalBlacklist = [ "/mnt" ];
# chdirTo = "/home/$USER";
# };
prismlauncher-wrapped = wrapInSandbox {
name = "prismlauncher";
binary = let
script = prev.writeShellScript "prismlauncher-zink.sh" ''
export MESA_LOADER_DRIVER_OVERRIDE=zink
${prev.prismlauncher}/bin/prismlauncher
'';
in "${prev.prismlauncher}/bin/prismlauncher";
launchScriptName = "prismlauncher-wrapped";
mountInHome = [".local/share/PrismLauncher"];
additionalMounts = [
"/etc/profile"
];
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
};
steam-wrapped = wrapInSandbox {
name = "steam-wrapped";

View File

@@ -1,18 +1,4 @@
final: prev: {
gajim = prev.gajim.overrideAttrs (old: {
# version = "1.7";
# format = "pyproject";
# src = builtins.fetchurl {
# url = "https://gajim.org/downloads/1.7/gajim-1.7.1.tar.gz";
# sha256 = "sha256:1ij3fnfpyjnb84haqwjy23bjpi6bk37k1h8bbvk9y6296lsnm8mr";
# };
# Enable notification sounds
propagatedBuildInputs = old.propagatedBuildInputs ++ [ prev.gsound ];
});
animedl = prev.animedl.overrideAttrs (old: {
extraPkgs = pkgs: with final; [ mpv ];
});
@@ -80,4 +66,14 @@ final: prev: {
# pkgsi686Linux = prev.pkgsi686Linux.extend (pfinal: pprev: {
# directx-shader-compiler = pprev.directx-shader-compiler.override {stdenv = pfinal.gcc11Stdenv;};
# });
gajim = prev.gajim.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [
# Make the tray icon work
prev.libappindicator-gtk3
# Play sounds
prev.gsound
];
});
}

View File

@@ -0,0 +1,30 @@
{
stdenv
, fetchFromGitHub
, gcc, gnumake
, libusb
}:
stdenv.mkDerivation rec {
pname = "rgb_keyboard";
version = "20230430";
src = fetchFromGitHub {
owner = "PapaTutuWawa";
repo = "rgb_keyboard";
rev = "5bbdafea77ef3c3eb47081494f3b58abcd5c4e27";
sha256 = "0m5hvlhqncy1qn5v6gpsz9qd2p4cvcjjnma08vb4b2ybq4kfv7qw";
};
buildInputs = [
libusb
];
buildPhase = ''
${gnumake}/bin/make build
'';
installPhase = ''
mkdir -p $out/bin/
cp rgb_keyboard $out/bin/
'';
}

View File

@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
src = fetchFromGitLab {
owner = "davidedmundson";
repo = "xwaylandvideobridge";
rev = "b876b5f3ee5cc810c99b08e8f0ebb29553e45e47";
rev = "b9e0c53570f55f4e8289f72ba78f3945e27e1a1a";
domain = "invent.kde.org";
sha256 = "sha256-gfQkOIZegxdFQ9IV2Qp/lLRtfI5/g6bDD3XRBdLh4q0=";
sha256 = "1ypg2c26r5fy9lr8shif5vqcp06yf7mqqj2ps5g00s7s3ykryxdn";
};
buildInputs = [ qtbase qtx11extras plasma-framework xorg.xcbproto kpipewire cmake pkg-config ];

View File

@@ -119,4 +119,6 @@ in {
#obs-websocket = prev.libsForQt5.callPackage obs/obs-websocket {};
obs-cli = prev.callPackage obs/obs-cli {};
rgb_keyboard = prev.callPackage ./applications/desktop/rgb_keyboard/default.nix {};
}

View File

@@ -1,96 +0,0 @@
# From https://github.com/Jovian-Experiments/Jovian-NixOS/blob/d27526e7917671ad3a64f823f4b95b761f96807d/pkgs/gamescope/default.nix
{ stdenv
, fetchFromGitHub
, meson
, pkg-config
, cmake
, ninja
, xorg
, libdrm
, vulkan-loader
, wayland
, wayland-protocols
, libxkbcommon
, libcap
, SDL2
, pipewire
, mesa
, udev
, pixman
, libinput
, libseat
, xwayland
, glslang
, stb
, wlroots
, libliftoff
}:
let
in
stdenv.mkDerivation {
pname = "gamescope";
version = "3.11.28-beta4";
src = fetchFromGitHub {
owner = "Plagman";
repo = "gamescope";
rev = "refs/tags/3.11.28-beta4";
hash = "sha256-3L3bQIPPfScvtN1dduh10dQu/AuTmD4dHNp3JjBIBLA=";
};
buildInputs = [
xorg.libX11
xorg.libXdamage
xorg.libXcomposite
xorg.libXrender
xorg.libXext
xorg.libXxf86vm
xorg.libXtst
xorg.libXres
libdrm
vulkan-loader
wayland
wayland-protocols
libxkbcommon
libcap
SDL2
pipewire
mesa
udev
pixman
libinput
libseat
xwayland
xorg.xcbutilwm
xorg.xcbutilerrors
glslang
xorg.libXi
];
prePatch = ''
echo ":: Copying stb"
cp -vr "${stb.src}" subprojects/stb
chmod -R +w subprojects/stb
cp "subprojects/packagefiles/stb/meson.build" "subprojects/stb/"
echo ":: Copying wlroots"
rmdir subprojects/wlroots
cp -vr "${wlroots.src}" subprojects/wlroots
chmod -R +w subprojects/wlroots
echo ":: Copying libliftoff"
rmdir subprojects/libliftoff
cp -vr "${libliftoff.src}" subprojects/libliftoff
chmod -R +w subprojects/libliftoff
'';
nativeBuildInputs = [
cmake
meson
pkg-config
ninja
];
dontUseCmakeConfigure = true;
}