refactor: Unify Structure

This commit is contained in:
Patrick 2024-10-30 19:24:16 +01:00
parent 891eaeaf3c
commit 00092b2fac
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
102 changed files with 1494 additions and 1659 deletions

View file

@ -4,7 +4,7 @@ This file contains a small overview over the contents and structure of this repo
- `basic/` the basic system configuration, this should be applied for all systems - `basic/` the basic system configuration, this should be applied for all systems
- `system.nix` a far descendant of the original `configuration.nix` - `system.nix` a far descendant of the original `configuration.nix`
any global configuration should be done here first and later moved to their own file if necessary any global configuration should be done here first and later moved to their own file if necessary
- `hardware/` configuration for specific hardware - `support/` configuration for supporting specific hardware
- `optional/` optionally includable configuration - `optional/` optionally includable configuration
- `services/` configuration for independent services - `services/` configuration for independent services
- `hosts/` contain nixos configuration for hosts - `hosts/` contain nixos configuration for hosts
@ -30,9 +30,9 @@ This file contains a small overview over the contents and structure of this repo
- `secrets.nix.age` global secrets available at deploy - `secrets.nix.age` global secrets available at deploy
- `users/` home manager user configuration - `users/` home manager user configuration
- `common/` shared home-manager modules - `common/` shared home-manager modules
- `graphical/` configuration for graphical programs - `wayland/` configuration for wayland windowmanagers and basic utilities
- `xorg/` configuration for xorg windowmanagers and basic utilities
- `programs/` configuration for miscellaneous programs - `programs/` configuration for miscellaneous programs
- `shells/` configuration for shells
- `default.nix` minimal setup for all users - `default.nix` minimal setup for all users
- `<username>/` configuration for users - `<username>/` configuration for users
- `impermanence.nix` users persistence configuration - `impermanence.nix` users persistence configuration

View file

@ -34,6 +34,7 @@
inputs.nixos-extra-modules.nixosModules.default inputs.nixos-extra-modules.nixosModules.default
inputs.nixos-nftables-firewall.nixosModules.default inputs.nixos-nftables-firewall.nixosModules.default
inputs.nixvim.nixosModules.nixvim inputs.nixvim.nixosModules.nixvim
inputs.stylix.nixosModules.stylix
]; ];
age.identityPaths = [ "/state/etc/ssh/ssh_host_ed25519_key" ]; age.identityPaths = [ "/state/etc/ssh/ssh_host_ed25519_key" ];
boot.mode = lib.mkDefault "efi"; boot.mode = lib.mkDefault "efi";

View file

@ -1,7 +1,6 @@
{ {
stateVersion, stateVersion,
inputs, inputs,
pkgs,
nodes, nodes,
minimal, minimal,
... ...
@ -9,6 +8,7 @@
{ {
imports = [ imports = [
../../modules-hm/impermanence.nix ../../modules-hm/impermanence.nix
../../modules-hm/hm-all.nix
]; ];
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
@ -16,10 +16,12 @@
verbose = true; verbose = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit nodes minimal; inherit nodes minimal;
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
}; };
sharedModules = [ sharedModules = [
{ home.stateVersion = stateVersion; } {
home.stateVersion = stateVersion;
systemd.user.startServices = "sd-switch";
}
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
inputs.nixos-extra-modules.homeManagerModules.default inputs.nixos-extra-modules.homeManagerModules.default
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim

View file

@ -59,4 +59,7 @@
}; };
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
system.stateVersion = stateVersion; system.stateVersion = stateVersion;
hm-all.nixpkgs.config = {
allowUnfree = true;
};
} }

View file

@ -1,224 +0,0 @@
{
config,
inputs,
pkgs,
lib,
...
}:
let
inherit (lib) mkOption types;
in
{
options.hidpi = mkOption {
default = false;
type = types.bool;
description = "Enable HighDPI configuration for this host and all installed users";
};
# stylix acceses stylix options on import meaning you can only import this module when you're actually setting stylix options
imports = [ inputs.stylix.nixosModules.stylix ];
config = {
environment.systemPackages = with pkgs; [ xdg-utils ];
xdg.portal = {
xdgOpenUsePortal = true;
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
config = {
common.default = [
"gtk"
"hyprland"
];
sway.default = [ "wlr" ];
};
};
# needed for gnome pinentry
services.dbus.packages = [ pkgs.gcr ];
fonts = {
enableGhostscriptFonts = false;
fontDir.enable = false;
fontconfig = {
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias binding="weak">
<family>monospace</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>sans-serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
</fontconfig>
'';
};
packages = with pkgs; [
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
ibm-plex
dejavu_fonts
unifont
freefont_ttf
gyre-fonts # TrueType substitutes for standard PostScript fonts
liberation_ttf
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
noto-fonts-extra
];
};
stylix.fonts = {
serif = {
package = pkgs.dejavu_fonts;
name = "IBM Plex Serif";
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "IBM Plex Sans";
};
monospace = {
# No need for patched nerd fonts, kitty can pick up on them automatically,
# and ideally every program should do that: https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font
package = pkgs.jetbrains-mono;
name = "JetBrains Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
stylix = {
enable = true;
autoEnable = false;
polarity = "dark";
image = config.lib.stylix.pixel "base00";
base16Scheme = "${pkgs.base16-schemes}/share/themes/vice.yaml";
# Has to be green
override.base0B = "#00CC99";
#base16Scheme = {
# base00 = "#101419";
# base01 = "#171B20";
# base02 = "#21262e";
# base03 = "#242931";
# base04 = "#485263";
# base05 = "#b6beca";
# base06 = "#dee1e6";
# base07 = "#e3e6eb";
# base08 = "#e05f65";
# base09 = "#f9a872";
# base0A = "#f1cf8a";
# base0B = "#78dba9";
# base0C = "#74bee9";
# base0D = "#70a5eb";
# base0E = "#c68aee";
# base0F = "#9378de";
#};
## based on decaycs-dark, bright variant
#base16Scheme = {
# base00 = "#101419";
# base01 = "#171B20";
# base02 = "#21262e";
# base03 = "#242931";
# base04 = "#485263";
# base05 = "#b6beca";
# base06 = "#dee1e6";
# base07 = "#e3e6eb";
# base08 = "#e5646a";
# base09 = "#f7b77c";
# base0A = "#f6d48f";
# base0B = "#94F7C5";
# base0C = "#79c3ee";
# base0D = "#75aaf0";
# base0E = "#cb8ff3";
# base0F = "#9d85e1";
#};
};
home-manager.sharedModules = [
(
{
pkgs,
config,
nixosConfig,
...
}:
{
stylix = {
cursor = {
package = pkgs.openzone-cursors;
name = "OpenZone_White_Slim";
size = if nixosConfig.hidpi then 48 else 18;
};
inherit (nixosConfig.stylix) polarity;
targets = {
gtk.enable = true;
bat.enable = true;
dunst.enable = true;
zathura.enable = true;
xresources.enable = true;
};
};
xresources.properties = {
"Xft.hinting" = true;
"Xft.antialias" = true;
"Xft.autohint" = false;
"Xft.lcdfilter" = "lcddefault";
"Xft.hintstyle" = "hintfull";
"Xft.rgba" = "rgb";
};
gtk =
let
gtk34extraConfig = {
gtk-application-prefer-dark-theme = 1;
gtk-cursor-theme-size = 18;
gtk-enable-animations = true;
gtk-xft-antialias = 1;
gtk-xft-dpi = 96; # XXX: delete for wayland?
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintfull";
gtk-xft-rgba = "rgb";
};
in
{
enable = true;
iconTheme = {
name = "Vimix-Doder";
package = pkgs.vimix-icon-theme;
};
gtk2.extraConfig = "gtk-application-prefer-dark-theme = true";
gtk3.extraConfig = gtk34extraConfig;
gtk4.extraConfig = gtk34extraConfig;
};
home.sessionVariables.GTK_THEME = config.gtk.theme.name;
qt = {
enable = true;
platformTheme.name = "adwaita";
style.name = "Adwaita-Dark";
};
}
)
];
};
}

View file

@ -1,20 +0,0 @@
{
lib,
minimal,
pkgs,
...
}:
lib.optionalAttrs (!minimal) {
programs.gpu-screen-recorder.enable = true;
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraPkgs =
pkgs: with pkgs; [
# vampir überlebende braucht diese pkgs
libgdiplus
cups
];
};
};
}

View file

@ -1,11 +0,0 @@
{
# can't play VR until https://github.com/hyprwm/Hyprland/pull/8116 is merged
services.monado = {
enable = true;
defaultRuntime = true;
};
systemd.user.services.monado.environment = {
STEAMVR_LH_ENABLE = "1";
XRT_COMPOSITOR_COMPUTE = "1";
};
}

46
config/support/vr.nix Normal file
View file

@ -0,0 +1,46 @@
{ pkgs, ... }:
{
# can't play VR until https://github.com/hyprwm/Hyprland/pull/8116 is merged
services.monado = {
enable = true;
defaultRuntime = true;
};
systemd.user.services.monado.environment = {
STEAMVR_LH_ENABLE = "1";
XRT_COMPOSITOR_COMPUTE = "1";
};
hm =
{ config, ... }:
{
home.packages = [ pkgs.wlx-overlay-s ];
xdg.configFile."openxr/1/active_runtime.json".text = ''
{
"file_format_version": "1.0.0",
"runtime": {
"name": "Monado",
"library_path": "${pkgs.monado}/lib/libopenxr_monado.so"
}
}
'';
xdg.configFile."openvr/openvrpaths.vrpath".text = ''
{
"config" :
[
"${config.xdg.dataHome}/Steam/config"
],
"external_drivers" : null,
"jsonid" : "vrpathreg",
"log" :
[
"${config.xdg.dataHome}/Steam/logs"
],
"runtime" :
[
"${pkgs.opencomposite}/lib/opencomposite"
],
"version" : 1
}
'';
};
}

View file

@ -13,22 +13,16 @@
../../config/basic ../../config/basic
../../config/hardware/bluetooth.nix ../../config/support/bluetooth.nix
../../config/hardware/nintendo.nix ../../config/support/nintendo.nix
../../config/hardware/nvidia.nix ../../config/support/nvidia.nix
../../config/hardware/physical.nix ../../config/support/physical.nix
../../config/hardware/pipewire.nix ../../config/support/pipewire.nix
../../config/hardware/yubikey.nix ../../config/support/printing.nix
../../config/support/secureboot.nix
../../config/optional/dev.nix ../../config/support/vr.nix
../../config/optional/graphical.nix ../../config/support/yubikey.nix
../../config/optional/printing.nix ../../config/support/zfs.nix
../../config/optional/secureboot.nix
../../config/optional/steam.nix
../../config/optional/xserver.nix
../../config/optional/wayland.nix
../../config/optional/vr.nix
../../config/optional/zfs.nix
./net.nix ./net.nix
./fs.nix ./fs.nix

View file

@ -13,11 +13,10 @@
../../config/basic ../../config/basic
../../config/optional/initrd-ssh.nix ../../config/support/initrd-ssh.nix
../../config/optional/secureboot.nix ../../config/support/physical.nix
../../config/optional/zfs.nix ../../config/support/secureboot.nix
../../config/support/zfs.nix
../../config/hardware/physical.nix
./net.nix ./net.nix
./fs.nix ./fs.nix

View file

@ -1,9 +1,9 @@
{ {
imports = [ imports = [
../../config/basic ../../config/basic
../../config/optional/initrd-ssh.nix ../../config/support/initrd-ssh.nix
../../config/services/maddy.nix ../../config/services/maddy.nix
../../config/optional/zfs.nix ../../config/support/zfs.nix
./net.nix ./net.nix
./fs.nix ./fs.nix

View file

@ -10,33 +10,27 @@
../../config/basic ../../config/basic
../../config/hardware/bluetooth.nix ../../config/support/bluetooth.nix
../../config/hardware/laptop.nix ../../config/support/laptop.nix
../../config/hardware/nvidia.nix ../../config/support/nvidia.nix
../../config/hardware/physical.nix ../../config/support/physical.nix
../../config/hardware/pipewire.nix ../../config/support/pipewire.nix
../../config/hardware/prime-offload.nix ../../config/support/prime-offload.nix
../../config/hardware/yubikey.nix ../../config/support/printing.nix
../../config/support/secureboot.nix
../../config/optional/dev.nix ../../config/support/yubikey.nix
../../config/optional/graphical.nix ../../config/support/zfs.nix
../../config/optional/printing.nix
../../config/optional/secureboot.nix
../../config/optional/steam.nix
../../config/optional/wayland.nix
../../config/optional/zfs.nix
./net.nix ./net.nix
./fs.nix ./fs.nix
../../users/patrick #../../users/patrick
]; ];
stylix.fonts.sizes = { stylix.fonts.sizes = {
terminal = 9; terminal = 9;
applications = 9; applications = 9;
desktop = 8; desktop = 8;
}; };
hidpi = true;
services = { services = {
xserver.xkb = { xserver.xkb = {
layout = "de"; layout = "de";

View file

@ -10,10 +10,10 @@
inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.nixos-hardware.nixosModules.common-pc-ssd
../../config/basic ../../config/basic
../../config/optional/initrd-ssh.nix
../../config/hardware/physical.nix ../../config/support/initrd-ssh.nix
../../config/optional/zfs.nix ../../config/support/physical.nix
../../config/support/zfs.nix
./net.nix ./net.nix
./fs.nix ./fs.nix

40
modules-hm/hm-all.nix Normal file
View file

@ -0,0 +1,40 @@
{ config, lib, ... }:
let
inherit (lib)
mkOption
mkOptionType
types
mkIf
;
in
{
options = {
primaryUser = mkOption {
description = "Home-manager primary Username";
type = types.nullOr types.str;
default = null;
};
hm = mkOption {
description = "Home-manager options for the main user";
type = mkOptionType {
name = "Home-manager options for the main user";
merge = _loc: defs: (map (x: x.value) defs);
};
};
hm-all = mkOption {
description = "Home-manager options for the primary User and root.";
type = mkOptionType {
name = "Home-manager options for the all users";
merge = _loc: defs: (map (x: x.value) defs);
};
};
};
config.home-manager.users = mkIf (config.primaryUser != null) {
${config.primaryUser} = {
imports = config.hm ++ config.hm-all;
};
root = {
imports = config.hm-all;
};
};
}

View file

@ -65,24 +65,4 @@ in
''; '';
}; };
}; };
config.home-manager.sharedModules = [
(
{ config, ... }:
{
options = {
userSecretsFile = mkOption {
default = ../users/${config._module.args.name}/secrets.nix.age;
type = types.path;
description = "The global secrets attribute that should be exposed to the user";
};
userSecrets = mkOption {
readOnly = true;
default = importEncrypted config.userSecretsFile inputs;
type = types.unspecified;
description = "User secrets";
};
};
}
)
];
} }

View file

@ -1,77 +0,0 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
cacert,
gitMinimal,
nodejs,
yarn,
}:
stdenv.mkDerivation rec {
pname = "actual-server";
version = "24.10.1";
src = fetchFromGitHub {
owner = "actualbudget";
repo = "actual-server";
rev = "v${version}";
hash = "sha256-VJAD+lNamwuYmiPJLXkum6piGi5zLOHBp8cUeZagb4s=";
};
# we cannot use fetchYarnDeps because that doesn't support yarn 2/berry lockfiles
offlineCache = stdenv.mkDerivation {
name = "actual-server-${version}-offline-cache";
inherit src;
nativeBuildInputs = [
cacert # needed for git
gitMinimal # needed to download git dependencies
yarn
];
buildPhase = ''
export HOME=$(mktemp -d)
yarn config set enableTelemetry 0
yarn config set cacheFolder $out
yarn config set --json supportedArchitectures.os '[ "linux" ]'
yarn config set --json supportedArchitectures.cpu '[ "x64" ]'
yarn
'';
installPhase = ''
mkdir -p $out
cp -r ./node_modules $out/node_modules
'';
dontFixup = true;
outputHashMode = "recursive";
outputHash = "sha256-siq3JnM0FFmXj5iX48E1A8X0lbdHM9NNCjOcg0Pwg5I=";
};
nativeBuildInputs = [
makeWrapper
yarn
];
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r ${offlineCache}/node_modules/ $out/
cp -r ./ $out
mkdir -p $out/bin
makeWrapper ${lib.getExe nodejs} "$out/bin/actual-server" \
--add-flags "$out/app.js" --set NODE_PATH "$out/node_modules" \
runHook postInstall
'';
meta = with lib; {
description = "A super fast privacy-focused app for managing your finances";
homepage = "https://actualbudget.com/";
license = licenses.mit;
mainProgram = "actual-server";
maintainers = with maintainers; [ patrickdag ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -3,7 +3,6 @@ _inputs: [
(_final: prev: { (_final: prev: {
zsh-histdb-skim = prev.callPackage ./zsh-histdb-skim.nix { }; zsh-histdb-skim = prev.callPackage ./zsh-histdb-skim.nix { };
zsh-histdb = prev.callPackage ./zsh-histdb.nix { }; zsh-histdb = prev.callPackage ./zsh-histdb.nix { };
actual = prev.callPackage ./actual.nix { };
pr-tracker = prev.callPackage ./pr-tracker.nix { }; pr-tracker = prev.callPackage ./pr-tracker.nix { };
deploy = prev.callPackage ./deploy.nix { }; deploy = prev.callPackage ./deploy.nix { };
signal-to-blog = prev.callPackage ./signal-to-blog.nix { }; signal-to-blog = prev.callPackage ./signal-to-blog.nix { };

View file

@ -1,62 +0,0 @@
{
lib,
buildNpmPackage,
nodePackages,
fetchFromGitHub,
runtimeShell,
}:
# We just package the JS frontend part, not the Python reverse-proxy backend.
# NixOS can provide any another reverse proxy such as nginx.
buildNpmPackage rec {
pname = "ollama-webui";
# ollama-webui doesn't tag versions yet.
version = "0.0.0-unstable-2023-12-22";
src = fetchFromGitHub {
owner = "ollama-webui";
repo = "ollama-webui";
rev = "77c1a77fccb04337ff95440030cd051fd16c2cd8";
hash = "sha256-u7h2tpHgtQwYXornslY3CZjKjigqBK2mHmaiK1EoEgk=";
};
# dependencies are downloaded into a separate node_modules Nix package
npmDepsHash = "sha256-SI2dPn1SwbGwl8093VBtcDsA2eHSxr3UUC+ta68w2t8=";
# We have to bake in the default URL it will use for ollama webserver here,
# but it can be overriden in the UI later.
PUBLIC_API_BASE_URL = "http://localhost:11434/api";
# The path '/ollama/api' will be redirected to the specified backend URL
OLLAMA_API_BASE_URL = PUBLIC_API_BASE_URL;
# "npm run build" creates a static page in the "build" folder.
installPhase = ''
mkdir -p $out/lib
cp -R ./build/. $out/lib
mkdir -p $out/bin
cat <<EOF >>$out/bin/${pname}
#!${runtimeShell}
${nodePackages.http-server}/bin/http-server $out/lib "\$@"
EOF
chmod +x $out/bin/${pname}
'';
meta = with lib; {
description = "ChatGPT-Style Web Interface for Ollama";
longDescription = ''
Tools like Ollama make open-source large langue models (LLM) accessible and almost
trivial to download and run them locally on a consumer computer.
However, Ollama only runs in a terminal and doesn't store any chat history.
Ollama-WebUI is a web frontend on top of Ollama that looks and behaves similar to ChatGPT's web frontend.
You can have separate chats with different LLMs that are saved in your browser,
automatic Markdown and Latex rendering, upload files etc.
This package contains two parts:
- `<nix-store-package-path>/lib` The WebUI as a compiled, static html folder to bundle in your web server
- `<nix-store-package-path>/bin/${pname}` A runnable webserver the serves the WebUI for convenience.
'';
homepage = "https://github.com/ollama-webui/ollama-webui";
license = licenses.mit;
mainProgram = pname;
maintainers = with maintainers; [ malteneuss ];
platforms = platforms.all;
};
}

Binary file not shown.

View file

@ -7,4 +7,7 @@
dpi = 1; dpi = 1;
}; };
}; };
hm.home.persistence."/state".files = [
".cache/rofi3.druncache"
];
} }

246
users/common/Xorg/sway3.nix Normal file
View file

@ -0,0 +1,246 @@
{
config,
lib,
pkgs,
...
}:
# shared sway/i3 config
let
nixConfig = config;
in
{
hm =
{ config, ... }:
let
modifier = "Mod4";
down = "r";
left = "n";
right = "s";
up = "l";
terminal = "kitty";
cfg = {
inherit modifier terminal;
focus = {
followMouse = false;
mouseWarping = false;
};
#bindkeysToCode = true;
window.titlebar = false;
floating.titlebar = false;
workspaceLayout = "stacking";
bars = map (x: x // config.lib.stylix.i3.bar) [
{
mode = "dock";
workspaceButtons = true;
workspaceNumbers = false;
statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs config-main.toml";
trayOutput = "primary";
}
];
floating.criteria = [ { class = "Pavucontrol"; } ];
assigns = {
"2:d" = [ { class = "^firefox$"; } ];
"2:2" = [ { class = "^spotify$"; } ];
"3:u" = [ { class = "^thunderbird$"; } ];
"4:a" = [
{ class = "^bottles$"; }
{ class = "^steam$"; }
{ class = "^prismlauncher$"; }
];
"1:F1" = [ { class = "^discord$"; } ];
"2:F2" = [
{ class = "^Signal$"; }
{ class = "^TelegramDesktop$"; }
];
};
workspaceOutputAssign =
let
output =
out:
lib.lists.imap1 (
i: x: {
workspace = "${toString i}:${x}";
output = out;
}
);
in
{
"desktopnix" =
output "HDMI-0" [
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
]
++ output "DP-4" [
"j"
"d"
"u"
"a"
"x"
"p"
]
++ output "DVI-D-0" [
"F1"
"F2"
"F3"
"F4"
];
"patricknix" =
output "eDP-1" [
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
]
++ output "DP-1" [
"j"
"d"
"u"
"a"
"x"
"p"
];
"gojo" = output "eDP-1" [
"1"
"2"
"3"
"4"
"5"
"6"
];
}
.${nixConfig.node.name} or [ ];
keybindings =
(lib.attrsets.mergeAttrsList (
map (
x:
(
let
key = lib.elemAt (lib.strings.splitString ":" x.workspace) 1;
in
{
"${modifier}+${key}" = "workspace ${x.workspace}";
"${modifier}+Shift+${key}" = "move container to workspace ${x.workspace}";
}
)
) cfg.workspaceOutputAssign
))
// {
"${modifier}+t" = "exec ${terminal}";
"${modifier}+b" = "exec firefox";
"${modifier}+m" = "exec thunderbird";
"${modifier}+q" = "kill";
"${modifier}+c" = "exec ${lib.getExe pkgs.scripts.clone-term}";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t";
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
"${modifier}+${left}" = "focus left";
"${modifier}+${down}" = "focus down";
"${modifier}+${up}" = "focus up";
"${modifier}+${right}" = "focus right";
"${modifier}+Left" = "focus left";
"${modifier}+Down" = "focus down";
"${modifier}+Up" = "focus up";
"${modifier}+Right" = "focus right";
"${modifier}+Shift+${left}" = "move left";
"${modifier}+Shift+${down}" = "move down";
"${modifier}+Shift+${up}" = "move up";
"${modifier}+Shift+${right}" = "move right";
"${modifier}+Shift+Left" = "move left";
"${modifier}+Shift+Down" = "move down";
"${modifier}+Shift+Up" = "move up";
"${modifier}+Shift+Right" = "move right";
"${modifier}+v" = "splith";
"${modifier}+udiaeresis" = "splitv";
"${modifier}+Return" = "fullscreen toggle";
"${modifier}+odiaeresis" = "layout stacking";
"${modifier}+y" = "layout tabbed";
"${modifier}+z" = "layout toggle split";
"${modifier}+f" = "floating toggle";
"${modifier}+space" = "focus mode_toggle";
"${modifier}+comma" = "workspace prev_on_output";
"${modifier}+period" = "workspace next_on_output";
};
};
in
{
wayland.windowManager.sway.config = cfg;
xsession.windowManager.i3.config = cfg;
programs.i3status-rust = {
enable = true;
bars.main = {
blocks =
[
{ block = "net"; }
{
block = "cpu";
format = " $icon $utilization ";
}
{
block = "nvidia_gpu";
format = " $icon $utilization $memory $temperature ";
}
]
++ {
"patricknix" = [ { block = "battery"; } ];
}
.${nixConfig.node.name} or [ ]
++ [
{
block = "sound";
click = [
{
button = "left";
action = "toggle_mute";
}
];
}
{
block = "backlight";
missing_format = "";
}
{
block = "time";
format = "$icon $timestamp.datetime(f:'%a %d.%m.%y %H:%M:%S') ";
interval = 1;
}
];
theme = "native";
# currently nixpgs-wayland breaks this
# icons = "material-nf";
settings = {
icons.icons = "material-nf";
icons.overrides = {
cpu = " ";
};
};
};
};
};
}

View file

@ -1,5 +1,5 @@
{ {
home.shellAliases = { hm-all.home.shellAliases = {
# Aliases # Aliases
l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto"; l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";
ll = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto"; ll = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";

View file

@ -1,14 +0,0 @@
{ minimal, lib, ... }:
{
imports = [
./shells/alias.nix
./shells/zsh
./programs/gpg.nix
] ++ lib.optional (!minimal) ./programs/htop.nix;
programs.bat.enable = true;
nixpkgs.config = {
allowUnfree = true;
};
}

View file

@ -1,23 +0,0 @@
{ pkgs, config, ... }:
{
home = {
packages = with pkgs; [
zathura
feh
mpv
pinentry-gnome3 # for yubikey pinentry
];
};
# notification are nice to have
services.dunst = {
enable = true;
settings.global = {
monitor = 1;
frame_width = 0;
highlight = config.lib.stylix.colors.withHashtag.base0C;
progress_bar_frame_width = 0;
progress_bar_corner_radius = 0;
};
};
}

View file

@ -1,240 +0,0 @@
{
config,
nixosConfig,
lib,
pkgs,
...
}:
# shared sway/i3 config
let
modifier = "Mod4";
down = "r";
left = "n";
right = "s";
up = "l";
terminal = "kitty";
cfg = {
inherit modifier terminal;
focus = {
followMouse = false;
mouseWarping = false;
};
#bindkeysToCode = true;
window.titlebar = false;
floating.titlebar = false;
workspaceLayout = "stacking";
bars = map (x: x // config.lib.stylix.i3.bar) [
{
mode = "dock";
workspaceButtons = true;
workspaceNumbers = false;
statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs config-main.toml";
trayOutput = "primary";
}
];
floating.criteria = [ { class = "Pavucontrol"; } ];
assigns = {
"2:d" = [ { class = "^firefox$"; } ];
"2:2" = [ { class = "^spotify$"; } ];
"3:u" = [ { class = "^thunderbird$"; } ];
"4:a" = [
{ class = "^bottles$"; }
{ class = "^steam$"; }
{ class = "^prismlauncher$"; }
];
"1:F1" = [ { class = "^discord$"; } ];
"2:F2" = [
{ class = "^Signal$"; }
{ class = "^TelegramDesktop$"; }
];
};
workspaceOutputAssign =
let
output =
out:
lib.lists.imap1 (
i: x: {
workspace = "${toString i}:${x}";
output = out;
}
);
in
{
"desktopnix" =
output "HDMI-0" [
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
]
++ output "DP-4" [
"j"
"d"
"u"
"a"
"x"
"p"
]
++ output "DVI-D-0" [
"F1"
"F2"
"F3"
"F4"
];
"patricknix" =
output "eDP-1" [
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
]
++ output "DP-1" [
"j"
"d"
"u"
"a"
"x"
"p"
];
"gojo" = output "eDP-1" [
"1"
"2"
"3"
"4"
"5"
"6"
];
}
.${nixosConfig.node.name} or [ ];
keybindings =
(lib.attrsets.mergeAttrsList (
map (
x:
(
let
key = lib.elemAt (lib.strings.splitString ":" x.workspace) 1;
in
{
"${modifier}+${key}" = "workspace ${x.workspace}";
"${modifier}+Shift+${key}" = "move container to workspace ${x.workspace}";
}
)
) cfg.workspaceOutputAssign
))
// {
"${modifier}+t" = "exec ${terminal}";
"${modifier}+b" = "exec firefox";
"${modifier}+m" = "exec thunderbird";
"${modifier}+q" = "kill";
"${modifier}+c" = "exec ${lib.getExe pkgs.scripts.clone-term}";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t";
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
"${modifier}+${left}" = "focus left";
"${modifier}+${down}" = "focus down";
"${modifier}+${up}" = "focus up";
"${modifier}+${right}" = "focus right";
"${modifier}+Left" = "focus left";
"${modifier}+Down" = "focus down";
"${modifier}+Up" = "focus up";
"${modifier}+Right" = "focus right";
"${modifier}+Shift+${left}" = "move left";
"${modifier}+Shift+${down}" = "move down";
"${modifier}+Shift+${up}" = "move up";
"${modifier}+Shift+${right}" = "move right";
"${modifier}+Shift+Left" = "move left";
"${modifier}+Shift+Down" = "move down";
"${modifier}+Shift+Up" = "move up";
"${modifier}+Shift+Right" = "move right";
"${modifier}+v" = "splith";
"${modifier}+udiaeresis" = "splitv";
"${modifier}+Return" = "fullscreen toggle";
"${modifier}+odiaeresis" = "layout stacking";
"${modifier}+y" = "layout tabbed";
"${modifier}+z" = "layout toggle split";
"${modifier}+f" = "floating toggle";
"${modifier}+space" = "focus mode_toggle";
"${modifier}+comma" = "workspace prev_on_output";
"${modifier}+period" = "workspace next_on_output";
};
};
in
{
wayland.windowManager.sway.config = cfg;
xsession.windowManager.i3.config = cfg;
programs.i3status-rust = {
enable = true;
bars.main = {
blocks =
[
{ block = "net"; }
{
block = "cpu";
format = " $icon $utilization ";
}
{
block = "nvidia_gpu";
format = " $icon $utilization $memory $temperature ";
}
]
++ {
"patricknix" = [ { block = "battery"; } ];
}
.${nixosConfig.node.name} or [ ]
++ [
{
block = "sound";
click = [
{
button = "left";
action = "toggle_mute";
}
];
}
{
block = "backlight";
missing_format = "";
}
{
block = "time";
format = "$icon $timestamp.datetime(f:'%a %d.%m.%y %H:%M:%S') ";
interval = 1;
}
];
theme = "native";
# currently nixpgs-wayland breaks this
# icons = "material-nf";
settings = {
icons.icons = "material-nf";
icons.overrides = {
cpu = " ";
};
};
};
};
}

View file

@ -1,16 +0,0 @@
{ pkgs, ... }:
{
imports = [
../.
./fuzzel.nix
./sway.nix
./hyprland.nix
./waybar
./swaync
./swww.nix
];
home.packages = with pkgs; [
wdisplays
wl-clipboard
];
}

View file

@ -1,11 +0,0 @@
{
stylix.targets.fuzzel.enable = true;
programs.fuzzel = {
enable = true;
settings = {
main = {
launch-prefix = "uwsm app --";
};
};
};
}

View file

@ -1,306 +0,0 @@
{
pkgs,
lib,
nixosConfig,
...
}:
let
inherit (lib)
mkMerge
optionals
elem
mkIf
flip
concatMap
;
#from https://github.com/hyprwm/Hyprland/issues/3835
float_script = pkgs.writeShellScript "hyprland-bitwarden-float" ''
handle() {
case $1 in
windowtitle*)
# Extract the window ID from the line
window_id=''${1#*>>}
# Fetch the list of windows and parse it using jq to find the window by its decimal ID
window_info=$(hyprctl clients -j | ${pkgs.jq}/bin/jq --arg id "0x$window_id" '.[] | select(.address == ($id))')
# Extract the title from the window info
window_title=$(echo "$window_info" | ${pkgs.jq}/bin/jq '.title')
# Check if the title matches the characteristics of the Bitwarden popup window
if [[ "$window_title" == '"Extension: (Bitwarden Password Manager) - Bitwarden Mozilla Firefox"' ]]; then
# echo $window_id, $window_title
# hyprctl dispatch togglefloating address:0x$window_id
# hyprctl dispatch resizewindowpixel exact 20% 40%,address:0x$window_id
# hyprctl dispatch movewindowpixel exact 40% 30%,address:0x$window_id
hyprctl dispatch togglefloating address:0x$window_id
hyprctl dispatch resizewindowpixel exact "512 768",address:0x$window_id
hyprctl dispatch movewindowpixel exact "$HYPRLAND_FLOAT_LOCATION",address:0x$window_id
fi
;;
esac
}
# Listen to the Hyprland socket for events and process each line with the handle function
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
'';
in
{
# UWSM starts a SH to read env variables
# this ensures all home.sessionVars are exported
programs.bash.enable = true;
wayland.windowManager.hyprland = {
enable = true;
settings = mkMerge [
{
input = {
kb_layout = "de";
kb_variant = "nodeadkeys";
follow_mouse = 2;
numlock_by_default = true;
repeat_rate = 60;
repeat_delay = 235;
# Only change focus on mouse click
float_switch_override_focus = 0;
accel_profile = "flat";
touchpad = {
natural_scroll = true;
disable_while_typing = true;
scroll_factor = 0.7;
};
};
device = {
name = "xp-pen-g430s-pen";
active_area_size = "48 27";
};
gestures = {
workspace_swipe = true;
};
general = {
gaps_in = 0;
gaps_out = 0;
allow_tearing = true;
};
#render = {
# explicit_sync = 0;
# direct_scanout = false;
#};
binds = {
focus_preferred_method = 1;
workspace_center_on = 1;
};
bind =
let
monitor_binds = {
"1" = "j";
"2" = "d";
"3" = "u";
"4" = "a";
"5" = "x";
"6" = "F1";
"7" = "F2";
"8" = "F3";
"9" = "F4";
};
in
[
"SUPER,q,killactive,"
"SUPER,return,fullscreen,"
"SUPER + SHIFT,return,fullscreenstate,2,0,"
"SUPER,f,togglefloating"
"SUPER,g,togglegroup"
"SUPER,tab,cyclenext,"
"ALT,tab,cyclenext,"
"SUPER+CTRL,r,submap,resize"
"SUPER,left,movefocus,l"
"SUPER,right,movefocus,r"
"SUPER,up,movefocus,u"
"SUPER,down,movefocus,d"
"SUPER,n,movefocus,l"
"SUPER,s,movefocus,r"
"SUPER,l,movefocus,u"
"SUPER,r,movefocus,d"
"SUPER,h,changegroupactive,b"
"SUPER,m,changegroupactive,f"
"SUPER + SHIFT,left,movewindoworgroup,l"
"SUPER + SHIFT,right,movewindoworgroup,r"
"SUPER + SHIFT,up,movewindoworgroup,u"
"SUPER + SHIFT,down,movewindoworgroup,d"
"SUPER + SHIFT,n,movewindoworgroup,l"
"SUPER + SHIFT,s,movewindoworgroup,r"
"SUPER + SHIFT,l,movewindoworgroup,u"
"SUPER + SHIFT,r,movewindoworgroup,d"
"SUPER,comma,workspace,-1"
"SUPER,period,workspace,+1"
"SUPER + SHIFT,comma,movetoworkspace,-1"
"SUPER + SHIFT,period,movetoworkspace,+1"
"SUPER,b,exec,uwsm app -- firefox"
"SUPER,t,exec,uwsm app -- kitty"
",Menu,exec,fuzzel"
"SUPER,c,exec,${lib.getExe pkgs.scripts.clone-term}"
"CTRL,F7,pass,class:^(discord)$"
"CTRL,F8,pass,class:^(discord)$"
"CTRL,F7,pass,class:^(TeamSpeak 3)$"
"CTRL,F8,pass,class:^(TeamSpeak 3)$"
"CTRL,F9,exec,systemctl --user start swww-update-wallpaper"
"SUPER + SHIFT,q,exec,uwsm stop"
]
++ flip concatMap (map toString (lib.lists.range 1 9)) (x: [
"SUPER,${monitor_binds."${x}"},workspace,${x}"
"SUPER + SHIFT,${monitor_binds."${x}"},movetoworkspacesilent,${x}"
]);
cursor.no_warps = true;
debug.disable_logs = false;
env =
[
"NIXOS_OZONE_WL,1"
"MOZ_ENABLE_WAYLAND,1"
"_JAVA_AWT_WM_NONREPARENTING,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_QPA_PLATFORM,wayland;xcb"
"GDK_BACKEND,wayland"
"WLR_DRM_NO_ATOMIC,1" # retest on newest nvidia driver
"XDG_SESSION_TYPE,wayland"
"TERMINAL,uwsm app -- kitty"
]
++ optionals (elem "nvidia" nixosConfig.services.xserver.videoDrivers) [
# See https://wiki.hyprland.org/Nvidia/
"LIBVA_DRIVER_NAME,nvidia"
"GBM_BACKEND,nvidia-drm"
];
bindm = [
# mouse movements
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
"SUPER ALT, mouse:272, resizewindow"
];
animations = {
enabled = true;
animation = [
"windows, 1, 4, default, slide"
"windowsOut, 1, 4, default, slide"
"windowsMove, 1, 4, default"
"border, 1, 2, default"
"fade, 1, 4, default"
"fadeDim, 1, 4, default"
"workspaces, 1, 4, default"
];
};
decoration.rounding = 4;
exec-once = [
"${pkgs.swaynotificationcenter}/bin/swaync"
];
misc = {
vrr = 1;
disable_hyprland_logo = true;
mouse_move_focuses_monitor = false;
};
xwayland.force_zero_scaling = true;
windowrulev2 = [
# fix these once nvidia gets their shit together
#"immediate, class:^(cs2)$"
# apex legends
"immediate, class:^(steam_app_1172470)$"
#???
"immediate, class:^(steam_app_238960)$"
#baldur
#"immediate, class:^(steam_app_1086940)$"
"float, class:^(steam)$, title:^(Friends List)"
"float, class:^(steam)$, title:(Chat)"
"float, class:^(streamlink-twitch-gui)$"
"workspace 2,class:^(firefox)$"
"workspace 3,class:^(thunderbird)$"
"workspace 4,class:^(bottles)$"
"workspace 4,class:^(steam)$, title:^(Steam)"
"workspace 4,class:^(prismlauncher)$"
"workspace 6,class:^(discord)$"
"workspace 6,class:^(WebCord)$"
"workspace 6,class:^(TeamSpeak 3)$"
"workspace 7,class:^(signal)$"
"workspace 7,class:^(TelegramDesktop)$"
];
}
(mkIf (nixosConfig.node.name == "desktopnix") {
input.tablet = {
output = "DP-3";
};
monitor = [
"DVI-D-1,preferred,0x0,1"
"HDMI-A-1,preferred,0x1080,1"
"DP-3,2560x1440@144.00Hz,1920x540,1"
# Thank you NVIDIA for this generous, free-of-charge, extra monitor that
# doesn't exist and crashes yoru session sometimes when moving a window to it.
"Unknown-1, disable"
];
workspace = [
"1, monitor:DP-3, default:true"
"2, monitor:DP-3"
"3, monitor:DP-3"
"4, monitor:DP-3"
"5, monitor:DP-3"
"6, monitor:DVI-D-1, default:true"
"7, monitor:DVI-D-1"
"8, monitor:HDMI-A-1, default: true"
"9, monitor:HDMI-A-1"
];
env = [ "HYPRLAND_FLOAT_LOCATION,3800 680" ];
})
(mkIf (nixosConfig.node.name == "patricknix") {
monitor = [
"eDP-1,preferred,0x0,2"
# Thank you NVIDIA for this generous, free-of-charge, extra monitor that
# doesn't exist and crashes yoru session sometimes when moving a window to it.
"Unknown-1, disable"
];
workspace = [
"1, monitor:eDP-1, default:true"
"2, monitor:eDP-1"
"3, monitor:eDP-1"
"4, monitor:eDP-1"
"5, monitor:eDP-1"
"6, monitor:eDP-1"
"7, monitor:eDP-1"
"8, monitor:eDP-1"
"9, monitor:eDP-1"
];
env = [ "HYPRLAND_FLOAT_LOCATION,1400 200" ];
})
];
extraConfig = ''
submap=resize
binde=,right,resizeactive,80 0
binde=,left,resizeactive,-80 0
binde=,up,resizeactive,0 -80
binde=,down,resizeactive,0 80
binde=SHIFT,right,resizeactive,10 0
binde=SHIFT,left,resizeactive,-10 0
binde=SHIFT,up,resizeactive,0 -10
binde=SHIFT,down,resizeactive,0 10
bind=,return,submap,reset
bind=,escape,submap,reset
submap=reset
exec-once = ${pkgs.xorg.xprop}/bin/xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
exec-once = ${float_script}
env = XCURSOR_SIZE,48
exec-once = uwsm finalize
'';
};
}

View file

@ -1,101 +0,0 @@
{ config, nixosConfig, ... }:
{
# import shared i3 config
imports = [ ../sway3.nix ];
stylix.targets.sway.enable = true;
wayland.windowManager.sway = {
enable = true;
config =
{
menu = "fuzzel";
startup = [
# for games to work input 1 has to be qwerts
# but i would like to have bone as my layout
{
command = "swaymsg input \"*\" xkb_switch_layout 1";
always = true;
}
{ command = "uwsm finalize"; }
];
input = {
"*" = {
xkb_layout = "de,de,de";
# games are stupid so the main ui has to be de() without bone
xkb_variant = ",bone,neo";
xkb_options = "grp:win_space_toggle";
repeat_delay = "235";
repeat_rate = "60";
accel_profile = "flat";
pointer_accel = "0.3";
tap = "enabled";
};
"type:touchpad" = {
pointer_accel = "0.5";
natural_scroll = "enabled";
};
"type:touch" = {
map_to_output = "eDP-1";
};
"type:tablet_tool" = {
map_to_output = "eDP-1";
};
};
keybindings =
let
cfg = config.wayland.windowManager.sway.config;
in
{
"Menu" = "exec ${cfg.menu}";
};
}
// {
desktopnix = {
output = {
DVI-D-1 = {
mode = "1920x1080@60Hz";
pos = "0,0";
};
HDMI-A-1 = {
mode = "1920x1080@60Hz";
pos = "0,1080";
};
DP-3 = {
mode = "2560x1440@143.998Hz";
pos = "1920,720";
adaptive_sync = "on";
};
};
};
patricknix = {
output = {
"Acer Technologies XB271HU #ASP7ytE/6A7d" = {
mode = "2560x1440@59.951Hz";
pos = "0,0";
};
"AU Optronics 0x30EB Unknown" = {
mode = "3840x2160@60.002Hz";
pos = "2560,0";
scale = "2";
};
};
};
}
.${nixosConfig.node.name} or { };
extraConfig =
let
cfg = config.wayland.windowManager.sway.config;
in
''
bindgesture swipe:3:left workpace next
bindgesture swipe:3:right workpace prev
bindgesture pinch:4:outward exec ${cfg.menu}
'';
};
# Cursor invisible
home.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = 1;
NIXOS_OZONE_WL = 1;
# opengl backend flickers, also vulkan is love.
#WLR_RENDERER = "vulkan";
};
}

View file

@ -1,26 +0,0 @@
{
config,
lib,
nixosConfig,
...
}:
{
home.persistence."/state" = {
files =
with lib.lists;
[
".ssh/known_hosts"
".cache/fuzzel"
]
++ optionals config.programs.rofi.enable [ ".cache/rofi3.druncache" ];
directories =
with lib.lists;
[ ".config/dconf" ]
++ optionals config.programs.direnv.enable [ ".local/share/direnv" ]
++ optionals config.programs.nushell.enable [ ".config/nushell" ]
++ optionals nixosConfig.services.pipewire.enable [
# persist sound config
".local/state/wireplumber"
];
};
}

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ hm.home.packages = with pkgs; [
bottles bottles
winetricks winetricks
wineWowPackages.fonts wineWowPackages.fonts
@ -8,4 +8,9 @@
]; ];
# To enable dark mode use the command: # To enable dark mode use the command:
# dconf write /com/usebottles/bottles/dark-theme true # dconf write /com/usebottles/bottles/dark-theme true
hm.home.persistence."/state".directories = [
# bottles state games
".local/share/bottles"
];
} }

View file

@ -1,6 +1,9 @@
{ {
programs.direnv = { hm.programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
hm.home.persistence."/state".directories = [
".local/share/direnv"
];
} }

View file

@ -15,7 +15,7 @@ let
envStr = concatStringsSep " " (mapAttrsToList (n: v: "${n}=${escapeShellArg v}") env); envStr = concatStringsSep " " (mapAttrsToList (n: v: "${n}=${escapeShellArg v}") env);
in in
{ {
programs.firefox = { hm.programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox.overrideAttrs (old: { package = pkgs.firefox.overrideAttrs (old: {
buildCommand = buildCommand =
@ -26,12 +26,12 @@ in
''; '';
}); });
}; };
home.persistence."/state".directories = [ hm.home.persistence."/state".directories = [
".cache/mozilla" ".cache/mozilla"
".mozilla" ".mozilla"
]; ];
xdg.mimeApps.enable = true; hm.xdg.mimeApps.enable = true;
xdg.mimeApps.defaultApplications = { hm.xdg.mimeApps.defaultApplications = {
"text/html" = [ "firefox.desktop" ]; "text/html" = [ "firefox.desktop" ];
"text/xml" = [ "firefox.desktop" ]; "text/xml" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ]; "x-scheme-handler/http" = [ "firefox.desktop" ];

View file

@ -13,6 +13,7 @@ let
); );
in in
{ {
hm = {
home.packages = [ pwndbgWithDebuginfod ]; home.packages = [ pwndbgWithDebuginfod ];
home.enableDebugInfo = true; home.enableDebugInfo = true;
xdg.configFile.gdbinit = { xdg.configFile.gdbinit = {
@ -30,4 +31,5 @@ in
}; };
home.persistence."/state".directories = [ ".local/share/gdb" ]; home.persistence."/state".directories = [ ".local/share/gdb" ];
};
} }

View file

@ -26,6 +26,7 @@ let
); );
in in
{ {
hm = {
programs.gitui.enable = true; programs.gitui.enable = true;
programs.git = { programs.git = {
enable = true; enable = true;
@ -64,4 +65,5 @@ in
signByDefault = true; signByDefault = true;
}; };
}; };
};
} }

View file

@ -1,12 +1,12 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
services.gpg-agent = { hm.services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
pinentryPackage = pkgs.pinentry-gnome3; pinentryPackage = pkgs.pinentry-gnome3;
}; };
programs.gpg = { hm.programs.gpg = {
enable = true; enable = true;
scdaemonSettings.disable-ccid = true; scdaemonSettings.disable-ccid = true;
settings = { settings = {

View file

@ -1,7 +1,7 @@
{ {
lib, lib,
pkgs, pkgs,
nixosConfig, config,
... ...
}: }:
let let
@ -88,11 +88,12 @@ let
}; };
in in
{ {
lib.gpu-screen-recorder = { programs.gpu-screen-recorder.enable = true;
hm.lib.gpu-screen-recorder = {
inherit save-replay; inherit save-replay;
}; };
systemd.user.services.gpu-screen-recorder = { hm.systemd.user.services.gpu-screen-recorder = {
#Install.WantedBy = ["graphical-session.target"]; #Install.WantedBy = ["graphical-session.target"];
Unit = { Unit = {
Description = "GPU Screen Recorder Service"; Description = "GPU Screen Recorder Service";
@ -113,8 +114,8 @@ in
"GSR_COLOR_RANGE=full" "GSR_COLOR_RANGE=full"
"GSR_FPSPPS=no" "GSR_FPSPPS=no"
] ]
++ lib.optionals (nixosConfig.node.name == "kroma") [ ++ lib.optionals (config.node.name == "desktopnix") [
"GSR_WINDOW=DP-2" # Primary monitor "GSR_WINDOW=DP-3" # Primary monitor
]; ];
ExecStart = lib.getExe start-service; ExecStart = lib.getExe start-service;

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
programs.htop = { hm-all.programs.htop = {
enable = true; enable = true;
settings = settings =
{ {

View file

@ -1,7 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
stylix.targets.kitty.enable = true; hm.stylix.targets.kitty.enable = true;
programs.kitty = { hm.programs.kitty = {
enable = true; enable = true;
package = pkgs.kitty.overrideAttrs (_finalAttrs: _prevAttrs: { doCheck = false; }); package = pkgs.kitty.overrideAttrs (_finalAttrs: _prevAttrs: { doCheck = false; });
settings = { settings = {

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.persistence."/persist".directories = [ ".local/share/PrismLauncher" ]; hm.home.persistence."/persist".directories = [ ".local/share/PrismLauncher" ];
home.packages = [ pkgs.prismlauncher ]; hm.home.packages = [ pkgs.prismlauncher ];
} }

View file

@ -8,4 +8,7 @@
configFile.source = ./config.nu; configFile.source = ./config.nu;
envFile.source = ./env.nu; envFile.source = ./env.nu;
}; };
home.persistence."/state" = {
directories = [ ".config/nushell" ];
};
} }

View file

@ -1,10 +1,11 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./nixvim/keybinds.nix ./keybinds.nix
./nixvim/options.nix ./options.nix
./nixvim/plugins.nix ./plugins.nix
]; ];
hm = {
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;
luaLoader.enable = true; luaLoader.enable = true;
@ -55,4 +56,5 @@
".local/state/nvim" ".local/state/nvim"
".cache/nvim" ".cache/nvim"
]; ];
};
} }

View file

@ -5,7 +5,7 @@ let
}; };
in in
{ {
programs.nixvim.keymaps = [ hm.programs.nixvim.keymaps = [
{ {
key = "<M-down>"; key = "<M-down>";
action = "<C-w><down>"; action = "<C-w><down>";

View file

@ -1,5 +1,5 @@
{ {
programs.nixvim.opts = { hm.programs.nixvim.opts = {
# Set maximum undo levels # Set maximum undo levels
undolevels = 1000000; undolevels = 1000000;
# Persistent Undo # Persistent Undo

View file

@ -5,7 +5,7 @@
./plugins/alpha.nix ./plugins/alpha.nix
./plugins/neo-tree.nix ./plugins/neo-tree.nix
]; ];
programs.nixvim.plugins = { hm.programs.nixvim.plugins = {
web-devicons.enable = true; web-devicons.enable = true;
which-key.enable = true; which-key.enable = true;
lualine = { lualine = {

View file

@ -1,5 +1,5 @@
{ {
programs.nixvim.plugins.alpha = { hm.programs.nixvim.plugins.alpha = {
enable = true; enable = true;
layout = layout =
let let

View file

@ -1,5 +1,5 @@
{ {
programs.nixvim.plugins = { hm.programs.nixvim.plugins = {
luasnip = { luasnip = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
programs.nixvim.plugins = { hm.programs.nixvim.plugins = {
none-ls = { none-ls = {
enable = true; enable = true;
sources = { sources = {

View file

@ -1,5 +1,5 @@
{ {
programs.nixvim.plugins.neo-tree = { hm.programs.nixvim.plugins.neo-tree = {
enable = true; enable = true;
sortCaseInsensitive = true; sortCaseInsensitive = true;
usePopupsForInput = false; usePopupsForInput = false;

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.obs-studio = { hm.programs.obs-studio = {
enable = true; enable = true;
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
#obs-backgroundremoval #obs-backgroundremoval
@ -9,4 +9,7 @@
obs-nvfbc obs-nvfbc
]; ];
}; };
hm.home.persistence."/state".directories = [
".config/obs-studio"
];
} }

View file

@ -66,5 +66,5 @@ let
); );
in in
{ {
home.sessionVariables.MANPAGER = "${exe} '+Man!'"; hm.home.sessionVariables.MANPAGER = "${exe} '+Man!'";
} }

View file

@ -1,10 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.persistence."/state".directories = [ ".config/awakened-poe-trade" ]; hm.home.persistence."/state".directories = [ ".config/awakened-poe-trade" ];
home.persistence."/persist".directories = [ ".local/share/pobfrontend" ]; hm.home.persistence."/persist".directories = [ ".local/share/pobfrontend" ];
home.packages = [ hm.home.packages = [
#pkgs.awakened-poe-trade #pkgs.awakened-poe-trade
pkgs.path-of-building pkgs.path-of-building
]; ];

View file

@ -1,6 +1,9 @@
{ spicePkgs, ... }: { inputs, pkgs, ... }:
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{ {
programs.spicetify = { hm.programs.spicetify = {
enable = true; enable = true;
theme = spicePkgs.themes.retroBlur; theme = spicePkgs.themes.retroBlur;
colorScheme = "Purple"; colorScheme = "Purple";

View file

@ -0,0 +1,35 @@
{
pkgs,
lib,
config,
...
}:
{
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraPkgs =
pkgs: with pkgs; [
# vampir überlebende braucht diese pkgs
libgdiplus
cups
];
};
};
hm.home.persistence = {
"/state".directories = [
# Folders for steam
".local/share/Steam"
".steam"
# Ken follets pillars of earth
".local/share//Daedalic Entertainment GmbH/"
# Nvidia shader cache
".cache/nvidia"
# Vulkan shader cache
".local/share/vulkan"
];
"/panzer/state".directories = lib.lists.optionals (config.disko.devices.zpool ? "panzer") [
".local/share/SteamPanzer"
];
};
}

View file

@ -1,6 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
accounts.email.accounts = lib.flip lib.mapAttrs' config.userSecrets.accounts.email ( hm = {
accounts.email.accounts = lib.flip lib.mapAttrs' config.secrets.secrets.global.user.accounts.email (
_: v: _: v:
lib.nameValuePair v.address ( lib.nameValuePair v.address (
lib.recursiveUpdate v { lib.recursiveUpdate v {
@ -78,4 +79,5 @@
"x-scheme-handler/mid" = [ "thunderbird.desktop" ]; "x-scheme-handler/mid" = [ "thunderbird.desktop" ];
"message/rfc822" = [ "thunderbird.desktop" ]; "message/rfc822" = [ "thunderbird.desktop" ];
}; };
};
} }

View file

@ -0,0 +1,68 @@
{ pkgs, ... }:
{
imports = [ ./starfish.nix ];
# save history in xdg data home
hm-all =
{ config, ... }:
{
home.sessionVariables.HISTDB_FILE = "${config.xdg.dataHome}/zsh/history.db";
# has to be enabled to support zsh reverse search
programs.fzf.enable = true;
programs.carapace = {
enable = false;
# this would source all completers sadly some are worse than the builtin completers
enableZshIntegration = false;
};
programs.zoxide.enable = true;
programs.nix-index.enable = true;
programs.nix-index.enableZshIntegration = false;
programs.nix-index-database.comma.enable = true;
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
extended = true;
path = "${config.xdg.dataHome}/zsh/zsh_history";
save = 1000000;
share = false;
};
initExtra = builtins.readFile ./zshrc;
# This needs to be loaded befor zsh-fast-syntax-highlighting
# is sourced as that overwrites all widgets to redraw with highlighting
initExtraFirst = ''
if autoload history-search-end; then
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
fi
'';
plugins = [
{
name = "fzf-tab";
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
}
{
name = "fast-syntax-highlighting";
src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions";
}
{
name = "zsh-histdb";
src = pkgs.zsh-histdb;
}
{
name = "zsh-histdb-skim";
src = pkgs.zsh-histdb-skim;
}
];
};
home.persistence."/state".directories = [
".local/share/zsh"
".local/share/zoxide"
];
};
}

View file

@ -1,6 +1,6 @@
{ lib, ... }: { lib, ... }:
{ {
programs.starship = { hm-all.programs.starship = {
enable = true; enable = true;
settings = { settings = {
add_newline = false; add_newline = false;

View file

@ -1,65 +0,0 @@
{ pkgs, config, ... }:
{
imports = [ ../starfish.nix ];
# save history in xdg data home
home.sessionVariables.HISTDB_FILE = "${config.xdg.dataHome}/zsh/history.db";
# has to be enabled to support zsh reverse search
programs.fzf.enable = true;
programs.carapace = {
enable = false;
# this would source all completers sadly some are worse than the builtin completers
enableZshIntegration = false;
};
programs.zoxide.enable = true;
programs.nix-index.enable = true;
programs.nix-index.enableZshIntegration = false;
programs.nix-index-database.comma.enable = true;
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
extended = true;
path = "${config.xdg.dataHome}/zsh/zsh_history";
save = 1000000;
share = false;
};
initExtra = builtins.readFile ./zshrc;
# This needs to be loaded befor zsh-fast-syntax-highlighting
# is sourced as that overwrites all widgets to redraw with highlighting
initExtraFirst = ''
if autoload history-search-end; then
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
fi
'';
plugins = [
{
name = "fzf-tab";
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
}
{
name = "fast-syntax-highlighting";
src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions";
}
{
name = "zsh-histdb";
src = pkgs.zsh-histdb;
}
{
name = "zsh-histdb-skim";
src = pkgs.zsh-histdb-skim;
}
];
};
home.persistence."/state".directories = [
".local/share/zsh"
".local/share/zoxide"
];
}

View file

@ -1,19 +1,13 @@
{ {
lib, lib,
minimal,
pkgs, pkgs,
... ...
}: }:
lib.optionalAttrs (!minimal) { {
services.dbus = { services.dbus = {
enable = true; enable = true;
implementation = "broker"; implementation = "broker";
}; };
environment.systemPackages = with pkgs; [
wdisplays
wl-clipboard
wev
];
xdg.portal = { xdg.portal = {
enable = true; enable = true;
xdgOpenUsePortal = true; xdgOpenUsePortal = true;
@ -42,4 +36,23 @@ lib.optionalAttrs (!minimal) {
}; };
}; };
}; };
imports = [
./fuzzel.nix
./sway.nix
./hyprland.nix
./waybar
./swaync
./swww.nix
];
hm.home.packages = with pkgs; [
wdisplays
wl-clipboard
wev
];
# Autostart hyprland if on tty1 (once, don't restart after logout)
hm.programs.zsh.initExtra = lib.mkOrder 9999 ''
if uwsm check may-start ; then
exec systemd-cat -t uwsm_start uwsm start -S -F Hyprland
fi
'';
} }

View file

@ -0,0 +1,14 @@
{
hm.stylix.targets.fuzzel.enable = true;
hm.programs.fuzzel = {
enable = true;
settings = {
main = {
launch-prefix = "uwsm app --";
};
};
};
hm.home.persistence."/state".files = [
".cache/fuzzel"
];
}

View file

@ -0,0 +1,308 @@
{
pkgs,
lib,
config,
...
}:
let
inherit (lib)
mkMerge
optionals
elem
mkIf
flip
concatMap
;
#from https://github.com/hyprwm/Hyprland/issues/3835
float_script = pkgs.writeShellScript "hyprland-bitwarden-float" ''
handle() {
case $1 in
windowtitle*)
# Extract the window ID from the line
window_id=''${1#*>>}
# Fetch the list of windows and parse it using jq to find the window by its decimal ID
window_info=$(hyprctl clients -j | ${pkgs.jq}/bin/jq --arg id "0x$window_id" '.[] | select(.address == ($id))')
# Extract the title from the window info
window_title=$(echo "$window_info" | ${pkgs.jq}/bin/jq '.title')
# Check if the title matches the characteristics of the Bitwarden popup window
if [[ "$window_title" == '"Extension: (Bitwarden Password Manager) - Bitwarden Mozilla Firefox"' ]]; then
# echo $window_id, $window_title
# hyprctl dispatch togglefloating address:0x$window_id
# hyprctl dispatch resizewindowpixel exact 20% 40%,address:0x$window_id
# hyprctl dispatch movewindowpixel exact 40% 30%,address:0x$window_id
hyprctl dispatch togglefloating address:0x$window_id
hyprctl dispatch resizewindowpixel exact "512 768",address:0x$window_id
hyprctl dispatch movewindowpixel exact "$HYPRLAND_FLOAT_LOCATION",address:0x$window_id
fi
;;
esac
}
# Listen to the Hyprland socket for events and process each line with the handle function
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
'';
in
{
hm = {
# UWSM starts a SH to read env variables
# this ensures all home.sessionVars are exported
programs.bash.enable = true;
wayland.windowManager.hyprland = {
enable = true;
settings = mkMerge [
{
input = {
kb_layout = "de";
kb_variant = "nodeadkeys";
follow_mouse = 2;
numlock_by_default = true;
repeat_rate = 60;
repeat_delay = 235;
# Only change focus on mouse click
float_switch_override_focus = 0;
accel_profile = "flat";
touchpad = {
natural_scroll = true;
disable_while_typing = true;
scroll_factor = 0.7;
};
};
device = {
name = "xp-pen-g430s-pen";
active_area_size = "48 27";
};
gestures = {
workspace_swipe = true;
};
general = {
gaps_in = 0;
gaps_out = 0;
allow_tearing = true;
};
#render = {
# explicit_sync = 0;
# direct_scanout = false;
#};
binds = {
focus_preferred_method = 1;
workspace_center_on = 1;
};
bind =
let
monitor_binds = {
"1" = "j";
"2" = "d";
"3" = "u";
"4" = "a";
"5" = "x";
"6" = "F1";
"7" = "F2";
"8" = "F3";
"9" = "F4";
};
in
[
"SUPER,q,killactive,"
"SUPER,return,fullscreen,"
"SUPER + SHIFT,return,fullscreenstate,2,0,"
"SUPER,f,togglefloating"
"SUPER,g,togglegroup"
"SUPER,tab,cyclenext,"
"ALT,tab,cyclenext,"
"SUPER+CTRL,r,submap,resize"
"SUPER,left,movefocus,l"
"SUPER,right,movefocus,r"
"SUPER,up,movefocus,u"
"SUPER,down,movefocus,d"
"SUPER,n,movefocus,l"
"SUPER,s,movefocus,r"
"SUPER,l,movefocus,u"
"SUPER,r,movefocus,d"
"SUPER,h,changegroupactive,b"
"SUPER,m,changegroupactive,f"
"SUPER + SHIFT,left,movewindoworgroup,l"
"SUPER + SHIFT,right,movewindoworgroup,r"
"SUPER + SHIFT,up,movewindoworgroup,u"
"SUPER + SHIFT,down,movewindoworgroup,d"
"SUPER + SHIFT,n,movewindoworgroup,l"
"SUPER + SHIFT,s,movewindoworgroup,r"
"SUPER + SHIFT,l,movewindoworgroup,u"
"SUPER + SHIFT,r,movewindoworgroup,d"
"SUPER,comma,workspace,-1"
"SUPER,period,workspace,+1"
"SUPER + SHIFT,comma,movetoworkspace,-1"
"SUPER + SHIFT,period,movetoworkspace,+1"
"SUPER,b,exec,uwsm app -- firefox"
"SUPER,t,exec,uwsm app -- kitty"
",Menu,exec,fuzzel"
"SUPER,c,exec,${lib.getExe pkgs.scripts.clone-term}"
"CTRL,F7,pass,class:^(discord)$"
"CTRL,F8,pass,class:^(discord)$"
"CTRL,F7,pass,class:^(TeamSpeak 3)$"
"CTRL,F8,pass,class:^(TeamSpeak 3)$"
"CTRL,F9,exec,systemctl --user start swww-update-wallpaper"
"SUPER + SHIFT,q,exec,uwsm stop"
]
++ flip concatMap (map toString (lib.lists.range 1 9)) (x: [
"SUPER,${monitor_binds."${x}"},workspace,${x}"
"SUPER + SHIFT,${monitor_binds."${x}"},movetoworkspacesilent,${x}"
]);
cursor.no_warps = true;
debug.disable_logs = false;
env =
[
"NIXOS_OZONE_WL,1"
"MOZ_ENABLE_WAYLAND,1"
"_JAVA_AWT_WM_NONREPARENTING,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_QPA_PLATFORM,wayland;xcb"
"GDK_BACKEND,wayland"
"WLR_DRM_NO_ATOMIC,1" # retest on newest nvidia driver
"XDG_SESSION_TYPE,wayland"
"TERMINAL,uwsm app -- kitty"
]
++ optionals (elem "nvidia" config.services.xserver.videoDrivers) [
# See https://wiki.hyprland.org/Nvidia/
"LIBVA_DRIVER_NAME,nvidia"
"GBM_BACKEND,nvidia-drm"
];
bindm = [
# mouse movements
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
"SUPER ALT, mouse:272, resizewindow"
];
animations = {
enabled = true;
animation = [
"windows, 1, 4, default, slide"
"windowsOut, 1, 4, default, slide"
"windowsMove, 1, 4, default"
"border, 1, 2, default"
"fade, 1, 4, default"
"fadeDim, 1, 4, default"
"workspaces, 1, 4, default"
];
};
decoration.rounding = 4;
exec-once = [
"${pkgs.swaynotificationcenter}/bin/swaync"
];
misc = {
vrr = 1;
disable_hyprland_logo = true;
mouse_move_focuses_monitor = false;
};
xwayland.force_zero_scaling = true;
windowrulev2 = [
# fix these once nvidia gets their shit together
#"immediate, class:^(cs2)$"
# apex legends
"immediate, class:^(steam_app_1172470)$"
#???
"immediate, class:^(steam_app_238960)$"
#baldur
#"immediate, class:^(steam_app_1086940)$"
"float, class:^(steam)$, title:^(Friends List)"
"float, class:^(steam)$, title:(Chat)"
"float, class:^(streamlink-twitch-gui)$"
"workspace 2,class:^(firefox)$"
"workspace 3,class:^(thunderbird)$"
"workspace 4,class:^(bottles)$"
"workspace 4,class:^(steam)$, title:^(Steam)"
"workspace 4,class:^(prismlauncher)$"
"workspace 6,class:^(discord)$"
"workspace 6,class:^(WebCord)$"
"workspace 6,class:^(TeamSpeak 3)$"
"workspace 7,class:^(signal)$"
"workspace 7,class:^(TelegramDesktop)$"
];
}
(mkIf (config.node.name == "desktopnix") {
input.tablet = {
output = "DP-3";
};
monitor = [
"DVI-D-1,preferred,0x0,1"
"HDMI-A-1,preferred,0x1080,1"
"DP-3,2560x1440@144.00Hz,1920x540,1"
# Thank you NVIDIA for this generous, free-of-charge, extra monitor that
# doesn't exist and crashes yoru session sometimes when moving a window to it.
"Unknown-1, disable"
];
workspace = [
"1, monitor:DP-3, default:true"
"2, monitor:DP-3"
"3, monitor:DP-3"
"4, monitor:DP-3"
"5, monitor:DP-3"
"6, monitor:DVI-D-1, default:true"
"7, monitor:DVI-D-1"
"8, monitor:HDMI-A-1, default: true"
"9, monitor:HDMI-A-1"
];
env = [ "HYPRLAND_FLOAT_LOCATION,3800 680" ];
})
(mkIf (config.node.name == "patricknix") {
monitor = [
"eDP-1,preferred,0x0,2"
# Thank you NVIDIA for this generous, free-of-charge, extra monitor that
# doesn't exist and crashes yoru session sometimes when moving a window to it.
"Unknown-1, disable"
];
workspace = [
"1, monitor:eDP-1, default:true"
"2, monitor:eDP-1"
"3, monitor:eDP-1"
"4, monitor:eDP-1"
"5, monitor:eDP-1"
"6, monitor:eDP-1"
"7, monitor:eDP-1"
"8, monitor:eDP-1"
"9, monitor:eDP-1"
];
env = [ "HYPRLAND_FLOAT_LOCATION,1400 200" ];
})
];
extraConfig = ''
submap=resize
binde=,right,resizeactive,80 0
binde=,left,resizeactive,-80 0
binde=,up,resizeactive,0 -80
binde=,down,resizeactive,0 80
binde=SHIFT,right,resizeactive,10 0
binde=SHIFT,left,resizeactive,-10 0
binde=SHIFT,up,resizeactive,0 -10
binde=SHIFT,down,resizeactive,0 10
bind=,return,submap,reset
bind=,escape,submap,reset
submap=reset
exec-once = ${pkgs.xorg.xprop}/bin/xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
exec-once = ${float_script}
env = XCURSOR_SIZE,48
exec-once = uwsm finalize
'';
};
};
}

View file

@ -0,0 +1,108 @@
{ config, ... }:
let
nixConfig = config;
in
{
# import shared i3 config
imports = [ ../Xorg/sway3.nix ];
hm =
{ config, ... }:
{
stylix.targets.sway.enable = true;
wayland.windowManager.sway = {
enable = true;
config =
{
menu = "fuzzel";
startup = [
# for games to work input 1 has to be qwerts
# but i would like to have bone as my layout
{
command = "swaymsg input \"*\" xkb_switch_layout 1";
always = true;
}
{ command = "uwsm finalize"; }
];
input = {
"*" = {
xkb_layout = "de,de,de";
# games are stupid so the main ui has to be de() without bone
xkb_variant = ",bone,neo";
xkb_options = "grp:win_space_toggle";
repeat_delay = "235";
repeat_rate = "60";
accel_profile = "flat";
pointer_accel = "0.3";
tap = "enabled";
};
"type:touchpad" = {
pointer_accel = "0.5";
natural_scroll = "enabled";
};
"type:touch" = {
map_to_output = "eDP-1";
};
"type:tablet_tool" = {
map_to_output = "eDP-1";
};
};
keybindings =
let
cfg = config.wayland.windowManager.sway.config;
in
{
"Menu" = "exec ${cfg.menu}";
};
}
// {
desktopnix = {
output = {
DVI-D-1 = {
mode = "1920x1080@60Hz";
pos = "0,0";
};
HDMI-A-1 = {
mode = "1920x1080@60Hz";
pos = "0,1080";
};
DP-3 = {
mode = "2560x1440@143.998Hz";
pos = "1920,720";
adaptive_sync = "on";
};
};
};
patricknix = {
output = {
"Acer Technologies XB271HU #ASP7ytE/6A7d" = {
mode = "2560x1440@59.951Hz";
pos = "0,0";
};
"AU Optronics 0x30EB Unknown" = {
mode = "3840x2160@60.002Hz";
pos = "2560,0";
scale = "2";
};
};
};
}
.${nixConfig.node.name} or { };
extraConfig =
let
cfg = config.wayland.windowManager.sway.config;
in
''
bindgesture swipe:3:left workpace next
bindgesture swipe:3:right workpace prev
bindgesture pinch:4:outward exec ${cfg.menu}
'';
};
# Cursor invisible
home.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = 1;
NIXOS_OZONE_WL = 1;
# opengl backend flickers, also vulkan is love.
#WLR_RENDERER = "vulkan";
};
};
}

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.swaync = { hm.services.swaync = {
enable = true; enable = true;
settings = { settings = {
positionX = "right"; positionX = "right";
@ -83,7 +83,4 @@
) )
+ (builtins.readFile ./swaync.css); + (builtins.readFile ./swaync.css);
}; };
# Started via hyprland to ensure it restarts properly with hyprland
systemd.user.services.swaync.Install.WantedBy = lib.mkForce [ ];
} }

View file

@ -17,7 +17,7 @@ let
}; };
in in
{ {
systemd.user = { hm.systemd.user = {
services = { services = {
swww = { swww = {
Install.WantedBy = [ "graphical-session.target" ]; Install.WantedBy = [ "graphical-session.target" ];

View file

@ -1,15 +1,15 @@
{ {
pkgs, pkgs,
lib, lib,
nixosConfig, config,
... ...
}: }:
{ {
systemd.user.services."waybar" = { hm.systemd.user.services."waybar" = {
Unit.After = [ "graphical-session.target" ]; Unit.After = [ "graphical-session.target" ];
Service.Slice = [ "app-graphical.slice" ]; Service.Slice = [ "app-graphical.slice" ];
}; };
programs.waybar = { hm.programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
style = style =
@ -32,7 +32,7 @@
} }
''; '';
} }
.${nixosConfig.node.name} or "" .${config.node.name} or ""
) )
+ builtins.readFile ./waybar.css; + builtins.readFile ./waybar.css;
settings.main = { settings.main = {
@ -68,7 +68,7 @@
"tray" "tray"
]; ];
} }
.${nixosConfig.node.name} or [ ]; .${config.node.name} or [ ];
battery = { battery = {
interval = 1; interval = 1;

View file

@ -6,6 +6,7 @@
... ...
}: }:
lib.optionalAttrs (!minimal) { lib.optionalAttrs (!minimal) {
primaryUser = "patrick";
users.users.patrick = { users.users.patrick = {
shell = pkgs.zsh; shell = pkgs.zsh;
isNormalUser = true; isNormalUser = true;
@ -40,12 +41,6 @@ lib.optionalAttrs (!minimal) {
# xournalpp needs this or else it will crash # xournalpp needs this or else it will crash
adwaita-icon-theme adwaita-icon-theme
]; ];
age.secrets = {
smb-creds = {
owner = "patrick";
rekeyFile = ../../secrets/smb.cred.age;
};
};
programs.dconf.enable = true; programs.dconf.enable = true;
age.secrets."my-gpg-yubikey-keygrip.tar" = { age.secrets."my-gpg-yubikey-keygrip.tar" = {
@ -54,43 +49,38 @@ lib.optionalAttrs (!minimal) {
mode = "640"; mode = "640";
}; };
home-manager.users.patrick = { imports = [
imports =
[
./patrick.nix
./ssh.nix
./firefox.nix ./firefox.nix
./gpg ./gpg
./impermanence.nix ./impermanence.nix
./minion.nix ./minion.nix
./vr.nix ./patrick.nix
./smb.nix
./ssh.nix
./theme.nix
../common ../common/alias.nix
../common/impermanence.nix ../common/dev.nix
../common/wayland
../common/programs/bottles.nix ../common/programs/bottles.nix
../common/programs/direnv.nix ../common/programs/direnv.nix
../common/programs/firefox.nix ../common/programs/firefox.nix
../common/programs/gdb.nix ../common/programs/gdb.nix
../common/programs/git.nix ../common/programs/git.nix
../common/programs/gpg.nix
../common/programs/gpu-screen-recorder.nix
../common/programs/kitty.nix ../common/programs/kitty.nix
../common/programs/minecraft.nix ../common/programs/minecraft.nix
../common/programs/nvim ../common/programs/nvim
../common/programs/obs.nix
../common/programs/pager.nix
../common/programs/poe.nix ../common/programs/poe.nix
../common/programs/spicetify.nix ../common/programs/spicetify.nix
../common/programs/steam.nix
../common/programs/thunderbird.nix ../common/programs/thunderbird.nix
../common/programs/gpu-screen-recorder.nix ../common/programs/zsh
../common/shells/pager.nix
]
++ {
"desktopnix" = [
../common/graphical/Xorg
../common/programs/obs.nix
../common/graphical/wayland
./smb.nix
]; ];
"patricknix" = [ ../common/graphical/wayland ];
}
.${config.node.name} or [ ];
};
} }

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.firefox = hm.programs.firefox =
let let
betterfox = pkgs.fetchFromGitHub { betterfox = pkgs.fetchFromGitHub {
owner = "yokoffing"; owner = "yokoffing";

View file

@ -1,5 +1,11 @@
{ {
programs.gpg.publicKeys = [ config,
lib,
pkgs,
...
}:
{
hm.programs.gpg.publicKeys = [
{ {
source = ./pubkey.gpg; source = ./pubkey.gpg;
trust = 5; trust = 5;
@ -9,4 +15,14 @@
trust = 5; trust = 5;
} }
]; ];
# Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status`
# before being able to use the yubikey.
hm.home.activation.installKeygrips =
config.home-manager.users.root.lib.dag.entryAfter [ "writeBoundary" ]
''
run mkdir -p "$HOME/.gnupg/private-keys-v1.d"
run ${lib.getExe pkgs.gnutar} xvf ${
lib.escapeShellArg config.age.secrets."my-gpg-yubikey-keygrip.tar".path
} -C "$HOME/.gnupg/private-keys-v1.d/"
'';
} }

View file

@ -1,11 +1,13 @@
{ nixosConfig, lib, ... }: { config, lib, ... }:
{ {
home.persistence = { hm.home.persistence = {
"/state" = { "/state" = {
files = [
".ssh/known_hosts"
];
directories = [ directories = [
"repos" "repos"
"Downloads" "Downloads"
"Zotero" "Zotero"
".config/ts3client" ".config/ts3client"
@ -13,6 +15,8 @@
".config/xournalpp" ".config/xournalpp"
".cache/xournalpp" ".cache/xournalpp"
".local/state/wireplumber"
".config/OrcaSlicer" ".config/OrcaSlicer"
".config/streamcontroller" ".config/streamcontroller"
@ -28,13 +32,12 @@
".local/share/osu" ".local/share/osu"
".config/obs-studio"
".local/share/monado" ".local/share/monado"
# For nextcloud client install # For nextcloud client install
"Nextcloud" "Nextcloud"
".config/Nextcloud" ".config/Nextcloud"
".config/dconf"
# for electron signal app state # for electron signal app state
".config/Signal" ".config/Signal"
@ -45,27 +48,13 @@
".cache/mpv" ".cache/mpv"
# Folders for steam
".local/share/Steam"
".steam"
# Ken follets pillars of earth
".local/share//Daedalic Entertainment GmbH/"
# Nvidia shader cache
".cache/nvidia"
# Vulkan shader cache
".local/share/vulkan"
# bottles state games
".local/share/bottles"
".config/spotify" ".config/spotify"
".cache/spotify" ".cache/spotify"
".local/share/cargo" ".local/share/cargo"
".local/share/wallpapers" ".local/share/wallpapers"
]; ];
}; };
"/panzer/state".directories = lib.lists.optionals (nixosConfig.disko.devices.zpool ? "panzer") [ "/panzer/state".directories = lib.lists.optionals (config.disko.devices.zpool ? "panzer") [
".local/share/SteamPanzer"
"videos" "videos"
]; ];
}; };

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }: { config, pkgs, ... }:
let let
# addon-path is base64 encode path # addon-path is base64 encode path
cfgFile = pkgs.writeText "mimion.xml" '' cfgFile = pkgs.writeText "mimion.xml" ''
@ -26,10 +26,12 @@ let
''; '';
in in
{ {
home.packages = [ pkgs.minion ]; hm.home.packages = [ pkgs.minion ];
# yet another program that uses the config file as a live state file # yet another program that uses the config file as a live state file
# Why? # Why?
home.activation.installMinionConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' hm.home.activation.installMinionConfig =
config.home-manager.users.root.lib.dag.entryAfter [ "writeBoundary" ]
''
run mkdir -p .minion run mkdir -p .minion
run cp -f ${cfgFile} .minion/minion.xml run cp -f ${cfgFile} .minion/minion.xml
run chmod 640 .minion/minion.xml run chmod 640 .minion/minion.xml

View file

@ -1,46 +1,46 @@
{ {
pkgs, pkgs,
lib,
nixosConfig,
... ...
}: }:
{ {
home = { hm.home = {
packages = with pkgs; [ packages = with pkgs; [
nextcloud-client chatterino2
discord
webcord
netflix
xournalpp
galaxy-buds-client
thunderbird
signal-desktop
telegram-desktop
chromium chromium
osu-lazer-bin cmatrix
teamspeak_client cowsay
zotero discord
timer feh
orca-slicer figlet
hexyl galaxy-buds-client
gh gh
hexyl
hyperfine
mpv
netflix
nextcloud-client
nixpkgs-review nixpkgs-review
orca-slicer
via osu-lazer-bin
pinentry-gnome3 # for yubikey pinentry
signal-desktop
streamlink streamlink
streamlink-twitch-gui-bin streamlink-twitch-gui-bin
chatterino2 teamspeak_client
telegram-desktop
timer
via
webcord
xournalpp
yt-dlp yt-dlp
zathura
hyperfine zotero
figlet
cowsay
cmatrix
]; ];
}; };
hm.programs.bat.enable = true;
# needed for gnome pinentry
services.dbus.packages = [ pkgs.gcr ];
hm = {
xdg.configFile."streamlink/config".text = '' xdg.configFile."streamlink/config".text = ''
player=mpv player=mpv
''; '';
@ -53,18 +53,5 @@
UP add volume 2 UP add volume 2
DOWN add volume -2 DOWN add volume -2
''; '';
# Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status` };
# before being able to use the yubikey.
home.activation.installKeygrips = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run mkdir -p "$HOME/.gnupg/private-keys-v1.d"
run ${lib.getExe pkgs.gnutar} xvf ${
lib.escapeShellArg nixosConfig.age.secrets."my-gpg-yubikey-keygrip.tar".path
} -C "$HOME/.gnupg/private-keys-v1.d/"
'';
# Autostart hyprland if on tty1 (once, don't restart after logout)
programs.zsh.initExtra = lib.mkOrder 9999 ''
if uwsm check may-start ; then
exec systemd-cat -t uwsm_start uwsm start -S -F Hyprland
fi
'';
} }

Binary file not shown.

View file

@ -1,9 +1,9 @@
{ nixosConfig, nodes, ... }: { config, nodes, ... }:
{ {
home.smb = hm.home.smb =
let let
address = nodes.elisabeth-samba.config.wireguard.samba-patrick.ipv4; address = nodes.elisabeth-samba.config.wireguard.samba-patrick.ipv4;
credentials = nixosConfig.age.secrets.smb-creds.path; credentials = config.age.secrets.smb-creds.path;
in in
[ [
{ {
@ -37,4 +37,10 @@
automatic = true; automatic = true;
} }
]; ];
age.secrets = {
smb-creds = {
owner = "patrick";
rekeyFile = ../../secrets/smb.cred.age;
};
};
} }

View file

@ -1,13 +1,15 @@
{ config, ... }: { config, ... }:
{ {
# yubikey public key parts # yubikey public key parts
home.file.".ssh/1.pub".text = '' hm.home.file = {
".ssh/1.pub".text = ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDZixkix0KfKuq7Q19whS5FQQg51/AJGB5BiNF/7h/LM cardno:15 489 049 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDZixkix0KfKuq7Q19whS5FQQg51/AJGB5BiNF/7h/LM cardno:15 489 049
''; '';
home.file.".ssh/2.pub".text = '' ".ssh/2.pub".text = ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHxD4GOrwrBTG4/qQhm5hoSB2CP7W9g1LPWP11oLGOjQ cardno:23 010 997 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHxD4GOrwrBTG4/qQhm5hoSB2CP7W9g1LPWP11oLGOjQ cardno:23 010 997
''; '';
programs.ssh = { };
hm.programs.ssh = {
enable = true; enable = true;
controlMaster = "auto"; controlMaster = "auto";
controlPersist = "5s"; controlPersist = "5s";
@ -35,7 +37,7 @@
}; };
"maddy" = { "maddy" = {
hostname = config.userSecrets.hetzner_ip; hostname = config.secrets.secrets.global.user.hetzner_ip;
user = "root"; user = "root";
}; };

199
users/patrick/theme.nix Normal file
View file

@ -0,0 +1,199 @@
{
config,
pkgs,
...
}:
{
environment.systemPackages = with pkgs; [ xdg-utils ];
xdg.portal = {
xdgOpenUsePortal = true;
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
config = {
common.default = [
"gtk"
"hyprland"
];
sway.default = [ "wlr" ];
};
};
fonts = {
enableGhostscriptFonts = false;
fontDir.enable = false;
fontconfig = {
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias binding="weak">
<family>monospace</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>sans-serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
</fontconfig>
'';
};
packages = with pkgs; [
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
ibm-plex
dejavu_fonts
unifont
freefont_ttf
gyre-fonts # TrueType substitutes for standard PostScript fonts
liberation_ttf
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
noto-fonts-extra
];
};
stylix.fonts = {
serif = {
package = pkgs.dejavu_fonts;
name = "IBM Plex Serif";
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "IBM Plex Sans";
};
monospace = {
# No need for patched nerd fonts, kitty can pick up on them automatically,
# and ideally every program should do that: https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font
package = pkgs.jetbrains-mono;
name = "JetBrains Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
stylix = {
enable = true;
autoEnable = false;
polarity = "dark";
image = config.lib.stylix.pixel "base00";
base16Scheme = "${pkgs.base16-schemes}/share/themes/vice.yaml";
# Has to be green
override.base0B = "#00CC99";
#base16Scheme = {
# base00 = "#101419";
# base01 = "#171B20";
# base02 = "#21262e";
# base03 = "#242931";
# base04 = "#485263";
# base05 = "#b6beca";
# base06 = "#dee1e6";
# base07 = "#e3e6eb";
# base08 = "#e05f65";
# base09 = "#f9a872";
# base0A = "#f1cf8a";
# base0B = "#78dba9";
# base0C = "#74bee9";
# base0D = "#70a5eb";
# base0E = "#c68aee";
# base0F = "#9378de";
#};
## based on decaycs-dark, bright variant
#base16Scheme = {
# base00 = "#101419";
# base01 = "#171B20";
# base02 = "#21262e";
# base03 = "#242931";
# base04 = "#485263";
# base05 = "#b6beca";
# base06 = "#dee1e6";
# base07 = "#e3e6eb";
# base08 = "#e5646a";
# base09 = "#f7b77c";
# base0A = "#f6d48f";
# base0B = "#94F7C5";
# base0C = "#79c3ee";
# base0D = "#75aaf0";
# base0E = "#cb8ff3";
# base0F = "#9d85e1";
#};
};
hm =
{ config, ... }:
{
stylix = {
cursor = {
package = pkgs.openzone-cursors;
name = "OpenZone_White_Slim";
size = 18;
};
inherit (config.stylix) polarity;
targets = {
gtk.enable = true;
bat.enable = true;
dunst.enable = true;
zathura.enable = true;
xresources.enable = true;
};
};
xresources.properties = {
"Xft.hinting" = true;
"Xft.antialias" = true;
"Xft.autohint" = false;
"Xft.lcdfilter" = "lcddefault";
"Xft.hintstyle" = "hintfull";
"Xft.rgba" = "rgb";
};
gtk =
let
gtk34extraConfig = {
gtk-application-prefer-dark-theme = 1;
gtk-cursor-theme-size = 18;
gtk-enable-animations = true;
gtk-xft-antialias = 1;
gtk-xft-dpi = 96; # XXX: delete for wayland?
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintfull";
gtk-xft-rgba = "rgb";
};
in
{
enable = true;
iconTheme = {
name = "Vimix-Doder";
package = pkgs.vimix-icon-theme;
};
gtk2.extraConfig = "gtk-application-prefer-dark-theme = true";
gtk3.extraConfig = gtk34extraConfig;
gtk4.extraConfig = gtk34extraConfig;
};
home.sessionVariables.GTK_THEME = config.gtk.theme.name;
qt = {
enable = true;
platformTheme.name = "adwaita";
style.name = "Adwaita-Dark";
};
};
}

Some files were not shown because too many files have changed in this diff Show more