This commit is contained in:
Aleksandr Lebedev 2025-08-11 14:25:24 +02:00
parent 764d5dd68c
commit f2ebfeb4ea
91 changed files with 1 additions and 22073 deletions

View file

@ -7,7 +7,7 @@
config,
...
}: let
emacs = inputs.emacs-kylekrein.packages.${system}.with-lsps-native;
emacs = inputs.emacs-kylekrein.packages.${system}.with-lsps;
in {
programs.emacs = {
enable = osConfig.custom.presets.wayland.enable;

View file

@ -1,321 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
config,
lib,
pkgs,
hwconfig,
first-nixos-install,
inputs,
unstable-pkgs,
...
}: let
in {
imports =
[
inputs.sops-nix.nixosModules.sops
inputs.nixos-facter-modules.nixosModules.facter
inputs.home-manager.nixosModules.default
inputs.disko.nixosModules.default
inputs.chaotic.nixosModules.nyx-cache
inputs.chaotic.nixosModules.nyx-overlay
inputs.chaotic.nixosModules.nyx-registry
inputs.lanzaboote.nixosModules.lanzaboote
./modules/firefox
./modules/flatpak
./modules/steam
./modules/ly
./modules/sddm
./modules/services/autoupgrade
./modules/sops
./modules/dolphin
./modules/gnupg
./modules/direnv
./hosts/${hwconfig.hostname}
]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
facter.reportPath = ./hosts/${hwconfig.hostname}/facter.json;
kylekrein.services.autoUpgrade = {
enable = false;
pushUpdates = false; #if hwconfig.hostname == "kylekrein-homepc" then true else false;
configDir = "/etc/nixos-config";
user = "root";
};
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables =
if hwconfig.hostname != "kylekrein-mac"
then true
else false;
};
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
loader.timeout = 0;
};
networking.hostName = hwconfig.hostname;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
#flatpak
#kk.services.flatpak.enable = hwconfig.system != "aarch64-linux";
services.flatpak.packages = [
];
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "ru_RU.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us,ru";
variant = "";
options = "grp:caps_toggle";
};
console.keyMap = "us";
services.udisks2.enable = true;
users = {
mutableUsers = false;
users = {
root = {
# disable root login here, and also when installing nix by running nixos-install --no-root-passwd
# https://discourse.nixos.org/t/how-to-disable-root-user-account-in-configuration-nix/13235/3
hashedPassword = "!"; # disable root logins, nothing hashes to !
};
};
};
#qt = {
# enable = true;
# platformTheme = "qt5ct";
# style = "kvantum";
#};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
kdePackages.kdenlive
system-config-printer
libreoffice
nix-output-monitor
eza
fd
(pkgs.writeShellScriptBin "root-files" ''
${pkgs.fd}/bin/fd --one-file-system --base-directory / --type f --hidden --exclude "{tmp,etc/passwd}"
'') # https://www.reddit.com/r/NixOS/comments/1d1apm0/comment/l5tgbwz/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
gparted
qdirstat
exfatprogs
kitty
tealdeer
fzf
lazygit
fastfetch
telegram-desktop
vlc
wl-clipboard
git
git-credential-manager
egl-wayland
kitty-themes
btop
solaar
pdfarranger
densify
gimp3
#kde
kdePackages.gwenview
kdePackages.ark
# user packages
obs-studio
neovim
localsend
comma #run nix run nixpkgs#nix-index to init
gdb
element-desktop
unstable-pkgs.fluffychat
#beeengineeditor
#beelocalization
];
programs.kdeconnect.enable = true;
programs.kdeconnect.package = lib.mkDefault pkgs.kdePackages.kdeconnect-kde;
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/etc/nixos-config";
};
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
font-awesome
nerd-fonts.symbols-only
hack-font
# microsoft fonts:
#corefonts
#vistafonts
];
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
MANPAGER = "emacsclient -c";
EDITOR = "emacsclient -c";
};
kk.loginManagers.sddm.enable = true;
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
services.syncthing = {
user = "kylekrein";
configDir = "/persist/home/kylekrein/.config/syncthing";
enable = true;
};
hardware = {
graphics = {
enable = true;
};
logitech.wireless.enable = true;
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
};
};
};
};
services.blueman.enable = true;
security.polkit.enable = true;
#programs.thunar = {
# enable = true;
# plugins = with pkgs.xfce; [
# thunar-archive-plugin
# thunar-volman
# ];
# };
#programs.xfconf.enable = true; # so thunar can save config
#services.gvfs.enable = true; # Mount, trash, and other functionalities
#services.tumbler.enable = true; # Thumbnail support for images
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
];
};
programs.bash = {
shellAliases = {
ls = "${pkgs.eza}/bin/eza --icons=always";
};
};
#printing
services.printing.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
#services.flatpak.enable = true;
#services.flatpak.packages = [
# "flathub:app/org.kde.dolphin//stable"
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
kk.steam.enable = true;
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
# require public key authentication for better security
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "no";
};
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [22 53317];
networking.firewall.allowedUDPPorts = [22 53317];
# Or disable the firewall altogether.
#networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
substituters = [
"https://nix-gaming.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
}

View file

@ -1,56 +0,0 @@
{
pkgs,
lib,
inputs,
...
}: let
pkgs-master = import inputs.nixpkgs-master {
inherit (pkgs) system;
config.allowUnfree = true;
};
in {
nixpkgs = {
overlays = [
(self: super: {
widevine-cdm = pkgs-master.widevine-cdm;
})
];
};
#nixpkgs.overlays = [
# (import ./widevine-overlay.nix)
#];
#nixpkgs.config.allowUnsupportedSystem = true;
imports = [
#./apple-silicon-support
];
programs.firefox.policies.Preferences = {
"media.gmp-widevinecdm.version" = "system-installed";
"media.gmp-widevinecdm.visible" = true;
"media.gmp-widevinecdm.enabled" = true;
"media.gmp-widevinecdm.autoupdate" = false;
"media.eme.enabled" = true;
"media.eme.encrypted-media-encryption-scheme.enabled" = true;
};
programs.firefox.autoConfig = ''
// Zhu
lockPref("general.useragent.override","Mozilla/5.0 (X11; CrOS aarch64 15236.80.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.125 Safari/537.36");''; #doesn't work. You need to manually add this to about:config
hardware.asahi = {
peripheralFirmwareDirectory = ./firmware;
useExperimentalGPUDriver = true; #deprecated
#experimentalGPUInstallMode = "overlay";
setupAsahiSound = true;
};
#powerManagement = {
# enable = true;
# powertop.enable = true;
#};
#hardware.graphics.enable32Bit = lib.mkForce false;
environment.systemPackages = with pkgs; [
#mesa
#mesa.drivers
mesa-asahi-edge
#widevine-cdm
#widevinecdm-aarch64
];
}

View file

@ -1,22 +0,0 @@
{pkgs, ...}: {
programs.firefox.profiles.default.settings = {
"media.gmp-widevinecdm.version" = pkgs.widevinecdm-aarch64.version;
"media.gmp-widevinecdm.visible" = true;
"media.gmp-widevinecdm.enabled" = true;
"media.gmp-widevinecdm.autoupdate" = false;
"media.eme.enabled" = true;
"media.eme.encrypted-media-encryption-scheme.enabled" = true;
};
home.file."firefox-widevinecdm" = {
enable = true;
target = ".mozilla/firefox/default/gmp-widevinecdm";
source = pkgs.runCommandLocal "firefox-widevinecdm" {} ''
out=$out/${pkgs.widevinecdm-aarch64.version}
mkdir -p $out
ln -s ${pkgs.widevinecdm-aarch64}/manifest.json $out/manifest.json
ln -s ${pkgs.widevinecdm-aarch64}/libwidevinecdm.so $out/libwidevinecdm.so
'';
recursive = true;
};
}

View file

@ -1,5 +0,0 @@
prev: final: {
widevinecdm-aarch64 = import ./widevine.nix {
inherit (final) stdenvNoCC fetchFromGitHub fetchurl python3 squashfsTools nspr;
};
}

View file

@ -1,41 +0,0 @@
{
stdenvNoCC,
fetchFromGitHub,
fetchurl,
python3,
squashfsTools,
nspr,
}: let
widevine-installer = fetchFromGitHub {
owner = "AsahiLinux";
repo = "widevine-installer";
rev = "7a3928fe1342fb07d96f61c2b094e3287588958b";
sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y=";
};
lacros-image = fetchurl {
url = let
distfiles_base = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles";
lacros_name = "chromeos-lacros-arm64-squash-zstd";
lacrosVersion = "120.0.6098.0";
in "${distfiles_base}/${lacros_name}-${lacrosVersion}";
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY=";
};
in
stdenvNoCC.mkDerivation {
name = "widevine";
version = "4.10.2662.3";
dontUnpack = true;
dontBuild = true;
buildInputs = [python3 squashfsTools];
installPhase = ''
mkdir $out
unsquashfs -q ${lacros-image} 'WidevineCdm/*'
python3 ${widevine-installer}/widevine_fixup.py squashfs-root/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so $out/libwidevinecdm.so
mv squashfs-root/WidevineCdm/manifest.json $out/
mv squashfs-root/WidevineCdm/LICENSE $out/
patchelf --add-rpath ${nspr}/lib $out/libwidevinecdm.so
'';
}

View file

@ -1,36 +0,0 @@
{
pkgs,
lib,
inputs,
...
}: {
imports = [
inputs.nixos-hardware.nixosModules.framework-12-13th-gen-intel
];
# Ensure that the `pinctrl_tigerlake` kernel module is loaded before `soc_button_array`.
# This is required for correcly switching to tablet mode when the display is folded back.
boot.extraModprobeConfig = ''
softdep soc_button_array pre: pinctrl_tigerlake
'';
boot.initrd.kernelModules = ["pinctrl_tigerlake"];
# Patch the `udev` rules shipping with `iio-sensor-proxy` according to:
# https://github.com/FrameworkComputer/linux-docs/blob/main/framework12/Ubuntu-25-04-accel-ubuntu25.04.md
nixpkgs.overlays = [
(final: prev: {
iio-sensor-proxy = prev.iio-sensor-proxy.overrideAttrs (old: {
postInstall = ''
${old.postInstall or ""}
sed -i 's/.*iio-buffer-accel/#&/' $out/lib/udev/rules.d/80-iio-sensor-proxy.rules
'';
});
})
];
hardware.enableRedistributableFirmware = true;
environment.systemPackages = [
pkgs.framework-tool
];
users.groups.touchscreen = {};
services.udev.extraRules = ''
KERNEL=="event*", ATTRS{name}=="ILIT2901:00 222A:5539", SYMLINK+="touchscreen", MODE="0660", GROUP="touchscreen"
'';
}

View file

@ -1,49 +0,0 @@
{
config,
pkgs,
lib,
...
}: {
hardware = {
graphics = {
enable = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
];
};
nvidia = {
# https://nixos.wiki/wiki/Nvidia
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true; #false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.latest;
};
logitech.wireless.enable = true;
};
services.xserver.videoDrivers = ["nvidia"];
}

View file

@ -1,161 +0,0 @@
{
config,
lib,
pkgs,
hwconfig,
first-nixos-install,
username,
inputs,
...
}: let
in {
imports =
[
#./modules/fastfetch
#./modules/tmux/home.nix
]
++ lib.optional (lib.strings.hasInfix "kylekrein" hwconfig.hostname) ./modules/fastfetch
++ lib.optional (hwconfig.useImpermanence) (
import ./modules/impermanence/home.nix {
inherit username;
inherit inputs;
}
)
#++ lib.optional (config.programs.hyprland.enable) (
# import ./modules/hyprland/home.nix {
# inherit pkgs;
# inherit username;
# inherit inputs;
# inherit hwconfig;
# inherit lib;
# }
#)
++ lib.optional (builtins.pathExists ./homes/${username}) (
import ./homes/${username} {
inherit username;
inherit config;
inherit pkgs;
inherit lib;
inherit inputs;
inherit hwconfig;
}
);
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = username;
home.homeDirectory = "/home/${username}";
#xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
# General.theme = "Catppuccin-Mocha";
# };
#xdg.configFile = {
# "Kvantum/kvantum.kvconfig".text = ''
# [General]
# theme=catppuccin-mocha
# '';
# The important bit is here, links the theme directory from the package to a directory under `~/.config`
# where Kvantum should find it.
# "Kvantum/catppuccin-mocha".source = "${pkgs.catppuccin-kvantum}/share/Kvantum/catppuccin-mocha";
#};
programs.fzf = {
enable = true;
enableBashIntegration = true;
};
programs.eza = {
enable = true;
icons = "always";
};
#xdg.configFile."qt5ct/qt5ct.conf".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
# Appearance.icon_theme = "Breeze Dark";
# };
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
#obs-studio
#vesktop
#vscode-fhs
];
programs.kitty = {
enable = lib.strings.hasInfix "kylekrein" hwconfig.hostname;
font = {
name = "JetBrainsMono Nerd Font";
size = 20;
};
settings = {
confirm_os_window_close = 0;
};
#shellIntegration.enableFishIntegration = true;
themeFile = "Catppuccin-Macchiato";
#Also available: Catppuccin-Frappe Catppuccin-Latte Catppuccin-Macchiato Catppuccin-Mocha
# See all available kitty themes at: https://github.com/kovidgoyal/kitty-themes/blob/46d9dfe230f315a6a0c62f4687f6b3da20fd05e4/themes.json
};
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/kylekrein/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

View file

@ -1,110 +0,0 @@
{
pkgs,
hwconfig,
...
}: let
battery-path = "/sys/class/power_supply/${
if hwconfig.hostname == "kylekrein-mac"
then "macsmc-battery"
else
(
if hwconfig.hostname == "kylekrein-framework12"
then "BAT1"
else "BAT0"
)
}";
get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" ''
cat ${battery-path}/capacity 2>/dev/null || echo "N/A"
''}/bin/get-battery-level";
get-status = "${pkgs.writeShellScriptBin "get-status" ''
cat ${battery-path}/status 2>/dev/null || echo "Unknown"
''}/bin/get-status";
get-icon = "${pkgs.writeShellScriptBin "get-icon" ''
BATTERY_LEVEL=$(${get-battery-level})
STATUS=$(${get-status})
if [[ "$BATTERY_LEVEL" == "N/A" ]]; then
ICON="󰂑 "
elif [[ "$STATUS" == "Charging" ]]; then
if [[ $BATTERY_LEVEL -ge 90 ]]; then
ICON="󰂋 "
elif [[ $BATTERY_LEVEL -ge 80 ]]; then
ICON="󰂊 "
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
ICON="󰢞 "
elif [[ $BATTERY_LEVEL -ge 60 ]]; then
ICON="󰂉 "
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
ICON="󰢝 "
elif [[ $BATTERY_LEVEL -ge 40 ]]; then
ICON="󰂈 "
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
ICON="󰂇 "
elif [[ $BATTERY_LEVEL -ge 20 ]]; then
ICON="󰂆 "
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
ICON="󰢜 "
else
ICON="󰢜 "
fi
else
if [[ $BATTERY_LEVEL -ge 90 ]]; then
ICON="󰂂 "
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
ICON="󰂀 "
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
ICON="󰁾 "
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
ICON="󰁼 "
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
ICON="󰁺 "
else
ICON="󰁺 "
fi
fi
echo "$ICON"
''}/bin/get-icon";
get-remaining-time = "${pkgs.writeShellScriptBin "get-remaining-time" ''
REMAINING_ENERGY=$(cat ${battery-path}/${
if hwconfig == "kylekrein-mac"
then "energy_now"
else "charge_now"
})
POWER_USAGE=$(cat ${battery-path}/${
if hwconfig.hostname == "kylekrein-mac"
then "power_now"
else "current_now"
})
if [[ -n "$REMAINING_ENERGY" && -n "$POWER_USAGE" && "$POWER_USAGE" -ne 0 ]]; then
TIME_LEFT=$((${
if hwconfig.hostname == "kylekrein-mac"
then "0 - "
else ""
}(REMAINING_ENERGY / POWER_USAGE)))
MINUTES_LEFT=$(((${
if hwconfig.hostname == "kylekrein-mac"
then "0 - "
else ""
}( (REMAINING_ENERGY * 60) / POWER_USAGE )) - (TIME_LEFT * 60)))
echo "$TIME_LEFT h $MINUTES_LEFT min"
else
echo ""
fi
''}/bin/get-remaining-time";
in {
available = hwconfig.isLaptop;
icon = get-icon;
status = get-status;
time = get-remaining-time;
level = get-battery-level;
labelAdaptive = "${pkgs.writeShellScriptBin "labelAdaptive" ''
if [[ "$(${get-status})" == "Charging" ]]; then
echo "$(${get-battery-level})% $(${get-icon})"
else
echo "$(${get-remaining-time}) $(${get-icon})"
fi
''}/bin/labelAdaptive";
labelPercent = "${pkgs.writeShellScriptBin "labelPercent" ''
echo "$(${get-battery-level})% $(${get-icon})"
''}/bin/labelPercent";
}

View file

@ -1,24 +0,0 @@
{
config,
username,
pkgs,
lib,
inputs,
hwconfig,
...
}: {
imports =
[
./git.nix
]
++ lib.optional (lib.strings.hasInfix "kylekrein" hwconfig.hostname) (
import ./niri.nix {
inherit pkgs;
inherit config;
inherit username;
inherit inputs;
inherit hwconfig;
inherit lib;
}
);
}

View file

@ -1,29 +0,0 @@
{
config,
pkgs,
hwconfig,
inputs,
...
}: let
emacs = inputs.emacs-kylekrein.packages.${hwconfig.system}.with-lsps;
in {
programs.emacs = {
enable = true;
package = emacs;
};
systemd.user.services.emacs = {
Unit = {
Description = "Launches (and relaunches) emacs";
};
Install = {
WantedBy = ["default.target"];
};
Service = {
ExecStart = "${pkgs.writeShellScript "run-emacs" ''
${emacs}/bin/emacs --fg-daemon
''}";
Restart = "on-failure";
RestartSec = 5;
};
};
}

View file

@ -1,12 +0,0 @@
{pkgs, ...}: {
programs.git = {
enable = true;
userName = "Aleksandr Lebedev";
userEmail = "alex.lebedev2003@icloud.com";
extraConfig = {
credential.helper = "manager";
credential."https://github.com".username = "KyleKrein";
credential.credentialStore = "plaintext";
};
};
}

View file

@ -1,99 +0,0 @@
{
pkgs,
lib,
hwconfig,
...
}: let
profile-image = ./nixos-warbler.png;
battery-level =
(import ./battery-status.nix {
inherit pkgs;
inherit hwconfig;
}).labelPercent;
in {
programs.hyprlock = {
enable = true;
settings = {
general = {
#enable_fingerprint = true;
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = false;
grace = 10;
};
background = {
path = "${../../modules/hyprland/wallpaper.jpg}";
blur_passes = 1;
blur_size = 7;
noise = 0.0117;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
};
image = {
path = "${profile-image}";
size = 150;
border_size = 4;
#border_color = "rgb(0C96F9)";
rounding = -1; # Negative means circle
position = "0, 220";
halign = "center";
valign = "center";
};
input-field = {
size = "600, 100";
outline_thickness = 3;
dots_size = 0.33;
dots_spacing = 0.15;
dots_center = true;
dots_rounding = -1;
dots_fade_time = 200;
placeholder_text = "<i>Input Password...</i>";
hide_input = false;
fade_on_empty = false;
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
fail_timeout = 2000;
fail_transition = 300;
position = "0, -20";
halign = "center";
valign = "center";
};
label =
[
{
text = "$USER";
font_family = "Fira Code";
font_size = 56;
position = "0, 100";
halign = "center";
valign = "center";
}
{
text = "$TIME";
font_family = "Roboto";
font_size = 72;
position = "-40, -40";
halign = "right";
valign = "top";
}
{
text = "$LAYOUT";
font_family = "JetBrains Mono";
font_size = 28;
position = "-20, 20";
halign = "right";
valign = "bottom";
}
]
++ lib.optional (hwconfig.isLaptop) {
text = ''cmd[update:10000] ${battery-level}'';
font_family = "JetBrains Mono";
font_size = 28;
position = "20, 20";
halign = "left";
valign = "bottom";
};
};
};
}

View file

@ -1,56 +0,0 @@
/*
distancethreshold: Minimum cutoff for a gestures to take effect
degreesleniency: Offset degrees within which gesture is recognized (max=45)
timeoutms: Maximum duration for a gesture to take place in miliseconds
orientation: Number of 90 degree turns to shift gestures by
verbose: 1=enabled, 0=disabled; helpful for debugging
device: Path to the /dev/ filesystem device events should be read from
gestures: Array of gestures; binds num of fingers / gesturetypes to commands
Supported gestures: SwipeLR, SwipeRL, SwipeDU, SwipeUD,
SwipeDLUR, SwipeURDL, SwipeDRUL, SwipeULDR
*/
unsigned int distancethreshold = 125;
unsigned int distancethreshold_pressed = 60;
unsigned int degreesleniency = 15;
unsigned int timeoutms = 800;
unsigned int orientation = 0;
unsigned int verbose = 1;
double edgesizeleft = 50.0;
double edgesizetop = 50.0;
double edgesizeright = 50.0;
double edgesizebottom = 50.0;
double edgessizecaling = 1.0;
char *device = "/dev/touchscreen";
// Gestures can also be specified interactively from the command line using -g
Gesture gestures[] = {
{1, SwipeRL, EdgeRight, DistanceAny, ActModeReleased,
"niri msg action focus-column-right"},
{1, SwipeLR, EdgeLeft, DistanceAny, ActModeReleased,
"niri msg action focus-column-left"},
{1, SwipeDU, CornerBottomRight, DistanceMedium, ActModeReleased,
"niri msg action focus-workspace-down"},
{1, SwipeUD, CornerTopRight, DistanceMedium, ActModeReleased,
"niri msg action focus-workspace-up"},
{1, SwipeDU, CornerBottomLeft, DistanceShort, ActModeReleased,
"niri msg action switch-preset-column-width"},
//{1, SwipeUD, EdgeTop, DistanceAny, ActModeReleased, "nwggrid -o 0.98"},
//"pkill -SIGRTMIN -f wvkbd"},
//{2, SwipeUD, EdgeAny, DistanceAny, ActModeReleased,
//"sway-interactive-screenshot -s focused-output"},
//{3, SwipeLR, EdgeAny, DistanceAny, ActModeReleased,
//"swaymsg layout tabbed"},
//{3, SwipeRL, EdgeAny, DistanceAny, ActModeReleased,
//"swaymsg layout toggle split"},
{2, SwipeUD, EdgeLeft, DistanceShort, ActModePressed,
"niri msg action fullscreen-window"},
{2, SwipeUD, EdgeRight, DistanceMedium, ActModeReleased,
"niri msg action close-window"},
{2, SwipeDU, EdgeBottom, DistanceAny, ActModeReleased,
"pkill -34 -f wvkbd"},
//{2, SwipeUD, EdgeBottom, DistanceAny, ActModeReleased,
//"pkill -9 -f wvkbd-mobintl"},
{3, SwipeDU, EdgeAny, DistanceAny, ActModeReleased,
"niri msg action toggle-overview"},
};

View file

@ -1,2 +0,0 @@
{pkgs}:
pkgs.lisgd.override {conf = ./lisgd-config.h;}

View file

@ -1,408 +0,0 @@
#https://github.com/sodiboo/niri-flake/blob/main/default-config.kdl.nix
#https://github.com/sodiboo/niri-flake/blob/main/docs.md
#https://github.com/sodiboo/system/blob/main/niri.mod.nix
{
config,
pkgs,
lib,
inputs,
hwconfig,
username,
...
}: let
lisgd-patched = pkgs.callPackage ./lisgd.nix {};
wvkbd-patched = pkgs.callPackage ./wvkbd.nix {};
in {
programs.fuzzel = {
enable = true;
settings.main.terminal = "kitty";
};
services.swaync = {
enable = true;
};
imports = [
./waybar
./hyprlock.nix
./emacs.nix
];
home.packages = with pkgs;
[
nwg-drawer
wlogout
brightnessctl
fuzzel
waybar
swaybg
libnotify
hyprlock
networkmanagerapplet
]
++ lib.optionals (hwconfig.hasTouchscreen) (with pkgs; [
wvkbd-patched # https://github.com/jjsullivan5196/wvkbd
lisgd-patched
]);
programs.niri = {
settings = {
outputs = lib.mkIf (hwconfig.hostname == "kylekrein-homepc") {
"DP-1" = {
scale = 1.6;
position.x = 1600;
position.y = 0;
};
"DP-3" = {
scale = 1.6;
position.x = 0;
position.y = 0;
};
};
spawn-at-startup = let
set-low-brightness = lib.mkIf (hwconfig.isLaptop) {
command = [
"${lib.getExe pkgs.brightnessctl}"
"set"
(
if hwconfig.hostname == "kylekrein-framework12"
then "20%"
else "25%"
)
];
};
touchscreen-gestures = lib.mkIf (hwconfig.hasTouchscreen) {
command = [
"${lisgd-patched}/bin/lisgd" #https://git.sr.ht/~mil/lisgd
];
};
touchscreen-keyboard = lib.mkIf (hwconfig.hasTouchscreen) {
command = [
"${wvkbd-patched}/bin/wvkbd"
"--hidden"
];
};
in [
set-low-brightness
touchscreen-gestures
touchscreen-keyboard
{
command = [
"${lib.getExe pkgs.networkmanagerapplet}"
];
}
{
command = [
"${lib.getExe pkgs.networkmanagerapplet}"
];
}
{
command = [
"dbus-update-activation-environment"
"--systemd"
"--all"
];
}
{
command = [
"${pkgs.solaar}/bin/solaar"
"-w"
"hide"
];
}
{
command = [
"${lib.getExe pkgs.swaybg}"
"-m"
"fill"
"-i"
"${../../modules/hyprland/wallpaper.jpg}"
];
}
];
layout = {
preset-column-widths = [
{proportion = 1.0 / 2.0;}
{proportion = 1.0;}
{proportion = 2.0 / 3.0;}
{proportion = 1.0 / 3.0;}
];
default-column-width = {proportion = 1.0 / 2.0;};
};
binds = with config.lib.niri.actions; let
sh = spawn "sh" "-c";
emacs = action: sh "emacsclient -c --eval \"${action}\"";
homedir = "/home/${username}/";
screenshot-annotate = sh ''${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -w 0)" -t ppm - | ${lib.getExe pkgs.satty} --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush'';
in {
"Mod+E".action = sh "emacsclient -c";
"Mod+Shift+C".action = sh "dolphin";
"Mod+C".action = emacs ''(dirvish \"${homedir}\")'';
"Mod+T".action = spawn "kitty";
"Mod+D".action = spawn "fuzzel";
"Mod+B".action = spawn "librewolf";
"Mod+H".action = show-hotkey-overlay;
"Mod+F".action = fullscreen-window;
"Mod+R".action = switch-preset-column-width;
"Mod+Q".action = close-window;
"Mod+Shift+S".action = screenshot-annotate;
"Mod+1".action = focus-workspace 1;
"Mod+2".action = focus-workspace 2;
"Mod+3".action = focus-workspace 3;
"Mod+4".action = focus-workspace 4;
"Mod+5".action = focus-workspace 5;
"Mod+6".action = focus-workspace 6;
"Mod+7".action = focus-workspace 7;
"Mod+8".action = focus-workspace 8;
"Mod+9".action = focus-workspace 9;
"Mod+0".action = focus-workspace 10;
"Mod+Shift+1".action.move-column-to-workspace = 1;
"Mod+Shift+2".action.move-column-to-workspace = 2;
"Mod+Shift+3".action.move-column-to-workspace = 3;
"Mod+Shift+4".action.move-column-to-workspace = 4;
"Mod+Shift+5".action.move-column-to-workspace = 5;
"Mod+Shift+6".action.move-column-to-workspace = 6;
"Mod+Shift+7".action.move-column-to-workspace = 7;
"Mod+Shift+8".action.move-column-to-workspace = 8;
"Mod+Shift+9".action.move-column-to-workspace = 9;
"Mod+Shift+0".action.move-column-to-workspace = 10;
"Mod+Left".action = focus-column-left;
"Mod+Right".action = focus-column-right;
"Mod+Up".action = focus-workspace-up;
"Mod+Down".action = focus-workspace-down;
"Mod+Shift+Left".action = move-column-left;
"Mod+Shift+Right".action = move-column-right;
"Mod+Shift+Up".action = move-column-to-workspace-up;
"Mod+Shift+Down".action = move-column-to-workspace-down;
"Mod+Ctrl+Left".action = focus-monitor-left;
"Mod+Ctrl+Right".action = focus-monitor-right;
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
"XF86AudioRaiseVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+";
"XF86AudioLowerVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
"XF86AudioMute".action = sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86MonBrightnessUp".action = sh "brightnessctl set 10%+";
"XF86MonBrightnessDown".action = sh "brightnessctl set 10%-";
#"Mod+Tab".action = focus-window-down-or-column-right;
#"Mod+Shift+Tab".action = focus-window-up-or-column-left;
"Mod+Tab".action = toggle-overview;
};
input = {
power-key-handling.enable = hwconfig.hostname != "kylekrein-framework12";
focus-follows-mouse = {
#enable = true;
};
warp-mouse-to-focus.enable = true;
keyboard = {
xkb.layout = "us, ru, de";
xkb.options =
"grp:lctrl_toggle, ctrl:nocaps"
+ (
if hwconfig.hostname == "kylekrein-mac"
then ", altwin:swap_alt_win"
else ""
);
track-layout = "window";
numlock = true;
};
touchpad = {
tap = true;
#accel-profile = "adaptive";
click-method = "clickfinger";
};
};
cursor = {
hide-after-inactive-ms = 10000;
};
gestures.hot-corners.enable = true;
prefer-no-csd = true;
environment = {
XDG_SESSION_TYPE = "wayland";
__GL_GSYNC_ALLOWED = "1";
QT_QPA_PLATFORM = "wayland";
DISPLAY = ":0";
};
layer-rules = [
{
#this is for later to place keyboard on top of hyprlock
matches = [{namespace = "wvkbd";}];
}
];
window-rules = [
{
#active
matches = [
{
is-active = true;
}
];
opacity = 1.0;
}
{
#inactive
matches = [
{
is-active = false;
}
];
opacity = 1.0;
}
{
#opaque
matches = [
{
app-id = "emacs";
}
{
app-id = "blender";
}
];
opacity = 1.0;
}
{
#Popups
matches = [
{
title = "emacs-run-launcher";
}
{
title = "Paradox Crash Reporter";
}
];
open-floating = true;
open-focused = true;
}
{
#PiP
matches = [
{
title = "Picture-in-Picture";
}
];
open-floating = true;
open-focused = false;
opacity = 1.0;
default-floating-position = {
x = 0;
y = 0;
relative-to = "top-right";
};
}
];
debug = lib.mkIf (hwconfig.hostname == "kylekrein-mac") {
render-drm-device = "/dev/dri/renderD128";
};
xwayland-satellite = {
enable = true;
path = "${lib.getExe pkgs.xwayland-satellite-unstable}";
};
};
};
services.hypridle = let
niri = lib.getExe config.programs.niri.package;
loginctl = "${pkgs.systemd}/bin/loginctl";
pidof = "${pkgs.procps}/bin/pidof";
locking-script = "${pidof} hyprlock || ${lib.getExe pkgs.hyprlock}";
systemctl = "${pkgs.systemd}/bin/systemctl";
#locking-script = "${pkgs.swaylock}/bin/swaylock --daemonize";
#unlocking-script = "pkill -SIGUSR1 swaylock";
suspendScript = cmd:
pkgs.writeShellScript "suspend-script" ''
# check if any player has status "Playing"
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
# only suspend if nothing is playing
if [ $? == 1 ]; then
${cmd}
fi
'';
in {
enable = true;
settings.general = {
before_sleep_cmd = "${pidof} hyprlock || ${loginctl} lock-session;#${niri} msg action power-off-monitors";
after_sleep_cmd = "#${niri} msg action power-on-monitors";
lock_cmd = "${locking-script}";
};
settings.listener = let
secondary = "${systemctl} suspend";
in
lib.mkIf (hwconfig.isLaptop) [
#{
# timeout = 30;
# command = "pidof hyprlock && ${secondary}";
#}
{
timeout = 870;
on-timeout = "${suspendScript ''${pkgs.libnotify}/bin/notify-send "You are idle. Going to sleep in 30 seconds"''}";
}
{
timeout = 900;
on-timeout = "${suspendScript "${systemctl} suspend"}";
}
];
};
services = {
mako = {
enable = false;
settings = {
};
};
};
systemd.user.services.lisgd-niri = lib.mkIf (hwconfig.hasTouchscreen) {
Unit = {
Description = "Makes sure that you have touchscreen gestures.";
};
Install = {
WantedBy = ["default.target"];
};
Service = {
ExecStart = "${pkgs.writeShellScript "run-lisgd" ''
${lisgd-patched}/bin/lisgd
''}";
Restart = "on-failure";
RestartSec = 5;
};
};
systemd.user.services.autorotate = lib.mkIf (hwconfig.hasTouchscreen) {
Unit = {
Description = "Adds auto rotation to Niri.";
};
Install = {
WantedBy = ["default.target"];
};
Service = {
ExecStart = "${pkgs.writeShellScript "autorotate" ''
transform="normal"
monitor-sensor | while read -r line; do
case "$line" in
*normal*)
new_transform="normal"
;;
*right-up*)
new_transform="270"
;;
*bottom-up*)
new_transform="180"
;;
*left-up*)
new_transform="90"
;;
*)
continue
;;
esac
if [[ "$new_transform" != "$transform" ]]; then
transform="$new_transform"
echo "Transform: $transform"
niri msg output eDP-1 transform "$transform"
systemctl --user restart lisgd-niri.service
fi
done
''}";
Restart = "always";
RestartSec = 5;
};
};
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

View file

@ -1,206 +0,0 @@
{
pkgs,
lib,
hwconfig,
...
}: let
battery = import ../battery-status.nix {
inherit pkgs;
inherit hwconfig;
};
in {
programs.waybar = {
enable = true;
systemd.enable = true;
#window#waybar {
# background: transparent;
#border-bottom: none;
#}
#${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"}
style = ''
${builtins.readFile ./waybarstyle.css}'';
settings = [
{
height = 36;
layer = "top";
position = "top";
tray = {spacing = 3;};
modules-center = [
#"hyprland/window"
"clock"
];
modules-left = [
"custom/drawer"
"wlr/taskbar"
"niri/workspaces"
"niri/window"
];
modules-right =
lib.optional hwconfig.isLaptop "backlight"
++ [
"pulseaudio"
#"network"
#"cpu"
"memory"
#"temperature"
"niri/language"
]
++ lib.optional battery.available "custom/battery"
++ [
"tray"
"custom/notification"
#"custom/disablehypridle"
"custom/power"
];
battery = {
format = " {time} {icon} ";
format-alt = " {capacity}% {icon} ";
format-charging = " {capacity}% ";
format-icons = ["" "" "" "" ""];
format-plugged = " {capacity}% ";
states = {
critical = 10;
warning = 20;
};
};
backlight = {
format = "{percent}% 󰛩";
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s 5%+";
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
};
"custom/battery" = {
exec = "${pkgs.writeShellScriptBin "battery-widget" ''
${battery.labelAdaptive}
${battery.labelPercent}
''}/bin/battery-widget";
interval = 20;
tooltip = true;
};
clock = {
format = "{:%a %d | %H:%M}";
format-alt = "{:%d.%m.%Y}";
tooltip-format = "{:%d.%m.%Y | %H:%M}";
};
cpu = {
format = "{usage}% ";
tooltip = false;
};
"custom/drawer" = {
format = "<span foreground='white'>󱄅</span>";
tooltip = false;
on-click = ''nwg-drawer -fm "dolphin" -closebtn "right" -nocats -term "kitty" -ovl -wm "niri" -s "${./drawerstyle.css}" '';
};
"niri/language" = {
format = "{}";
format-en = "EN";
format-ru = "RU";
format-de = "DE";
on-click = "niri msg action switch-layout next";
on-click-right = "niri msg action switch-layout prev";
};
"wlr/taskbar" = {
format = "{icon}";
icon-size = 18;
tooltip-format = "{title}";
on-click = "activate";
on-click-middle = "close";
};
memory = {
interval = 1;
format = " {used}/{total}Gb";
};
network = {
interval = 1;
format-alt = "{ifname}: {ipaddr}/{cidr}";
format-disconnected = "Disconnected ";
format-ethernet = "{ifname}: {ipaddr}/{cidr} up: {bandwidthUpBits} down: {bandwidthDownBits}";
format-linked = "{ifname} (No IP) ";
#format-wifi = "{signalStrength}% ";
format-wifi = "{signalStrength}% ";
tooltip-format = "{essid} ({signalStrength}%) ";
};
pulseaudio = {
format = "{icon} {volume}% {format_source}";
format-bluetooth = "{icon} {volume}% {format_source}";
format-bluetooth-muted = " {format_source}";
format-icons = {
car = "";
default = [" " " " " "];
handsfree = "";
headphones = "";
headset = "";
phone = "";
portable = "";
};
format-muted = " {format_source}";
format-source = " {volume}%";
format-source-muted = " ";
on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol";
};
"hyprland/submap" = {format = ''<span style="italic">{}</span>'';};
temperature = {
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" ""];
};
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = false;
warp-on-scroll = true;
format = "{name}{icon} ";
format-icons = {
urgent = "";
active = "";
default = "";
};
#persistent-workspaces = {
# "*" = 3;
#};
};
"custom/power" = {
format = "";
tooltip = false;
on-click = "wlogout";
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "<span foreground='red'></span>";
none = "";
dnd-notification = "<span foreground='red'></span>";
dnd-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "sleep 0.1 && swaync-client -t -sw";
on-click-right = "sleep 0.1 && swaync-client -d -sw";
escape = true;
};
"custom/disablehypridle" = {
exec = ''
if pgrep -x "hypridle" > /dev/null; then
echo "{\"text\": \" \", \"tooltip\": \"Hypridle is running\", \"class\": \"active\"}";
else
echo "{\"text\": \" \", \"tooltip\": \"Hypridle is not running\", \"class\": \"inactive\"}";
fi
'';
return-type = "json";
on-click = ''
if pgrep -x "hypridle" > /dev/null; then
pkill hypridle
else
hypridle &
fi
'';
};
}
];
};
}

View file

@ -1,47 +0,0 @@
* {
border: none;
font-family: Font Awesome, Roboto, Arial, sans-serif;
font-size: 16px;
color: #eeeeee;
border-radius: 10px;
}
window {
background-color: rgba(50, 63, 99, 0.718);
color: #eeeeee;
}
/* search entry */
entry {
background-color: rgba(0, 0, 0, 0.2)
}
button, image {
background: none;
border: none
}
button:hover {
background-color: rgba(255, 255, 255, 0.1)
}
/* in case you wanted to give category buttons a different look */
#category-button {
margin: 0 10px 0 10px
}
#pinned-box {
padding-bottom: 5px;
border-bottom: 1px dotted gray
}
#files-box {
padding: 5px;
border: 1px dotted gray;
border-radius: 15px
}
/* math operation result label */
#math-label {
font-weight: bold;
font-size: 16px
}

View file

@ -1,104 +0,0 @@
* {
border: none;
font-family: Font Awesome, Roboto, Arial, sans-serif;
font-size: 16px;
color: #B9826A;
border-radius: 10px;
}
window {
font-weight: bold;
}
window#waybar {
background: transparent;
}
/*-----module groups----*/
.modules-right {
background-color: rgba(0,43,51,0.85);
margin: 2px 10px 0 0;
}
.modules-center {
background-color: rgba(0,43,51,0.85);
margin: 2px 0 0 0;
}
.modules-left {
margin: 2px 0 0 5px;
background-color: rgba(0,43,51,0.85);
}
/*-----modules indv----*/
#workspaces button {
padding: 1px 5px;
background-color: transparent;
}
#workspaces button:hover {
box-shadow: inherit;
background-color: rgba(0,153,153,1);
}
#workspaces button.focused {
background-color: rgba(0,119,179,0.6);
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#niri-language,
#language,
#custom-power,
#custom-menu,
#custom-battery,
#custom-notification,
#custom-drawer,
#backlight,
#workspaces,
#window,
#taskbar,
#idle_inhibitor {
margin: 0px 0px;
padding: 0px 5px;
border-right: 1px solid rgba(255,255,255,0.2);
border-radius: 0px;
}
#clock,
#custom-power,
#window {
border-right: none;
}
#custom-drawer {
font-size: 20px;
}
#custom-power,
#custom-drawer,
#custom-notification {
padding: 0px 0.5em 0px 0.3em;
}
#mode {
color: #cc3436;
font-weight: bold;
}
/*-----Indicators----*/
#idle_inhibitor.activated {
color: #2dcc36;
}
#pulseaudio.muted {
color: #cc3436;
}
#battery.charging {
color: #2dcc36;
}
#battery.warning:not(.charging) {
color: #e6e600;
}
#battery.critical:not(.charging) {
color: #cc3436;
}
#temperature.critical {
color: #cc3436;
}

View file

@ -1,27 +0,0 @@
From 764c39633aa4bb8b94463dd19961bb4e9c78be26 Mon Sep 17 00:00:00 2001
From: Maarten van Gompel <proycon@anaproy.nl>
Date: Sun, 31 Mar 2024 13:57:24 +0200
Subject: [PATCH] debug: include trailing \0 byte in call to
zwp_virtual_keyboard_v1.keymap()
Ref: https://github.com/jjsullivan5196/wvkbd/issues/70
---
keyboard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/keyboard.c b/keyboard.c
index afe0639..cd9a11e 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -678,7 +678,7 @@ create_and_upload_keymap(struct kbd *kb, const char *name, uint32_t comp_unichr,
size_t keymap_size = strlen(keymap_template) + 64;
char *keymap_str = malloc(keymap_size);
sprintf(keymap_str, keymap_template, comp_unichr, comp_shift_unichr);
- keymap_size = strlen(keymap_str);
+ keymap_size = strlen(keymap_str) + 1;
int keymap_fd = os_create_anonymous_file(keymap_size);
if (keymap_fd < 0) {
die("could not create keymap fd\n");
--
2.49.0

View file

@ -1,18 +0,0 @@
{
wvkbd,
fetchFromGitHub,
...
}: let
niri-patch = ./wvkbd-niri.patch; #https://github.com/jjsullivan5196/wvkbd/issues/70
in
wvkbd.overrideAttrs (final: prev: {
version = "0.17";
src = fetchFromGitHub {
owner = "Paulicat";
repo = "wvkbd";
rev = "ac02545ab6f6ccfa5b6f132414021ba57ea73096";
hash = "sha256-py/IqNEEaTOx/9W935Vc47WoNFz99+bNaYD0sL//JmY=";
};
installFlags = prev.installFlags ++ ["LAYOUT=vistath"];
patches = prev.patches or [] ++ [niri-patch];
})

View file

@ -1,333 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
config,
lib,
pkgs,
hwconfig,
first-nixos-install,
inputs,
unstable-pkgs,
...
}: {
programs.firefox.policies.Preferences."browser.startup.page" = lib.mkForce 1;
imports =
[
inputs.sops-nix.nixosModules.sops
inputs.stylix.nixosModules.stylix
inputs.nixos-facter-modules.nixosModules.facter
inputs.home-manager.nixosModules.default
inputs.disko.nixosModules.default
inputs.chaotic.nixosModules.nyx-cache
inputs.chaotic.nixosModules.nyx-overlay
inputs.chaotic.nixosModules.nyx-registry
../../modules/firefox
#../../modules/flatpak
../../modules/steam
../../modules/ly
../../modules/sddm
../../modules/services/autoupgrade
../../modules/sops
#../../modules/emacs
./default.nix
]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
facter.reportPath = ./facter.json;
kylekrein.services.autoUpgrade = {
enable = false;
pushUpdates = false;
configDir = "/etc/nixos-config";
user = "root";
};
services.scx.enable = true; # by default uses scx_rustland scheduler
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_cachyos;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
loader.timeout = 0;
};
networking.hostName = hwconfig.hostname;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
#flatpak
#kk.services.flatpak.enable = true;
#services.flatpak.packages = [
#];
services.pipewire = {
extraLv2Packages = [pkgs.rnnoise-plugin];
configPackages = [
(pkgs.writeTextDir "share/pipewire/pipewire.conf.d/20-rnnoise.conf" ''
context.modules = [
{ name = libpipewire-module-filter-chain
args = {
node.description = "Noise Canceling source"
media.name = "Noise Canceling source"
filter.graph = {
nodes = [
{
type = lv2
name = rnnoise
plugin = "https://github.com/werman/noise-suppression-for-voice#stereo"
label = noise_suppressor_stereo
control = {
}
}
]
}
capture.props = {
node.name = "capture.rnnoise_source"
node.passive = true
}
playback.props = {
node.name = "rnnoise_source"
media.class = Audio/Source
}
}
}
]
'')
];
};
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "ru_RU.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us,ru";
variant = "";
options = "grp:caps_toggle";
};
console.keyMap = "us";
services.udisks2.enable = true;
users = {
mutableUsers = false;
users = {
root = {
# disable root login here, and also when installing nix by running nixos-install --no-root-passwd
# https://discourse.nixos.org/t/how-to-disable-root-user-account-in-configuration-nix/13235/3
hashedPassword = "!"; # disable root logins, nothing hashes to !
};
};
};
#qt = {
# enable = true;
# platformTheme = "qt5ct";
# style = "kvantum";
#};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
libreoffice
fzf
killall
eza
fd
gparted
exfatprogs
lazygit
fastfetch
telegram-desktop
vlc
wl-clipboard
git
git-credential-manager
egl-wayland
btop
obs-studio
blender
vscodium-fhs
discord
solaar
element-desktop
unstable-pkgs.wasistlos
prismlauncher
unstable-pkgs.mcpelauncher-ui-qt
jdk
teams-for-linux
];
programs.kdeconnect.enable = true;
programs.kdeconnect.package = lib.mkDefault pkgs.kdePackages.kdeconnect-kde;
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/etc/nixos-config";
};
fonts.packages = with unstable-pkgs; [
#TODO change to pkgs when 25.05 comes out
nerd-fonts.jetbrains-mono
font-awesome
nerd-fonts.symbols-only
hack-font
# microsoft fonts:
#corefonts
#vistafonts
];
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
#MANPAGER = "emacsclient -c -a 'emacs' +Man!";
#EDITOR = "emacsclient -c -a 'emacs'";
};
hardware = {
graphics = {
enable = true;
};
logitech.wireless.enable = true;
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
};
};
};
};
services.blueman.enable = true;
security.polkit.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
stylix = {
enable = false;
image = "${../../modules/hyprland/wallpaper.jpg}";
autoEnable = true;
opacity = {
desktop = 0.0; #0.5;
};
targets = {
gtk.enable = true;
plymouth = {
enable = true;
#logo = ./fastfetch/nixos.png;
logoAnimated = false;
};
};
fonts = {
sizes = {
applications = 14;
desktop = 12;
popups = 12;
terminal = 16;
};
};
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
};
programs.bash = {
shellAliases = {
ls = "${pkgs.eza}/bin/eza --icons=always";
};
};
#services.flatpak.enable = true;
#services.flatpak.packages = [
# "flathub:app/org.kde.dolphin//stable"
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
kk.steam.enable = true;
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
# require public key authentication for better security
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "no";
};
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [22 25565];
networking.firewall.allowedUDPPorts = [22 25565];
# Or disable the firewall altogether.
#networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
substituters = [
"https://hyprland.cachix.org"
"https://nix-gaming.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
}

View file

@ -1,35 +0,0 @@
{
pkgs,
config,
lib,
hwconfig,
inputs,
...
}: {
imports = [
../../hardware/nvidia
../../modules/gnome
../../users/kylekrein
../../users/andrej
];
zramSwap = {
enable = true; # Hopefully? helps with freezing when using swap
};
services.zerotierone = {
enable = true;
joinNetworks = [
"a09acf0233dccb4a"
"1d71939404962783"
"41d49af6c260338d"
];
};
hardware.nvidia.open = lib.mkForce false;
#hardware.nvidia.package = lib.mkForce config.boot.kernelPackages.nvidiaPackages.latest;
systemd.network.wait-online.enable = lib.mkForce false;
}

File diff suppressed because it is too large Load diff

View file

@ -1,27 +0,0 @@
{
pkgs,
inputs,
...
}: {
imports = [
];
environment.packages = with pkgs; [
neovim
git
fastfetch
asciiquarium
cmatrix
#inputs.neovim.packages.aarch64-linux.default
(pkgs.writeShellScriptBin "droid-switch" ''
nix-on-droid switch --flake /data/data/com.termux.nix/files/home/nixos-config
'')
inputs.emacs-kylekrein.packages.aarch64-linux.default
];
home-manager = {
config = ./home.nix;
useGlobalPkgs = true;
};
system.stateVersion = "24.05";
}

View file

@ -1,22 +0,0 @@
{
pkgs,
config,
lib,
...
}: {
imports = [
#../../modules/nixvim
../../homes/kylekrein/git.nix
];
home.activation = {
copyFont = let
font_src = "${pkgs.nerd-fonts.fira-code}/share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf";
font_dst = "${config.home.homeDirectory}/.termux/font.ttf";
in
lib.hm.dag.entryAfter ["writeBoundary"] ''
( test ! -e "${font_dst}" || test $(sha1sum "${font_src}"|cut -d' ' -f1 ) != $(sha1sum "${font_dst}" |cut -d' ' -f1)) && $DRY_RUN_CMD install $VERBOSE_ARG -D "${font_src}" "${font_dst}"
'';
};
home.stateVersion = "24.05";
}

View file

@ -1,31 +0,0 @@
{
self,
pkgs,
inputs,
...
}: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
neovim
kitty
yazi
inputs.neovim.packages.${pkgs.system}.default
];
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Enable alternative shell support in nix-darwin.
# programs.fish.enable = true;
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 5;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
}

View file

@ -1,93 +0,0 @@
{
options,
config,
pkgs,
unstable-pkgs,
lib,
hwconfig,
inputs,
...
}: {
imports = [
../../hardware/framework12
../../modules/niri
../../modules/libvirt
../../users/kylekrein
(import ../../modules/libvirt/user.nix {username = "kylekrein";})
../../users/tania
./hibernation.nix
./secure-boot.nix
];
services.fwupd.enable = true; #fwupdmgr update
nixpkgs.overlays = [
# Fixes java crash because of bind mount with impermanence when loading too many mods(ex. All The Mods 9)
(self: super: {
prismlauncher = pkgs.symlinkJoin {
name = "prismlauncher";
paths = [super.prismlauncher];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/prismlauncher --set HOME /persist/home/kylekrein
'';
};
})
(self: super: {
bottles = pkgs.symlinkJoin {
name = "bottles";
paths = [super.bottles];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/bottles --set HOME /persist/home/kylekrein
'';
};
})
];
environment.systemPackages = with pkgs; [
blender
ladybird
prismlauncher
];
zramSwap = {
enable = true; # Hopefully? helps with freezing when using swap
};
services.zerotierone = {
enable = false;
port = 9994;
joinNetworks = [
"A84AC5C10AD269CA"
"db64858fed285e0f"
];
};
#LLMs
services.ollama = {
enable = true;
loadModels = ["qwq" "llama3.1" "qwen2.5-coder:7b" "gpt-oss:20b"];
home = "/persist/ollama";
user = "ollama";
group = "ollama";
};
#boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
services.open-webui.enable = true;
#services.open-webui.package = unstable-pkgs.open-webui;
services.open-webui.openFirewall = false;
services.open-webui.host = "0.0.0.0";
services.open-webui.stateDir = "/persist/open-webui";
systemd.services.open-webui.serviceConfig.User = "ollama";
systemd.services.open-webui.serviceConfig.Group = "ollama";
systemd.services.open-webui.serviceConfig.DynamicUser = lib.mkForce false;
#Chat host
networking.firewall.allowedTCPPorts = [80 443 22 8448 9993 8081] ++ [config.services.zerotierone.port];
networking.firewall.allowedUDPPorts = [config.services.zerotierone.port];
systemd.network.wait-online.enable = lib.mkForce false;
}

File diff suppressed because it is too large Load diff

View file

@ -1,18 +0,0 @@
{pkgs, ...}: {
boot = {
kernelParams = [
"resume_offset=533760"
"mem_sleep_default=deep"
];
resumeDevice = "/dev/disk/by-label/nixos";
};
services.logind = {
lidSwitch = "suspend-then-hibernate";
powerKey = "suspend-then-hibernate";
powerKeyLongPress = "poweroff";
};
systemd.sleep.extraConfig = ''
HibernateDelaySec=30m
SuspendState=mem
'';
}

View file

@ -1,27 +0,0 @@
{
pkgs,
lib,
hwconfig,
...
}: {
boot = {
initrd.systemd.enable = true;
loader.systemd-boot.enable = lib.mkForce false;
lanzaboote = {
enable = true;
pkiBundle =
#if hwconfig.useImpermanence
#then "/persist/system/var/lib/sbctl"
# else
"/var/lib/sbctl";
};
};
environment.systemPackages = [
# For debugging and troubleshooting Secure Boot.
pkgs.sbctl
# For tpm auto unlock
pkgs.tpm2-tss
];
}

View file

@ -1,123 +0,0 @@
{
options,
config,
pkgs,
unstable-pkgs,
lib,
hwconfig,
inputs,
...
}: {
imports = [
../../hardware/nvidia
../../modules/niri
../../modules/libvirt
../../users/kylekrein
(import ../../modules/libvirt/user.nix {username = "kylekrein";})
../../users/tania
];
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
services.scx.enable = true; # by default uses scx_rustland scheduler
nixpkgs.overlays = [
# Fixes java crash because of bind mount with impermanence when loading too many mods(ex. All The Mods 9)
(self: super: {
prismlauncher = pkgs.symlinkJoin {
name = "prismlauncher";
paths = [super.prismlauncher];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/prismlauncher --set HOME /persist/home/kylekrein
'';
};
})
(self: super: {
bottles = pkgs.symlinkJoin {
name = "bottles";
paths = [super.bottles];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/bottles --set HOME /persist/home/kylekrein
'';
};
})
];
environment.systemPackages = with pkgs; [
blender
ladybird
prismlauncher
#inputs.nix-gaming.packages.${pkgs.system}.star-citizen
];
zramSwap = {
enable = true; # Hopefully? helps with freezing when using swap
};
services.zerotierone = {
enable = true;
port = 9994;
joinNetworks = [
"A84AC5C10AD269CA"
"db64858fed285e0f"
];
};
#LLMs
services.ollama = {
enable = true;
loadModels = ["qwq" "llama3.1" "qwen2.5-coder:7b" "gpt-oss:20b" "gpt-oss:120b"];
acceleration = "cuda";
home = "/persist/ollama";
user = "ollama";
group = "ollama";
};
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
services.open-webui.enable = true;
services.open-webui.openFirewall = false;
services.open-webui.host = "0.0.0.0";
services.open-webui.stateDir = "/persist/open-webui";
systemd.services.open-webui.serviceConfig.User = "ollama";
systemd.services.open-webui.serviceConfig.Group = "ollama";
systemd.services.open-webui.serviceConfig.DynamicUser = lib.mkForce false;
#Chat host
networking.firewall.allowedTCPPorts = [80 443 22 8448 9993 8081] ++ [config.services.zerotierone.port];
networking.firewall.allowedUDPPorts = [config.services.zerotierone.port];
# users.users.nginx.extraGroups = [ "acme" ];
services.hypridle.enable = lib.mkForce false;
programs.hyprlock.enable = lib.mkForce false;
#services.nginx.enable = true;
services.nginx = {
# Use recommended settings
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
clientMaxBodySize = "20000000";
};
services.nginx.virtualHosts = let
SSL = {
#enableACME = true;
#forceSSL = true;
#useACMEHost = "kylekrein.com";
#acmeRoot = "/var/lib/acme/challenges-kylekrein";
};
in {
"chat.kylekrein.com" =
SSL
// {
locations."/" = {
proxyPass = "http://localhost:8080/";
proxyWebsockets = true;
};
};
};
systemd.network.wait-online.enable = lib.mkForce false;
}

File diff suppressed because it is too large Load diff

View file

@ -1,31 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.virbr0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,53 +0,0 @@
{
pkgs,
lib,
hwconfig,
inputs,
config,
unstable-pkgs,
...
}: {
imports = [
inputs.apple-silicon-support.nixosModules.default
./mac-hardware-conf.nix
../../hardware/apple-silicon-linux
../../modules/niri
../../users/kylekrein
];
facter.reportPath = lib.mkForce null; #fails to generate
boot.binfmt.emulatedSystems = ["x86_64-linux"];
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
services.displayManager.sddm = {
wayland.enable = lib.mkForce false; # black screen
};
environment.systemPackages = with pkgs; [
prismlauncher
unstable-pkgs.mcpelauncher-ui-qt
];
services.ollama = {
enable = true;
loadModels = ["llama3.1" "qwen2.5-coder:7b"];
home = "/persist/ollama";
user = "ollama";
group = "ollama";
};
boot = {
kernelParams = [
"zswap.enabled=1"
"zswap.compressor=lzo"
"zswap.zpool=zsmalloc"
"zswap.max_pool_percent=50"
];
};
services.zerotierone = {
enable = true;
joinNetworks = [
"db64858fed285e0f"
];
};
}

View file

@ -1,62 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["usb_storage"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "tmpfs";
fsType = "tmpfs";
options = ["defaults" "size=8G" "mode=755"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
depends = ["/"];
neededForBoot = true;
};
fileSystems."/nix" = {
device = "/persist/nix";
options = ["bind"];
depends = ["/persist"];
};
fileSystems."/tmp" = {
device = "/persist/tmp";
options = ["bind"];
depends = ["/persist"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/EFI\\x20-\\x20NIXOS";
fsType = "vfat";
#options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [
{
device = "/persist/swapfile";
size = 16 * 1024;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View file

@ -1,377 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.kk.services.conduwuit;
defaultUser = "conduwuit";
defaultGroup = "conduwuit";
format = pkgs.formats.toml {};
configFile = format.generate "conduwuit.toml" cfg.settings;
in {
meta.maintainers = with lib.maintainers; [niklaskorz];
options.kk.services.conduwuit = {
enable = lib.mkEnableOption "conduwuit";
user = lib.mkOption {
type = lib.types.nonEmptyStr;
description = ''
The user {command}`conduwuit` is run as.
'';
default = defaultUser;
};
group = lib.mkOption {
type = lib.types.nonEmptyStr;
description = ''
The group {command}`conduwuit` is run as.
'';
default = defaultGroup;
};
extraEnvironment = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
description = "Extra Environment variables to pass to the conduwuit server.";
default = {};
example = {
RUST_BACKTRACE = "yes";
};
};
package = lib.mkPackageOption pkgs "conduwuit" {};
settings = lib.mkOption {
type = lib.types.submodule {
freeformType = format.type;
options = {
global.server_name = lib.mkOption {
type = lib.types.nonEmptyStr;
example = "example.com";
description = "The server_name is the name of this server. It is used as a suffix for user and room ids.";
};
global.address = lib.mkOption {
type = lib.types.nullOr (lib.types.listOf lib.types.nonEmptyStr);
default = null;
example = [
"127.0.0.1"
"::1"
];
description = ''
Addresses (IPv4 or IPv6) to listen on for connections by the reverse proxy/tls terminator.
If set to `null`, conduwuit will listen on IPv4 and IPv6 localhost.
Must be `null` if `unix_socket_path` is set.
'';
};
global.port = lib.mkOption {
type = lib.types.listOf lib.types.port;
default = [6167];
description = ''
The port(s) conduwuit will be running on.
You need to set up a reverse proxy in your web server (e.g. apache or nginx),
so all requests to /_matrix on port 443 and 8448 will be forwarded to the conduwuit
instance running on this port.
'';
};
global.unix_socket_path = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
Listen on a UNIX socket at the specified path. If listening on a UNIX socket,
listening on an address will be disabled. The `address` option must be set to
`null` (the default value). The option {option}`services.conduwuit.group` must
be set to a group your reverse proxy is part of.
This will automatically add a system user "conduwuit" to your system if
{option}`services.conduwuit.user` is left at the default, and a "conduwuit"
group if {option}`services.conduwuit.group` is left at the default.
'';
};
global.unix_socket_perms = lib.mkOption {
type = lib.types.ints.positive;
default = 660;
description = "The default permissions (in octal) to create the UNIX socket with.";
};
global.max_request_size = lib.mkOption {
type = lib.types.ints.positive;
default = 20000000;
description = "Max request size in bytes. Don't forget to also change it in the proxy.";
};
global.allow_registration = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether new users can register on this server.
Registration with token requires `registration_token` or `registration_token_file` to be set.
If set to true without a token configured, and
`yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse`
is set to true, users can freely register.
'';
};
global.allow_encryption = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether new encrypted rooms can be created. Note: existing rooms will continue to work.";
};
global.allow_federation = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Whether this server federates with other servers.
'';
};
global.trusted_servers = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr;
default = ["matrix.org"];
description = ''
Servers listed here will be used to gather public keys of other servers
(notary trusted key servers).
Currently, conduwuit doesn't support inbound batched key requests, so
this list should only contain other Synapse servers.
Example: `[ "matrix.org" "constellatory.net" "tchncs.de" ]`
'';
};
global.database_path = lib.mkOption {
readOnly = true;
type = lib.types.path;
default = "/var/lib/conduwuit/";
description = ''
Path to the conduwuit database, the directory where conduwuit will save its data.
Note that database_path cannot be edited because of the service's reliance on systemd StateDir.
'';
};
global.database_backup_path = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
Path to the conduwuit database, the directory where conduwuit will backup its data.
'';
};
global.database_backups_to_keep = lib.mkOption {
type = lib.types.ints.positive;
default = 1;
description = "";
};
global.allow_check_for_updates = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
If enabled, conduwuit will send a simple GET request periodically to
<https://pupbrain.dev/check-for-updates/stable> for any new announcements made.
Despite the name, this is not an update check endpoint, it is simply an announcement check endpoint.
Disabled by default.
'';
};
global.allow_local_presence = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
'';
};
global.allow_incoming_presence = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
'';
};
global.allow_outgoing_presence = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
'';
};
global.require_auth_for_profile_requests = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
'';
};
global.new_user_displayname_suffix = lib.mkOption {
type = lib.types.str;
default = "🏳";
description = ''
'';
};
global.registration_token = lib.mkOption {
type = lib.types.str;
default = "";
description = ''
'';
};
global.registration_token_file = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
'';
};
global.allow_public_room_directory_over_federation = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
'';
};
global.allow_public_room_directory_without_auth = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
'';
};
global.allow_device_name_federation = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
'';
};
global.allow_inbound_profile_lookup_federation_requests = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
'';
};
global.turn_secret = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
'';
};
global.turn_uris = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr;
default = [];
description = ''
'';
};
global.turn_secret_file = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
'';
};
global.prevent_media_downloads_from = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr;
default = [];
description = ''
'';
};
global.well_known.client = lib.mkOption {
type = lib.types.str;
default = "";
description = ''
'';
};
global.well_known.server = lib.mkOption {
type = lib.types.str;
default = "";
description = ''
'';
};
};
};
default = {};
# TOML does not allow null values, so we use null to omit those fields
apply = lib.filterAttrsRecursive (_: v: v != null);
description = ''
Generates the conduwuit.toml configuration file. Refer to
<https://conduwuit.puppyirl.gay/configuration.html>
for details on supported values.
'';
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = !(cfg.settings ? global.unix_socket_path) || !(cfg.settings ? global.address);
message = ''
In `services.conduwuit.settings.global`, `unix_socket_path` and `address` cannot be set at the
same time.
Leave one of the two options unset or explicitly set them to `null`.
'';
}
{
assertion = cfg.user != defaultUser -> config ? users.users.${cfg.user};
message = "If `services.conduwuit.user` is changed, the configured user must already exist.";
}
{
assertion = cfg.group != defaultGroup -> config ? users.groups.${cfg.group};
message = "If `services.conduwuit.group` is changed, the configured group must already exist.";
}
];
users.users = lib.mkIf (cfg.user == defaultUser) {
${defaultUser} = {
group = cfg.group;
home = cfg.settings.global.database_path;
isSystemUser = true;
};
};
users.groups = lib.mkIf (cfg.group == defaultGroup) {
${defaultGroup} = {};
};
systemd.services.conduwuit = {
description = "Conduwuit Matrix Server";
documentation = ["https://conduwuit.puppyirl.gay/"];
wantedBy = ["multi-user.target"];
wants = ["network-online.target"];
after = ["network-online.target"];
environment = lib.mkMerge [
{CONDUWUIT_CONFIG = configFile;}
cfg.extraEnvironment
];
startLimitBurst = 5;
startLimitIntervalSec = 60;
serviceConfig = {
DynamicUser = true;
User = cfg.user;
Group = cfg.group;
DevicePolicy = "closed";
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
PrivateDevices = true;
PrivateMounts = true;
PrivateTmp = true;
PrivateUsers = true;
PrivateIPC = true;
RemoveIPC = true;
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_UNIX"
];
RestrictNamespaces = true;
RestrictRealtime = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service @resources"
"~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @privileged @keyring @ipc"
];
SystemCallErrorNumber = "EPERM";
StateDirectory = "conduwuit";
StateDirectoryMode = "0700";
RuntimeDirectory = "conduwuit";
RuntimeDirectoryMode = "0750";
ExecStart = lib.getExe cfg.package;
Restart = "on-failure";
RestartSec = 10;
};
};
};
}

View file

@ -1,194 +0,0 @@
{
options,
config,
pkgs,
lib,
hwconfig,
inputs,
...
}: {
imports = [
inputs.sops-nix.nixosModules.sops
inputs.stylix.nixosModules.stylix
inputs.nixos-facter-modules.nixosModules.facter
inputs.home-manager.nixosModules.default
inputs.disko.nixosModules.default
../../modules/sops
../../modules/services/autoupgrade
./conduwuit.nix
../../users/kylekrein
./hardware.nix
./networking.nix
];
#options.services.conduwuit.settings.global.database_path = lib.mkOption { apply = old: "/persist/conduwuit/";};
config = {
home-manager.users = lib.mkForce {};
stylix.image = ../../modules/hyprland/wallpaper.jpg;
boot.tmp.cleanOnBoot = true;
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
networking.hostName = hwconfig.hostname;
users = {
mutableUsers = false;
users = {
root = {
# disable root login here, and also when installing nix by running nixos-install --no-root-passwd
# https://discourse.nixos.org/t/how-to-disable-root-user-account-in-configuration-nix/13235/3
hashedPassword = "!"; # disable root logins, nothing hashes to !
};
};
};
environment.systemPackages = with pkgs; [
neovim
git
];
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/etc/nixos-config";
};
services.openssh = {
enable = true;
# require public key authentication for better security
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "no";
};
zramSwap = {
enable = true; # Hopefully? helps with freezing when using swap
};
#Chat host
networking.firewall.allowedTCPPorts = [80 443 22 8448];
networking.firewall.allowedUDPPorts = [3478 5349];
#sops.secrets."services/conduwuit" = {mode = "0755";};
sops.secrets."services/gitlab/dbPassword" = {owner = "gitlab";};
sops.secrets."services/gitlab/rootPassword" = {owner = "gitlab";};
sops.secrets."services/gitlab/secret" = {owner = "gitlab";};
sops.secrets."services/gitlab/otpsecret" = {owner = "gitlab";};
sops.secrets."services/gitlab/dbsecret" = {owner = "gitlab";};
sops.secrets."services/gitlab/oidcKeyBase" = {owner = "gitlab";};
sops.secrets."services/gitlab/activeRecordSalt" = {owner = "gitlab";};
sops.secrets."services/gitlab/activeRecordPrimaryKey" = {owner = "gitlab";};
sops.secrets."services/gitlab/activeRecordDeterministicKey" = {owner = "gitlab";};
services.gitlab = {
enable = true;
host = "gitlab.kylekrein.com";
port = 443;
#statePath = "/persist/gitlab/state";
backup.startAt = "3:00";
databasePasswordFile = config.sops.secrets."services/gitlab/dbPassword".path;
initialRootPasswordFile = config.sops.secrets."services/gitlab/rootPassword".path;
secrets = {
secretFile = config.sops.secrets."services/gitlab/secret".path;
otpFile = config.sops.secrets."services/gitlab/otpsecret".path;
dbFile = config.sops.secrets."services/gitlab/dbsecret".path;
jwsFile = config.sops.secrets."services/gitlab/oidcKeyBase".path; #pkgs.runCommand "oidcKeyBase" {} "${pkgs.openssl}/bin/openssl genrsa 2048 > $out";
activeRecordSaltFile = config.sops.secrets."services/gitlab/activeRecordSalt".path;
activeRecordPrimaryKeyFile = config.sops.secrets."services/gitlab/activeRecordPrimaryKey".path;
activeRecordDeterministicKeyFile = config.sops.secrets."services/gitlab/activeRecordDeterministicKey".path;
};
};
systemd.services.gitlab-backup.environment.BACKUP = "dump";
kk.services.conduwuit = {
enable = true;
#user = "turnserver";
settings = {
global = {
server_name = "kylekrein.com";
well_known = {
server = "matrix.kylekrein.com:443";
client = "https://matrix.kylekrein.com";
};
port = [6167];
trusted_servers = ["matrix.org"];
allow_registration = false;
registration_token = null; #nix shell nixpkgs#openssl -c openssl rand -base64 48 | tr -d '/+' | cut -c1-64
allow_federation = true;
allow_encryption = true;
allow_local_presence = true;
require_auth_for_profile_requests = true;
};
};
extraEnvironment = {
};
};
services.caddy = {
enable = true;
#virtualHosts."kylekrein.com:8448".extraConfig = ''
# reverse_proxy http://localhost:6167
#'';
virtualHosts."kylekrein.com".extraConfig = ''
handle_path /.well-known/matrix/* {
header Access-Control-Allow-Origin *
## `Content-Type: application/json` isn't required by the matrix spec
## but some browsers (firefox) and some other tooling might preview json
## content prettier when they are made aware via Content-Type
header Content-Type application/json
respond /client `{ "m.homeserver": { "base_url": "https://matrix.kylekrein.com/" }, "org.matrix.msc3575.proxy": { "url": "https://matrix.kylekrein.com/"}, "org.matrix.msc4143.rtc_foci": [ { "type": "livekit", "livekit_service_url": "https://livekit-jwt.call.matrix.org" } ] }`
respond /server `{ "m.server": "https://matrix.kylekrein.com" }`
## return http/404 if nothing matches
respond 404
}
respond /.well-known/element/element.json `{"call":{"widget_url":"https://call.element.io"}}`
reverse_proxy * http://localhost:6167
'';
# reverse_proxy /.well-known/* http://localhost:6167
#'';
virtualHosts."matrix.kylekrein.com".extraConfig = ''
handle_path /.well-known/matrix/* {
header Access-Control-Allow-Origin *
## `Content-Type: application/json` isn't required by the matrix spec
## but some browsers (firefox) and some other tooling might preview json
## content prettier when they are made aware via Content-Type
header Content-Type application/json
respond /client `{ "m.homeserver": { "base_url": "https://matrix.kylekrein.com/" }, "org.matrix.msc3575.proxy": { "url": "https://matrix.kylekrein.com/"}, "org.matrix.msc4143.rtc_foci": [ { "type": "livekit", "livekit_service_url": "https://livekit-jwt.call.matrix.org" } ] }`
respond /server `{ "m.server": "https://matrix.kylekrein.com" }`
## return http/404 if nothing matches
respond 404
}
respond /.well-known/element/element.json `{"call":{"widget_url":"https://call.element.io"}}`
reverse_proxy * http://localhost:6167
'';
virtualHosts."gitlab.kylekrein.com".extraConfig = ''
reverse_proxy * unix//run/gitlab/gitlab-workhorse.socket
'';
};
system.stateVersion = "24.11";
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
substituters = [
"https://hyprland.cachix.org"
"https://nix-gaming.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
};
}

View file

@ -1,32 +0,0 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/4f7e141c-0fc7-415a-815d-944b36f93806";
fsType = "ext4";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -1,48 +0,0 @@
{lib, ...}: {
# This file was populated at runtime with the networking
# details gathered from the active system.
networking = {
nameservers = [
"8.8.8.8"
];
defaultGateway = "172.31.1.1";
defaultGateway6 = {
address = "";
interface = "eth0";
};
dhcpcd.enable = false;
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [
{
address = "91.99.0.169";
prefixLength = 32;
}
];
ipv6.addresses = [
{
address = "fe80::9400:4ff:fe30:830e";
prefixLength = 64;
}
];
ipv4.routes = [
{
address = "172.31.1.1";
prefixLength = 32;
}
];
ipv6.routes = [
{
address = "";
prefixLength = 128;
}
];
};
};
};
services.udev.extraRules = ''
ATTR{address}=="96:00:04:30:83:0e", NAME="eth0"
'';
}

View file

@ -1,12 +0,0 @@
{
pkgs,
lib,
hwconfig,
inputs,
config,
unstable-pkgs,
...
}: {
imports = [
];
}

View file

@ -1,4 +0,0 @@
{...}: {
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
}

View file

@ -1,6 +0,0 @@
{pkgs, ...}: {
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -1,54 +0,0 @@
{
pkgs,
inputs,
hwconfig,
unstable-pkgs,
...
}: {
environment.systemPackages = with pkgs; [
kdePackages.qtwayland
kdePackages.qtsvg
kdePackages.kio-fuse #to mount remote filesystems via FUSE
kdePackages.kio-extras #extra protocols support (sftp, fish and more)
kdePackages.kio-admin
libheif #https://github.com/NixOS/nixpkgs/issues/164021
libheif.out
#kde
kdePackages.breeze-icons
kdePackages.breeze
kdePackages.kdesdk-thumbnailers
kdePackages.kdegraphics-thumbnailers
kdePackages.kservice
kdePackages.kdbusaddons
kdePackages.kfilemetadata
kdePackages.kconfig
kdePackages.kcoreaddons
kdePackages.kcrash
kdePackages.kguiaddons
kdePackages.ki18n
kdePackages.kitemviews
kdePackages.kwidgetsaddons
kdePackages.kwindowsystem
shared-mime-info
#kde support tools
#libsForQt5.qt5ct
#qt6ct
kdePackages.kimageformats
kdePackages.dolphin
kdePackages.dolphin-plugins
];
xdg = {
menus.enable = true;
mime.enable = true;
};
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
# This fixes the unpopulated MIME menus
environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
environment.etc."/xdg/menus/applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
#environment.pathsToLink = [
# "share/thumbnailers"
#];
}

View file

@ -1,122 +0,0 @@
{
hwconfig,
first-nixos-install,
...
}: {
programs.fastfetch = {
enable = true;
settings = {
display = {
color = {
keys = "35";
output = "1000";
};
};
logo = {
source = ./nixos.png;
type = "kitty-direct";
height = 15;
width = 30;
padding = {
top = 3;
left = 3;
};
};
modules = [
"break"
{
type = "custom";
format = "Hardware";
}
{
type = "cpu";
key = " ";
}
{
type = "gpu";
key = " 󰍛 ";
}
{
type = "memory";
key = " 󰑭 ";
}
{
type = "custom";
format = "";
}
"break"
{
type = "custom";
format = "Software";
}
{
type = "custom";
format = " OS -> NixOS btw";
}
{
type = "kernel";
key = " ";
}
{
type = "packages";
key = " 󰏖 ";
}
{
type = "shell";
key = " ";
}
"break"
{
type = "wm";
key = " WM";
}
{
type = "wmtheme";
key = " 󰉼 ";
}
{
type = "terminal";
key = " ";
}
{
type = "custom";
format = "";
}
"break"
{
type = "custom";
format = "Age / Uptime";
}
{
type = "command";
key = " ";
text =
#bash
''
birth_install=${
if hwconfig.useImpermanence
then "${first-nixos-install}"
else "$(stat -c %W /)"
}
current=$(date +%s)
delta=$((current - birth_install))
delta_days=$((delta / 86400))
echo $delta_days days
'';
}
{
type = "uptime";
key = " ";
}
{
type = "custom";
format = "";
}
"break"
];
};
};
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

View file

@ -1,30 +0,0 @@
{pkgs, ...}: {
nixpkgs = {
overlays = [
(final: prev: {
firefox = prev.firefox.overrideAttrs (old: {
buildCommand =
old.buildCommand
+ ''
mkdir -p $out/gmp-widevinecdm/system-installed
ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so" $out/gmp-widevinecdm/system-installed/libwidevinecdm.so
ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/manifest.json" $out/gmp-widevinecdm/system-installed/manifest.json
wrapProgram "$oldExe" \
--set MOZ_GMP_PATH "$out/gmp-widevinecdm/system-installed"
'';
});
librewolf = prev.librewolf.overrideAttrs (old: {
buildCommand =
old.buildCommand
+ ''
mkdir -p $out/gmp-widevinecdm/system-installed
ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so" $out/gmp-widevinecdm/system-installed/libwidevinecdm.so
ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/manifest.json" $out/gmp-widevinecdm/system-installed/manifest.json
wrapProgram "$oldExe" \
--set MOZ_GMP_PATH "$out/gmp-widevinecdm/system-installed"
'';
});
})
];
};
}

View file

@ -1,130 +0,0 @@
{
lib,
config,
pkgs,
hwconfig,
...
}: let
lock-false = {
Value = false;
Status = "locked";
};
lock-true = {
Value = true;
Status = "locked";
};
in {
imports = [] ++ lib.optional (hwconfig.system == "aarch64-linux") ./aarch64-linux.nix;
programs = {
firefox = {
package = pkgs.librewolf;
enable = true;
languagePacks = ["de" "en-US" "ru"];
/*
---- POLICIES ----
*/
# Check about:policies#documentation for options.
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab"
DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate"
OfferToSaveLogins = false;
OffertosaveloginsDefault = false;
PasswordManagerEnabled = false;
NoDefaultBookmarks = true;
/*
---- EXTENSIONS ----
*/
# Check about:support for extension/add-on ID strings.
# Valid strings for installation_mode are "allowed", "blocked",
# "force_installed" and "normal_installed".
#https://mozilla.github.io/policy-templates/#extensionsettings
ExtensionSettings = {
"*".installation_mode = "allowed"; # blocks all addons except the ones specified below
# uBlock Origin
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
# Privacy Badger:
"jid1-MnnxcxisBPnSXQ@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";
installation_mode = "force_installed";
};
# Dark Reader
"addon@darkreader.org" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi";
installation_mode = "force_installed";
};
#auto tab discard
"{c2c003ee-bd69-42a2-b0e9-6f34222cb046}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/auto-tab-discard/latest.xpi";
installation_mode = "force_installed";
};
# global speed
"{f4961478-ac79-4a18-87e9-d2fb8c0442c4}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/global-speed/latest.xpi";
installation_mode = "force_installed";
};
# sponsorblock
"sponsorBlocker@ajay.app" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi";
installation_mode = "force_installed";
};
# Adguard adblocker
"adguardadblocker@adguard.com" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/adguard-adblocker/latest.xpi";
installation_mode = "force_installed";
};
};
/*
---- PREFERENCES ----
*/
# Check about:config for options.
Preferences = {
"browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true;
"browser.startup.page" = 3; # restore session on startup
"browser.topsites.contile.enabled" = lock-false;
"browser.formfill.enable" = lock-false;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
};
};
};
}

View file

@ -1,19 +0,0 @@
{
pkgs,
lib,
inputs,
config,
...
}: let
cfg = config.kk.services.flatpak;
in {
imports = [
inputs.nix-flatpak.nixosModules.nix-flatpak
];
options.kk.services.flatpak = {
enable = lib.mkEnableOption "enable flatpaks";
};
config = lib.mkIf cfg.enable {
services.flatpak.enable = true;
};
}

View file

@ -1,7 +0,0 @@
{pkgs, ...}: {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
}

View file

@ -1,19 +0,0 @@
{
pkgs,
lib,
...
}: {
programs.gnupg.agent = {
enable = true;
settings = {
pinentry-program = lib.mkForce "${pkgs.pinentry-curses}/bin/pinentry-curses";
};
};
environment.systemPackages = with pkgs; [
(pass.withExtensions (exts:
with exts; [
pass-otp
pass-import
]))
];
}

View file

@ -1,89 +0,0 @@
{
pkgs,
hwconfig,
...
}: let
battery-path = "/sys/class/power_supply/${
if hwconfig.hostname == "kylekrein-mac"
then "macsmc-battery"
else "BAT0"
}";
get-battery-level = "${pkgs.writeShellScriptBin "get-battery-level" ''
cat ${battery-path}/capacity 2>/dev/null || echo "N/A"
''}/bin/get-battery-level";
get-status = "${pkgs.writeShellScriptBin "get-status" ''
cat ${battery-path}/status 2>/dev/null || echo "Unknown"
''}/bin/get-status";
get-icon = "${pkgs.writeShellScriptBin "get-icon" ''
BATTERY_LEVEL=$(${get-battery-level})
STATUS=$(${get-status})
if [[ "$BATTERY_LEVEL" == "N/A" ]]; then
ICON="󰂑 "
elif [[ "$STATUS" == "Charging" ]]; then
if [[ $BATTERY_LEVEL -ge 90 ]]; then
ICON="󰂋 "
elif [[ $BATTERY_LEVEL -ge 80 ]]; then
ICON="󰂊 "
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
ICON="󰢞 "
elif [[ $BATTERY_LEVEL -ge 60 ]]; then
ICON="󰂉 "
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
ICON="󰢝 "
elif [[ $BATTERY_LEVEL -ge 40 ]]; then
ICON="󰂈 "
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
ICON="󰂇 "
elif [[ $BATTERY_LEVEL -ge 20 ]]; then
ICON="󰂆 "
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
ICON="󰢜 "
else
ICON="󰢜 "
fi
else
if [[ $BATTERY_LEVEL -ge 90 ]]; then
ICON="󰂂 "
elif [[ $BATTERY_LEVEL -ge 70 ]]; then
ICON="󰂀 "
elif [[ $BATTERY_LEVEL -ge 50 ]]; then
ICON="󰁾 "
elif [[ $BATTERY_LEVEL -ge 30 ]]; then
ICON="󰁼 "
elif [[ $BATTERY_LEVEL -ge 10 ]]; then
ICON="󰁺 "
else
ICON="󰁺 "
fi
fi
echo "$ICON"
''}/bin/get-icon";
get-remaining-time = "${pkgs.writeShellScriptBin "get-remaining-time" ''
REMAINING_ENERGY=$(cat ${battery-path}/energy_now)
POWER_USAGE=$(cat ${battery-path}/power_now)
if [[ -n "$REMAINING_ENERGY" && -n "$POWER_USAGE" && "$POWER_USAGE" -ne 0 ]]; then
TIME_LEFT=$((0 - (REMAINING_ENERGY / POWER_USAGE)))
MINUTES_LEFT=$(((0 - ( (REMAINING_ENERGY * 60) / POWER_USAGE )) - (TIME_LEFT * 60)))
echo "$TIME_LEFT h $MINUTES_LEFT min"
else
echo ""
fi
''}/bin/get-remaining-time";
in {
available = hwconfig.isLaptop;
icon = get-icon;
status = get-status;
time = get-remaining-time;
level = get-battery-level;
labelAdaptive = "${pkgs.writeShellScriptBin "labelAdaptive" ''
if [[ "$(${get-status})" == "Charging" ]]; then
echo "$(${get-battery-level})% $(${get-icon})"
else
echo "$(${get-remaining-time}) $(${get-icon})"
fi
''}/bin/labelAdaptive";
labelPercent = "${pkgs.writeShellScriptBin "labelPercent" ''
echo "$(${get-battery-level})% $(${get-icon})"
''}/bin/labelPercent";
}

View file

@ -1,137 +0,0 @@
{
pkgs,
inputs,
hwconfig,
unstable-pkgs,
...
}: {
stylix = {
enable = true;
image = "${./wallpaper.jpg}";
autoEnable = true;
opacity = {
desktop = 0.0; #0.5;
};
targets = {
gtk.enable = true;
plymouth = {
enable = false;
#logo = ./fastfetch/nixos.png;
logoAnimated = false;
};
};
fonts = {
sizes = {
applications = 14;
desktop = 12;
popups = 12;
terminal = 16;
};
};
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
};
environment.systemPackages = with pkgs; [
#kando
kdePackages.qtwayland
#libsForQt5.qt5.qtwayland
#libsForQt5.qt5.qtsvg
kdePackages.qtsvg
#kio-fuse #to mount remote filesystems via FUSE
#libsForQt5.kio-extras #extra protocols support (sftp, fish and more)
kdePackages.kio-fuse #to mount remote filesystems via FUSE
kdePackages.kio-extras #extra protocols support (sftp, fish and more)
kdePackages.kio-admin
waybar
swaynotificationcenter
libnotify
swww
hyprpicker
networkmanagerapplet
hyprlock
wlogout
hypridle
qpwgraph
pwvucontrol
brightnessctl
unstable-pkgs.satty #fixes crash in 0.18.0
grim
slurp
clipse
libheif #https://github.com/NixOS/nixpkgs/issues/164021
libheif.out
#kde
kdePackages.breeze-icons
kdePackages.breeze
kdePackages.polkit-kde-agent-1
kdePackages.kdesdk-thumbnailers
kdePackages.kdegraphics-thumbnailers
kdePackages.kservice
kdePackages.kdbusaddons
kdePackages.kfilemetadata
kdePackages.kconfig
kdePackages.kcoreaddons
kdePackages.kcrash
kdePackages.kguiaddons
kdePackages.ki18n
kdePackages.kitemviews
kdePackages.kwidgetsaddons
kdePackages.kwindowsystem
shared-mime-info
#kdePackages.plasma-workspace
#kde support tools
libsForQt5.qt5ct
qt6ct
kdePackages.kimageformats
kdePackages.dolphin
kdePackages.dolphin-plugins
];
programs.kdeconnect.enable = true;
programs.kdeconnect.package = pkgs.kdePackages.kdeconnect-kde;
programs.hyprlock.enable = true;
xdg = {
menus.enable = true;
mime.enable = true;
};
xdg.portal = {
enable = true;
config = {
hyprland = {
default = [
"hyprland"
"kde"
];
};
};
configPackages = with pkgs; [
xdg-desktop-portal-hyprland
kdePackages.xdg-desktop-portal-kde
];
};
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
# This fixes the unpopulated MIME menus
environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
environment.etc."/xdg/menus/applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
#environment.pathsToLink = [
# "share/thumbnailers"
#];
programs.hyprland = {
enable = true;
xwayland.enable = true;
systemd.setPath.enable = true;
};
services.hypridle.enable = true;
# qt = {
#enable = true;
#platformTheme = "qt5ct";
#style = "kvantum";
# };
}

View file

@ -1,17 +0,0 @@
{
pkgs,
username,
lib,
hwconfig,
...
}: {
imports = [
(import ./hyprland.nix {
inherit pkgs;
inherit lib;
inherit hwconfig;
inherit username;
})
#../kando
];
}

View file

@ -1,66 +0,0 @@
{
pkgs,
lib,
hwconfig,
...
}: let
suspendScript = pkgs.writeShellScript "suspend-script" ''
# check if any player has status "Playing"
${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q
# only suspend if nothing is playing
if [ $? == 1 ]; then
${
if hwconfig.isLaptop
then "${pkgs.systemd}/bin/systemctl suspend"
else "loginctl lock-session"
}
fi
'';
in {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "pidof hyprlock || loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
ignore_dbus_inhibit = false;
};
listener = [
#{
# on-resume="brightnessctl -r"; # monitor backlight restore.
# on-timeout="brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
# timeout=240;
#}
#{
# on-resume="brightnessctl -rd rgb:kbd_backlight";
# on-timeout="brightnessctl -sd rgb:kbd_backlight set 0";
# timeout=300;
#}
{
on-timeout = "notify-send \"You're idle. Locking in 30 seconds.\"";
timeout = 830;
}
{
on-timeout = "pidof hyprlock && systemctl suspend";
timeout = 120;
}
#{
# on-timeout="loginctl lock-session";
# timeout=360;
#}
{
on-resume = "hyprctl dispatch dpms on";
on-timeout = suspendScript.outPath;
timeout = 900;
}
#{
# on-resume="hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
# on-timeout="hyprctl dispatch dpms off"; # screen off when timeout has passed
# timeout=420;
#}
];
};
};
}

View file

@ -1,262 +0,0 @@
{
pkgs,
lib,
hwconfig,
username,
...
}: let
toggle_monitors = ./toggle_monitors.sh;
wallpaper-image = ./wallpaper.jpg;
in {
imports = [
./waybar.nix
./hyprlock.nix
./hypridle.nix
];
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
settings = {
monitor =
if hwconfig.hostname == "kylekrein-homepc"
then [
"DP-1,2560x1440@75,1600x0,1.6"
"DP-3,2560x1440@75,0x0,1.6"
]
else
[",highres,auto,1.6"]
++ [
"FALLBACK,1920x1080@60,auto,1" # to fix crash on hyprlock https://github.com/hyprwm/hyprlock/issues/434#issuecomment-2341710088
];
xwayland = {
force_zero_scaling = true;
};
exec-once = [
"${
if hwconfig.isLaptop
then "brightnessctl set 25%"
else ""
}"
"dbus-update-activation-environment --systemd --all"
"${pkgs.waybar}/bin/waybar &"
"${pkgs.networkmanagerapplet}/bin/nm-applet &"
"${pkgs.swaynotificationcenter}/bin/swaync &"
"${pkgs.solaar}/bin/solaar -w hide &"
"${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1 &" # https://nixos.wiki/wiki/Polkit
"${pkgs.clipse}/bin/clipse -listen &"
];
"$mod" = "SUPER";
"$mainMod" = "$mod";
"$terminal" = "${pkgs.kitty}/bin/kitty";
"$emacs" = "emacsclient -c";
"$fileManager" = "$emacs --eval '(dired \"/home/${username}\")'"; # "$terminal ${pkgs.yazi}/bin/yazi";
"$fileManager2" = "${pkgs.kdePackages.dolphin}/bin/dolphin";
"$browser" = "${pkgs.librewolf}/bin/librewolf";
"$menu" = "emacsclient -cF '((visibility . nil))' -e '(emacs-run-app-launcher)'"; #"${pkgs.wofi}/bin/wofi --show drun";
"$emojiPicker" = "emacsclient -cF '((visibility . nil))' -e '(emacs-run-emoji-picker)'";
"$clipboardManager" = "$terminal --class clipse -e 'clipse'";
"$makeRegionScreenshot" = ''grim -g "$(slurp -w 0)" -t ppm - | satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush'';
bind = [
"$mod, T, exec, $terminal"
"$mod, Q, killactive,"
"$mod, B, exec, $browser"
"$mod SHIFT, V, togglefloating,"
"$mod, C, exec, $fileManager"
"$mod SHIFT, C, exec, $fileManager2"
"$mod, F, fullscreen,"
"$mod, R, exec, $menu"
"$mod, M, exec, $emojiPicker"
"$mod, V, exec, $clipboardManager"
#"CTRL, SPACE, global, kando:nix-hyprland"
"$mod SHIFT, I, exec, source ${toggle_monitors}"
"$mod SHIFT, O, exec, hyprctl dispatch dpms on"
# Move focus with mainMod + arrow keys
"$mod, H, movefocus, l"
"$mod, L, movefocus, r"
"$mod, K, movefocus, u"
"$mod, J, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
"$mainMod, 5, workspace, 5"
"$mainMod, 6, workspace, 6"
"$mainMod, 7, workspace, 7"
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$mainMod SHIFT, 1, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
"$mainMod SHIFT, 3, movetoworkspace, 3"
"$mainMod SHIFT, 4, movetoworkspace, 4"
"$mainMod SHIFT, 5, movetoworkspace, 5"
"$mainMod SHIFT, 6, movetoworkspace, 6"
"$mainMod SHIFT, 7, movetoworkspace, 7"
"$mainMod SHIFT, 8, movetoworkspace, 8"
"$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10"
# Swap Windows
"$mainMod SHIFT, H, swapwindow, l"
"$mainMod SHIFT, L, swapwindow, r"
"$mainMod SHIFT, K, swapwindow, u"
"$mainMod SHIFT, J, swapwindow, d"
#Resize Windows
"$mainMod CTRL, H, resizeactive, -50 0"
"$mainMod CTRL, L, resizeactive, 50 0"
"$mainMod CTRL, K, resizeactive, 0 -50"
"$mainMod CTRL, J, resizeactive, 0 50"
"$mainMod, P, exec, $makeRegionScreenshot"
"$mainMod ALT, L, exec, ${pkgs.hyprlock}/bin/hyprlock"
''$mainMod, E, exec, $emacs''
#''$mainMod SHIFT, E, exec, emacsclient -e "(emacs-everywhere)"''
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
misc = {
vfr = true; #lowers the amount of frames when nothing happens
allow_session_lock_restore = true; # hope that it fixes the crash of hyprlock
disable_hyprland_logo = true; # disables the random Hyprland logo / anime girl background. :(
};
input = {
kb_layout = "us, ru";
kb_options =
"grp:lctrl_toggle, ctrl:nocaps"
+ (
if hwconfig.hostname == "kylekrein-mac"
then ", altwin:swap_alt_win"
else ""
); # "ctrl:nocaps, grp:toggle"
touchpad = {
natural_scroll = true;
disable_while_typing = false; #for games
};
};
env = [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"NVD_BACKEND,direct"
"XCURSOR_SIZE,24"
"HYPRCURSOR_SIZE,24"
"__GL_GSYNC_ALLOWED,1"
"QT_QPA_PLATFORM,wayland"
#"QT_QPA_PLATFORMTHEME,kde"
#"QT_STYLE_OVERRIDE,Breeze"
#"GDK_SCALE,1.6"
#"QT_SCALE_FACTOR,1.6"
#"GSK_RENDERER,ngl" # for satty until https://github.com/NixOS/nixpkgs/issues/359069 is fixed
];
cursor = {
no_hardware_cursors = true;
inactive_timeout = 10;
};
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 2;
#"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
#"col.inactive_border" = "rgba(595959aa)";
resize_on_border = false;
allow_tearing = false;
layout = "dwindle";
};
render = lib.mkIf (hwconfig.system == "aarch64-linux") {
# Explicit sync breaks asahi driver https://github.com/hyprwm/Hyprland/issues/8158
explicit_sync = 0;
};
windowrule = [
#kando
"noblur, class:kando"
"opaque, class:kando"
"size 100% 100%, class:kando"
"noborder, class:kando"
"noanim, class:kando"
"float, class:kando"
"pin, class:kando"
#blender
"opaque, class:blender"
#screenshot editor
"noblur, class:com.gabm.satty"
"opaque, class:com.gabm.satty"
];
windowrulev2 = [
# Ignore maximize requests from apps. You'll probably like this.
"suppressevent maximize, class:.*"
# Fix some dragging issues with XWayland
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
# Fix for issues with steam
"stayfocused, title:^()$,class:^(steam)$"
"minsize 1 1, title:^()$,class:^(steam)$"
#for clipboard manager
"float,class:(clipse)"
"size 622 652,class:(clipse)" # set the size of the window as necessary
#emacs run launcher
"float, title:emacs-run-launcher"
"pin, title:emacs-run-launcher"
#emacs
"opaque, class:emacs"
];
decoration = {
rounding = 10;
active_opacity = 0.9;
inactive_opacity = 0.7;
#drop_shadow = true;
#shadow_range = 4;
#shadow_render_power = 3;
#"col.shadow" = "rgba(1a1a1aee)";
blur = {
enabled = true;
size = 3;
passes = 1;
vibrancy = 0.1696;
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
};
};
}

View file

@ -1,98 +0,0 @@
{
pkgs,
lib,
hwconfig,
...
}: let
profile-image = ./profile-image.png;
battery-level =
(import ./battery-status.nix {
inherit pkgs;
inherit hwconfig;
}).labelPercent;
in {
programs.hyprlock = {
enable = true;
settings = {
general = {
#enable_fingerprint = true;
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = false;
grace = 10;
};
background = {
blur_passes = 1;
blur_size = 7;
noise = 0.0117;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
};
image = {
path = "${profile-image}";
size = 150;
border_size = 4;
#border_color = "rgb(0C96F9)";
rounding = -1; # Negative means circle
position = "0, 220";
halign = "center";
valign = "center";
};
input-field = {
size = "600, 100";
outline_thickness = 3;
dots_size = 0.33;
dots_spacing = 0.15;
dots_center = true;
dots_rounding = -1;
dots_fade_time = 200;
placeholder_text = "<i>Input Password...</i>";
hide_input = false;
fade_on_empty = false;
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
fail_timeout = 2000;
fail_transition = 300;
position = "0, -20";
halign = "center";
valign = "center";
};
label =
[
{
text = "$USER";
font_family = "Fira Code";
font_size = 56;
position = "0, 100";
halign = "center";
valign = "center";
}
{
text = "$TIME";
font_family = "Roboto";
font_size = 72;
position = "-40, -40";
halign = "right";
valign = "top";
}
{
text = "$LAYOUT";
font_family = "JetBrains Mono";
font_size = 28;
position = "-20, 20";
halign = "right";
valign = "bottom";
}
]
++ lib.optional (hwconfig.isLaptop) {
text = ''cmd[update:10000] ${battery-level}'';
font_family = "JetBrains Mono";
font_size = 28;
position = "20, 20";
halign = "left";
valign = "bottom";
};
};
};
}

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkMenu" id="menu">
<child>
<object class="GtkMenuItem" id="suspend">
<property name="label">⏾ Sleep</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="hibernate">
<property name="label">󱦟 Hibernate</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="shutdown">
<property name="label">󰐥 Shutdown</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
</child>
<child>
<object class="GtkMenuItem" id="reboot">
<property name="label"> Reboot</property>
</object>
</child>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

View file

@ -1,12 +0,0 @@
#!/bin/bash
# Получаем информацию о подключенных мониторах
monitors_on=$(hyprctl monitors | grep "dpmsStatus: 1" | wc -l)
echo $monitors_on
if [ $monitors_on -gt 0 ]; then
# Если мониторы включены, выключаем их
hyprctl dispatch dpms off
else
hyprctl dispatch dpms on
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 MiB

View file

@ -1,199 +0,0 @@
{
pkgs,
lib,
hwconfig,
...
}: let
battery = import ./battery-status.nix {
inherit pkgs;
inherit hwconfig;
};
in {
programs.waybar = {
enable = true;
#systemd.enable = true;
#window#waybar {
# background: transparent;
#border-bottom: none;
#}
#${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"}
style = ''
${builtins.readFile ./waybarstyle.css}
* {
font-size: 15px;
}
'';
settings = [
{
height = 36;
layer = "top";
position = "top";
tray = {spacing = 3;};
modules-center = [
#"hyprland/window"
"clock"
];
modules-left = [
"hyprland/workspaces"
# "hyprland/window"
];
modules-right =
lib.optional hwconfig.isLaptop "backlight"
++ [
"pulseaudio"
#"network"
#"cpu"
"memory"
#"temperature"
"hyprland/language"
]
++ lib.optional battery.available "custom/battery"
++ [
"tray"
"custom/notification"
#"custom/disablehypridle"
"custom/power"
];
battery = {
format = " {time} {icon} ";
format-alt = " {capacity}% {icon} ";
format-charging = " {capacity}% ";
format-icons = ["" "" "" "" ""];
format-plugged = " {capacity}% ";
states = {
critical = 10;
warning = 20;
};
};
backlight = {
format = "{percent}% 󰛩";
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s 5%+";
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
};
"custom/battery" = {
exec = "${pkgs.writeShellScriptBin "battery-widget" ''
${battery.labelAdaptive}
${battery.labelPercent}
''}/bin/battery-widget";
interval = 20;
tooltip = true;
};
clock = {
format-alt = "{:%d-%m-%Y}";
tooltip-format = "{:%d-%m-%Y | %H:%M}";
};
cpu = {
format = "{usage}% ";
tooltip = false;
};
"hyprland/language" = {
format = " {}";
};
memory = {
interval = 1;
format = "{used}/{total}Gb ";
};
network = {
interval = 1;
format-alt = "{ifname}: {ipaddr}/{cidr}";
format-disconnected = "Disconnected ";
format-ethernet = "{ifname}: {ipaddr}/{cidr} up: {bandwidthUpBits} down: {bandwidthDownBits}";
format-linked = "{ifname} (No IP) ";
#format-wifi = "{signalStrength}% ";
format-wifi = "{signalStrength}% ";
tooltip-format = "{essid} ({signalStrength}%) ";
};
pulseaudio = {
format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-bluetooth-muted = " {icon} {format_source}";
format-icons = {
car = "";
default = ["" "" ""];
handsfree = "";
headphones = "";
headset = "";
phone = "";
portable = "";
};
format-muted = " {format_source}";
format-source = "{volume}% ";
format-source-muted = "";
on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol";
};
"hyprland/submap" = {format = ''<span style="italic">{}</span>'';};
temperature = {
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" ""];
};
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = false;
warp-on-scroll = true;
format = "{name}{icon} ";
format-icons = {
urgent = "";
active = "";
default = "";
};
#persistent-workspaces = {
# "*" = 3;
#};
};
"custom/power" = {
format = " ";
tooltip = false;
#menu = "on-click";
#menu-file = ./power_menu.xml;
#menu-actions = {
# shutdown = "shutdown -h now";
# reboot = "reboot";
# suspend = "systemctl suspend";
# hibernate = "systemctl hibernate";
#};
on-click = "wlogout";
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = " <span foreground='red'><small><sup></sup></small></span>";
none = " ";
dnd-notification = " <span foreground='red'><small><sup></sup></small></span>";
dnd-none = " ";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "sleep 0.1 && swaync-client -t -sw";
on-click-right = "sleep 0.1 && swaync-client -d -sw";
escape = true;
};
"custom/disablehypridle" = {
exec = ''
if pgrep -x "hypridle" > /dev/null; then
echo "{\"text\": \" \", \"tooltip\": \"Hypridle is running\", \"class\": \"active\"}";
else
echo "{\"text\": \" \", \"tooltip\": \"Hypridle is not running\", \"class\": \"inactive\"}";
fi
'';
return-type = "json";
on-click = ''
if pgrep -x "hypridle" > /dev/null; then
pkill hypridle
else
hypridle &
fi
'';
};
}
];
};
}

View file

@ -1,92 +0,0 @@
* {
border: none;
font-family: Font Awesome, Roboto, Arial, sans-serif;
font-size: 13px;
color: #B9826A;/*#ffffff;*/
border-radius: 20px;
}
window {
/*font-weight: bold;*/
}
window#waybar {
background: transparent;/*rgba(0, 0, 0, 0);*/
}
/*-----module groups----*/
.modules-right {
background-color: rgba(0,43,51,0.85);
margin: 2px 10px 0 0;
}
.modules-center {
background-color: rgba(0,43,51,0.85);
margin: 2px 0 0 0;
}
.modules-left {
margin: 2px 0 0 5px;
background-color: rgba(0,119,179,0.6);
}
/*-----modules indv----*/
#workspaces button {
padding: 1px 5px;
background-color: transparent;
}
#workspaces button:hover {
box-shadow: inherit;
background-color: rgba(0,153,153,1);
}
#workspaces button.focused {
background-color: rgba(0,43,51,0.85);
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#custom-power,
#custom-menu,
#idle_inhibitor {
padding: 0 10px;
}
#mode {
color: #cc3436;
font-weight: bold;
}
#custom-power {
background-color: rgba(0,119,179,0.6);
border-radius: 100px;
margin: 5px 5px;
padding: 1px 1px 1px 6px;
}
/*-----Indicators----*/
#idle_inhibitor.activated {
color: #2dcc36;
}
#pulseaudio.muted {
color: #cc3436;
}
#battery.charging {
color: #2dcc36;
}
#battery.warning:not(.charging) {
color: #e6e600;
}
#battery.critical:not(.charging) {
color: #cc3436;
}
#temperature.critical {
color: #cc3436;
}
/*-----Colors----*/
/*
*rgba(0,85,102,1),#005566 --> Indigo(dye)
*rgba(0,43,51,1),#002B33 --> Dark Green
*rgba(0,153,153,1),#009999 --> Persian Green
*
*/

View file

@ -1,96 +0,0 @@
{
config,
lib,
inputs,
pkgs,
...
}: let
rootIsBtrfs = config.fileSystems."/".fsType == "btrfs";
in {
imports = [
inputs.impermanence.nixosModules.impermanence
];
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist/system" = {
hideMounts = true;
directories = [
"/var/lib/sbctl"
"/etc/nixos"
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/flatpak"
"/var/lib/zerotier-one"
"/var/lib/systemd/coredump"
"/var/lib/acme"
#"/var/lib/conduwuit"
"/etc/NetworkManager/system-connections"
{
directory = "/var/lib/colord";
user = "colord";
group = "colord";
mode = "u=rwx,g=rx,o=";
}
];
files = [
"/etc/machine-id"
{
file = "/var/keys/secret_file";
parentDirectory = {mode = "u=rwx,g=,o=";};
}
];
};
systemd.tmpfiles.rules = [
"d /persist/home/ 0777 root root -" # /persist/home created, owned by root
"d /persist/ollama/ 0755 ollama ollama"
"d /persist/open-webui/ 0755 ollama ollama"
"d /persist/conduwuit/ 0755 conduwuit conduwuit"
#"d /persist/home/${username} 0700 ${username} users -" # /persist/home/<user> created, owned by that user
#"d /persist/nixos-config 0700 ${username} users -"
];
programs.fuse.userAllowOther = true;
#https://blog.decent.id/post/nixos-systemd-initrd/
boot.initrd.systemd.services.btrfs-rollback-impermanence = lib.mkIf (isBtrfs && config.boot.initrd.systemd.enable) {
description = "Rollback BTRFS root dataset to blank snapshot";
wantedBy = ["initrd.target"];
requires = ["initrd-root-device.target"];
after = [
"initrd-root-device.target"
# LUKS/TPM process
"systemd-cryptsetup@root_vg.service"
"local-fs-pre.target"
];
before = [
"sysroot.mount"
"create-needed-for-boot-dirs.service"
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
mkdir -p /btrfs_tmp
mount /dev/mapper/root_vg /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +7); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
};
}

View file

@ -1,69 +0,0 @@
{
username,
inputs,
...
}: {
imports = [
inputs.impermanence.nixosModules.home-manager.impermanence
];
home.persistence."/persist/home/${username}" = {
directories = [
"Downloads"
"Music"
"Pictures"
"Documents"
"Videos"
"Apps"
"VMs"
"Git"
"nixos-config"
"blender"
".gnupg"
".password-store"
".ssh"
".emacs.d"
".local/share/keyrings"
".local/share/direnv"
".local/share/chat.fluffy.fluffychat"
".klei"
"Android"
{
directory = ".var/app";
method = "symlink";
}
{
directory = ".local/share/Steam";
method = "symlink";
}
#{
# directory = ".steam";
# method = "symlink";
#}
".mozilla"
".librewolf"
".local/share/mcpelauncher"
".local/share/PrismLauncher"
".local/share/TelegramDesktop"
".local/share/Paradox Interactive"
".config/unity3d/Ludeon Studios/RimWorld by Ludeon Studios"
".config/solaar"
".config/eww"
".config/kdeconnect"
".config/blender"
".config/unity3d"
".config/Element"
".config/GIMP"
".cache/nix-index"
".local/share/aspyr-media"
".themes"
];
files = [
".screenrc"
".config/kdeglobals"
".config/Minecraft Linux Launcher/Minecraft Linux Launcher UI.conf"
#".steampid"
#".steampath"
];
allowOther = true;
};
}

View file

@ -1,34 +0,0 @@
{
"locale": "auto",
"menuTheme": "default",
"darkMenuTheme": "default",
"menuThemeColors": {},
"darkMenuThemeColors": {},
"enableDarkModeForMenuThemes": false,
"soundTheme": "none",
"soundVolume": 0.5,
"sidebarVisible": false,
"enableVersionCheck": true,
"zoomFactor": 1,
"menuOptions": {
"centerDeadZone": 50,
"minParentDistance": 150,
"dragThreshold": 15,
"fadeInDuration": 150,
"fadeOutDuration": 200,
"enableMarkingMode": true,
"enableTurboMode": true,
"gestureMinStrokeLength": 150,
"gestureMinStrokeAngle": 20,
"gestureJitterThreshold": 10,
"gesturePauseTimeout": 100,
"fixedStrokeLength": 0,
"rmbSelectsParent": false,
"gamepadBackButton": 1,
"gamepadCloseButton": 2
},
"editorOptions": {
"showSidebarButtonVisible": false,
"showEditorButtonVisible": false
}
}

View file

@ -1,8 +0,0 @@
{...}: let
folder = ".config/kando";
in {
home.file = {
#"${folder}/config.json".source = ./config.json;
"${folder}/menus.json".source = ./menus.json;
};
}

View file

@ -1,410 +0,0 @@
{
"menus": [
{
"shortcut": "Control+Space",
"shortcutID": "example-menu",
"centered": false,
"root": {
"type": "submenu",
"name": "Пример меню",
"icon": "award_star",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "submenu",
"name": "Приложения",
"icon": "apps",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "command",
"data": {
"command": "x-www-browser"
},
"name": "Веб-браузер",
"icon": "globe",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-email"
},
"name": "Почта",
"icon": "mail",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "gimp"
},
"name": "GIMP",
"icon": "gimp",
"iconTheme": "simple-icons"
},
{
"type": "command",
"data": {
"command": "xdg-open ~"
},
"name": "Проводник",
"icon": "folder_shared",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "x-terminal-emulator"
},
"name": "Терминал",
"icon": "terminal",
"iconTheme": "material-symbols-rounded"
}
]
},
{
"type": "submenu",
"name": "Веб-ссылки",
"icon": "public",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "uri",
"data": {
"uri": "https://www.google.com"
},
"name": "Google",
"icon": "google",
"iconTheme": "simple-icons"
},
{
"type": "uri",
"data": {
"uri": "https://github.com/kando-menu/kando"
},
"name": "Kando в GitHub",
"icon": "github",
"iconTheme": "simple-icons"
},
{
"type": "uri",
"data": {
"uri": "https://ko-fi.com/schneegans"
},
"name": "Кандо в Ko-fi",
"icon": "kofi",
"iconTheme": "simple-icons"
},
{
"type": "uri",
"data": {
"uri": "https://www.youtube.com/@simonschneegans"
},
"name": "Kando в YouTube",
"icon": "youtube",
"iconTheme": "simple-icons"
},
{
"type": "uri",
"data": {
"uri": "https://discord.gg/hZwbVSDkhy"
},
"name": "Kando в Discord",
"icon": "discord",
"iconTheme": "simple-icons"
}
]
},
{
"type": "hotkey",
"data": {
"hotkey": "ControlLeft+AltLeft+ArrowRight",
"delayed": false
},
"name": "Следующий рабочий стол",
"icon": "arrow_forward",
"iconTheme": "material-symbols-rounded"
},
{
"type": "submenu",
"name": "Буфер обмена",
"icon": "assignment",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "hotkey",
"data": {
"hotkey": "ControlLeft+KeyV",
"delayed": true
},
"name": "Вставить",
"icon": "content_paste_go",
"iconTheme": "material-symbols-rounded",
"angle": 90
},
{
"type": "hotkey",
"data": {
"hotkey": "ControlLeft+KeyC",
"delayed": true
},
"name": "Скопировать",
"icon": "content_copy",
"iconTheme": "material-symbols-rounded"
},
{
"type": "hotkey",
"data": {
"hotkey": "ControlLeft+KeyX",
"delayed": true
},
"name": "Вырезать",
"icon": "cut",
"iconTheme": "material-symbols-rounded"
}
]
},
{
"type": "submenu",
"name": "Аудио",
"icon": "play_circle",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "hotkey",
"data": {
"hotkey": "MediaTrackNext",
"delayed": false
},
"name": "Следующий трек",
"icon": "skip_next",
"iconTheme": "material-symbols-rounded",
"angle": 90
},
{
"type": "hotkey",
"data": {
"hotkey": "MediaPlayPause",
"delayed": false
},
"name": "Играть / Пауза",
"icon": "play_pause",
"iconTheme": "material-symbols-rounded"
},
{
"type": "hotkey",
"data": {
"hotkey": "AudioVolumeMute",
"delayed": false
},
"name": "Беззвучный режим",
"icon": "music_off",
"iconTheme": "material-symbols-rounded"
},
{
"type": "hotkey",
"data": {
"hotkey": "MediaTrackPrevious",
"delayed": false
},
"name": "Предыдущий трек",
"icon": "skip_previous",
"iconTheme": "material-symbols-rounded",
"angle": 270
}
]
},
{
"type": "submenu",
"name": "Windows",
"icon": "select_window",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "hotkey",
"data": {
"hotkey": "MetaLeft+ArrowUp",
"delayed": true
},
"name": "Развернуть",
"icon": "open_in_full",
"iconTheme": "material-symbols-rounded",
"angle": 0
},
{
"type": "hotkey",
"data": {
"hotkey": "MetaLeft+ArrowRight",
"delayed": true
},
"name": "Окно вправо",
"icon": "text_select_jump_to_end",
"iconTheme": "material-symbols-rounded",
"angle": 90
},
{
"type": "hotkey",
"data": {
"hotkey": "AltLeft+F4",
"delayed": true
},
"name": "Закрыть окно",
"icon": "cancel_presentation",
"iconTheme": "material-symbols-rounded"
},
{
"type": "hotkey",
"data": {
"hotkey": "MetaLeft+ArrowLeft",
"delayed": true
},
"name": "Окно влево",
"icon": "text_select_jump_to_beginning",
"iconTheme": "material-symbols-rounded",
"angle": 270
}
]
},
{
"type": "hotkey",
"data": {
"hotkey": "ControlLeft+AltLeft+ArrowLeft",
"delayed": false
},
"name": "Предыдущий рабочий стол",
"icon": "arrow_back",
"iconTheme": "material-symbols-rounded"
},
{
"type": "submenu",
"name": "Заметки",
"icon": "folder_special",
"iconTheme": "material-symbols-rounded",
"children": [
{
"type": "command",
"data": {
"command": "xdg-open \"$(xdg-user-dir DOWNLOAD)\""
},
"name": "Загрузки",
"icon": "download",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-open \"$(xdg-user-dir VIDEOS)\""
},
"name": "Видео",
"icon": "video_camera_front",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-open \"$(xdg-user-dir PICTURES)\""
},
"name": "Фото",
"icon": "imagesmode",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-open \"$(xdg-user-dir DOCUMENTS)\""
},
"name": "Документы",
"icon": "text_ad",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-open \"$(xdg-user-dir DESKTOP)\""
},
"name": "Рабочий стол",
"icon": "desktop_windows",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-open ~"
},
"name": "Домой",
"icon": "home",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "xdg-open \"$(xdg-user-dir MUSIC)\""
},
"name": "Музыка",
"icon": "music_note",
"iconTheme": "material-symbols-rounded"
}
]
}
]
}
},
{
"root": {
"type": "submenu",
"name": "NixOS",
"icon": "nixos",
"iconTheme": "simple-icons-colored",
"children": [
{
"type": "command",
"data": {
"command": "wofi --show drun",
"delayed": false
},
"name": "Приложения",
"icon": "apps",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "firefox",
"delayed": false
},
"name": "Firefox",
"icon": "firefoxbrowser",
"iconTheme": "simple-icons"
},
{
"type": "command",
"data": {
"command": "dolphin",
"delayed": false
},
"name": "Файлы",
"icon": "folder_open",
"iconTheme": "material-symbols-rounded"
},
{
"type": "command",
"data": {
"command": "grim -g \"$(slurp -w 0)\" - | satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush",
"delayed": true
},
"name": "Скриншот",
"icon": "screenshot_monitor",
"iconTheme": "material-symbols-rounded"
}
]
},
"shortcut": "",
"shortcutID": "nix-hyprland",
"centered": false,
"warpMouse": false,
"anchored": false
}
],
"templates": []
}

View file

@ -1,8 +0,0 @@
{...}: {
services.xserver.enable = true;
services.desktopManager.plasma6.enable = true;
programs.dconf.enable = true;
#stylix.targets.qt.platform = "qtct";
}

View file

@ -1,24 +0,0 @@
{pkgs, ...}: {
virtualisation = {
libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
swtpm.enable = true;
ovmf.enable = true;
ovmf.packages = [pkgs.OVMFFull.fd];
};
};
spiceUSBRedirection.enable = true;
};
environment.systemPackages = with pkgs; [
spice
spice-gtk
spice-protocol
virt-viewer
virtio-win
win-spice
];
programs.virt-manager.enable = true;
}

View file

@ -1,11 +0,0 @@
{username, ...}: {
users.users.${username}.extraGroups = ["libvirtd"];
home-manager.users.${username} = {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
};
}

View file

@ -1,16 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.kk.loginManagers.ly;
in {
options.kk.loginManagers.ly = {
enable = lib.mkEnableOption "Enable ly as login manager";
};
config = lib.mkIf cfg.enable {
services.xserver.enable = true;
services.displayManager.ly.enable = true;
};
}

View file

@ -1,26 +0,0 @@
{
pkgs,
inputs,
...
}: {
nixpkgs.overlays = [
inputs.niri-flake.overlays.niri
];
imports = [
inputs.niri-flake.nixosModules.niri
];
security.pam.services.hyprlock = {};
programs.niri = {
enable = true;
package = pkgs.niri-unstable;
};
niri-flake.cache.enable = true;
environment.systemPackages = with pkgs; [
wl-clipboard
wayland-utils
libsecret
gamescope
xwayland-satellite-unstable
swaybg
];
}

View file

@ -1,37 +0,0 @@
{
config,
lib,
pkgs,
hwconfig,
...
}: let
cfg = config.kk.loginManagers.sddm;
in {
options.kk.loginManagers.sddm = {
enable = lib.mkEnableOption "Enable sddm as login manager";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
(catppuccin-sddm.override {
flavor = "mocha";
# font = "";
fontSize = "16";
#background;
loginBackground = false;
})
wvkbd
];
services.xserver.enable = true;
services.displayManager.sddm = {
enable = true;
theme = "catppuccin-mocha";
package = lib.mkDefault pkgs.kdePackages.sddm;
wayland.enable = true;
settings = {
General = {
InputMethod = "wvkbd-mobintl"; # Enables optional virtual keyboard at login (SDDM). Useful for touchscreens or accessibility.
};
};
};
};
}

View file

@ -1,103 +0,0 @@
# Run automatic updates. Replaces system.autoUpgrade.
{
config,
lib,
...
}: let
cfg = config.kylekrein.services.autoUpgrade;
script = ./nixos-upgrade-script.sh;
in {
options = {
kylekrein.services.autoUpgrade = {
enable = lib.mkEnableOption "Enables automatic system updates.";
configDir = lib.mkOption {
type = lib.types.str;
description = "Path where your NixOS configuration files are stored.";
};
extraFlags = lib.mkOption {
type = lib.types.str;
description = "Extra flags to pass to nixos-rebuild.";
default = "";
};
onCalendar = lib.mkOption {
default = "daily";
type = lib.types.str;
description = "How frequently to run updates. See systemd.timer(5) and systemd.time(7) for configuration details.";
};
operation = lib.mkOption {
type = lib.types.enum [
"boot"
"switch"
"test"
];
default = "switch";
description = "Which `nixos-rebuild` operation to perform. Defaults to `switch`.";
};
persistent = lib.mkOption {
default = true;
type = lib.types.bool;
description = "If true, the time when the service unit was last triggered is stored on disk. When the timer is activated, the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive. This is useful to catch up on missed runs of the service when the system was powered down.";
};
pushUpdates = lib.mkEnableOption "Updates the flake.lock file and pushes it back to the repo.";
user = lib.mkOption {
type = lib.types.str;
description = "The user who owns the configDir.";
};
};
};
config = lib.mkIf cfg.enable {
# Assert that system.autoUpgrade is not also enabled
assertions = [
{
assertion = !config.system.autoUpgrade.enable;
message = "The system.autoUpgrade option conflicts with this module.";
}
];
# Pull and apply updates.
systemd = {
services."nixos-upgrade" = {
serviceConfig = {
Type = "oneshot";
User = "root";
};
#path = config.kylekrein.corePackages;
unitConfig.RequiresMountsFor = cfg.configDir;
script =
"${script} --operation ${cfg.operation} "
+ (
if (cfg.configDir != "")
then "--flake ${cfg.configDir} "
else ""
)
+ (
if (cfg.user != "")
then "--user ${cfg.user} "
else ""
)
+ (
if (cfg.pushUpdates)
then "--update "
else ""
)
+ (
if (cfg.extraFlags != "")
then cfg.extraFlags
else ""
);
};
timers."nixos-upgrade" = {
wants = ["network-online.target"];
after = ["network-online.target"];
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = cfg.onCalendar;
Persistent = cfg.persistent;
Unit = "nixos-upgrade.service";
RandomizedDelaySec = "30m";
};
};
};
};
}

View file

@ -1,91 +0,0 @@
#!/bin/sh
# Wrapper script for nixos-rebuild
# Configuration parameters
operation="switch" # The nixos-rebuild operation to use
hostname=$(/run/current-system/sw/bin/hostname) # The name of the host to build
flakeDir="${FLAKE_DIR}" # Path to the flake file (and optionally the hostname). Defaults to the FLAKE_DIR environment variable.
update=false # Whether to update flake.lock (false by default)
user=$(/run/current-system/sw/bin/whoami) # Which user account to use for git commands (defaults to whoever called the script)
remainingArgs="" # All remaining arguments that haven't yet been processed (will be passed to nixos-rebuild)
function usage() {
echo "nixos-rebuild Operations Script (NOS) updates your system and your flake.lock file by pulling the latest versions."
echo ""
echo "Running the script with no parameters performs the following operations:"
echo " 1. Pull the latest version of the config"
echo " 2. Update your flake.lock file"
echo " 3. Commit any changes back to the repository"
echo " 4. Run 'nixos-rebuild switch'."
echo ""
echo "Advanced usage: nixos-upgrade-script.sh [-o|--operation operation] [-f|--flake path-to-flake] [extra nixos-rebuild parameters]"
echo "Options:"
echo " -h, --help Show this help screen."
echo " -o, --operation The nixos-rebuild operation to perform."
echo " -f, --flake <path> The path to your flake.nix file (and optionally, the hostname to build)."
echo " -U, --update Update and commit flake.lock."
echo " -u, --user Which user account to run git commands under."
echo ""
exit 2
}
# Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
--flake|-f)
flakeDir="$2"
shift
shift
;;
--update|--upgrade|-U)
update=true
shift
;;
--operation|-o)
operation="$2"
shift
shift
;;
--user|-u)
user="$2"
shift
shift
;;
--help|-h)
usage
exit 0
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift
;;
esac
done
remainingArgs=${POSITIONAL_ARGS[@]}
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [ $update = true ]; then
if [ -z "${flakeDir}" ]; then
echo "Flake directory not specified. Use '--flake <path>' or set \$FLAKE_DIR."
exit 1
fi
cd $flakeDir
echo "Pulling the latest version of the repository..."
/run/wrappers/bin/sudo -u $user /run/current-system/sw/bin/git pull
echo "Updating flake.lock..."
/run/wrappers/bin/sudo -u $user /run/current-system/sw/bin/nix flake update --commit-lock-file && /run/wrappers/bin/sudo -u $user /run/current-system/sw/bin/git push
options="--flake $flakeDir $remainingArgs --use-remote-sudo --log-format multiline-with-logs"
echo "Running this operation: nixos-rebuild $operation $options"
/run/wrappers/bin/sudo -u root /run/current-system/sw/bin/nixos-rebuild $operation $options
else
echo "Skipping 'nix flake update'..."
/run/wrappers/bin/sudo -u root /run/current-system/sw/bin/nixos-rebuild $operation --flake github:kylekrein/nixos-config
fi
exit 0

View file

@ -1,13 +0,0 @@
keys:
- &primary age1l8euy4w4nccrpdmfdfct468parcrulkqcts2jcljajs2as0k7passdv2x4
- &kylekrein-framework12 age10s6c9har9pg2a0md30fhpp2mfy89xxrrnu5dwrjtqzh3lktcdaysq7st65
- &kylekrein-mac age12apyh4f5m002npnfq5kansrzme6umtzsvc6m96fjz752gg8c7a8s8e48xd
- &kylekrein-homepc age1z6d8gk5fhm5mkkcrm4dycs4ugqaar3ls2h5ehwul9qcqhl9x4q8szmz6c7
creation_rules:
- path_regex: secrets/secrets.yaml$
key_groups:
- age:
- *primary
- *kylekrein-framework12
- *kylekrein-mac
- *kylekrein-homepc

View file

@ -1,21 +0,0 @@
{
config,
pkgs,
inputs,
lib,
hwconfig,
...
}: let
keyPath =
if hwconfig.useImpermanence
then "/persist/sops/age/keys.txt"
else "/var/lib/sops/age/keys.txt";
in {
environment.systemPackages = with pkgs; [sops];
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key" "/persist/home/kylekrein/.ssh/id_ed25519" "/home/kylekrein/.ssh/id_ed25519"];
sops.age.keyFile = keyPath;
# This will generate a new key if the key specified above does not exist
sops.age.generateKey = true;
}

View file

@ -1,58 +0,0 @@
users:
kylekrein: ENC[AES256_GCM,data:DNLVQ4IPFhUG9MR9hk2BuElvfNZIky3nMGWgilutRwvT3wl25vOLEETrBFoWUO+2ZgLSnhtwWtIJhNlRlTK/rsrUNVTOdwq9AA==,iv:Z+dhr33Wotm064IcwtNfFpvQeL03T29Dn3Bl9VqPL1g=,tag:Qe3sOY0DegSKDptBjnbFrQ==,type:str]
tania: ENC[AES256_GCM,data:veo/dKQpztSGLfCxpWqoTOlPqSaNeNW2pYrTU9z125hjBVt2LC8X+mDp8vA0r8QFKpkGr1BiwviUTuXsSO1IXn3nHfDGsHQqFQ==,iv:q3pCcil1wiKe5xC6QEn3Q4wV1icW+3CCUQw6QZIINWU=,tag:XvBfIEORfdTcUihtcJQZVg==,type:str]
andrej: ENC[AES256_GCM,data:x/cWcswSDMFxXSLXe1JWGnQAuPYWM5AU4X3WxVAqUIifcYWxxynMfL9LXEgo3sP1IvRyp4FW+voWQrJM/KGdbYkkrAJNhbD7/Q==,iv:C51H9Zz4nxB+K1cohRq+1oPQ/ckDgVCMW4vB4+3wEt8=,tag:8ENLfMIoHbJGxceCKZulxg==,type:str]
services:
conduwuit: ENC[AES256_GCM,data:1shEq67QJTkeqrfYSr/eYG7gYWH//5ey6XQ=,iv:hy5wQmue8qU4ALfn9BrNQLnsTk8BsVVXY/8bDj18mXk=,tag:h6+hL0HjgSzd15Kc7Zg4ng==,type:str]
gitlab:
dbPassword: ENC[AES256_GCM,data:itn9xyNZO+xkSk0GKvLzjLRzM0uZ+TalqLtj6tyjKXM=,iv:U8bX/On89wz6Lz4R2/fZ+FWRObehlnjFhUQdAhmxb60=,tag:oEbee14jCGfRs8i5bJZ5FA==,type:str]
rootPassword: ENC[AES256_GCM,data:lXq+GIn6ooTzZL4iMYFzx3kn8gdcdsNaLQ/zVCr75Nw=,iv:mGp9gxL9uABpbod/ZNNyEllBbcfrQuFG4pQgs0v/xbk=,tag:CZzj4hauh/Qi8fvtmaZ/KQ==,type:str]
secret: ENC[AES256_GCM,data:W7PfRh80hzMZrJebHgs4CJeeABWIVVkh3ByTF1Yfavw=,iv:WnLEACeCZOf+YpF4RzQCXG6uPEq7zrE6u7DQQLZjL/Q=,tag:3qjnIeoptMsIxIbTh5TR+Q==,type:str]
dbsecret: ENC[AES256_GCM,data:5VJdhvr1z3sYlXJz0u1eKk5UBt9rKzMiTQcawA64/K0dL6A3WCppnmHeLw6X0vJPnZ6uqJuEDyV7DU5nEg==,iv:fk0oDjYfxzWD2SmVSlwrvJeiHrMxUhR41bqQJ5IXs18=,tag:9cSlRX+bvr8vjBtxwqbeFw==,type:str]
otpsecret: ENC[AES256_GCM,data:enBP2fsr+VaHuK93GGDtgGMSf20yxgLloHIHIibFfLo=,iv:iLLVuypLXySsw363Y9CSz5Kqa3CCNQFwURdOoi5Ig20=,tag:CgUMcT+x/134JJaScHLlOQ==,type:str]
activeRecordSalt: ENC[AES256_GCM,data:kbIImurv4lpcJJMQlEVJJpuuBTw/OUG+PW3Y9kQlIVM=,iv:1ymv3gmRhff49uaTLrIkWA0rX1wtRdfpa0551zHvsko=,tag:KDrDNg9sKRomGH8psS17gA==,type:str]
activeRecordPrimaryKey: ENC[AES256_GCM,data:AfL5kKmD2uqzq07xCCELDPLtZinE4b4RAmqd9xWAxgg=,iv:3Mhadey/k6k3/Ysb2KQ4eb9lDzHQJRAKP8R1Fw4wFdg=,tag:/0wS7lVkuoYTMCut8UEXWg==,type:str]
activeRecordDeterministicKey: ENC[AES256_GCM,data:pJBZAL60XeCrW7CPx76WcWpsYOwlR4OWmIP/61vNL3k=,iv:t/YmnVFge6kLiQjXD6RKNn7r5Oy1Aeyi3ZIaP57Nhig=,tag:L4aU4h4KdbsSNDpgybaV3g==,type:str]
oidcKeyBase: ENC[AES256_GCM,data:hHBdaIynMg8eWiwDjDfN+8PcUjOPl9VzG6lu2Z1eRrC2PaVXORg1Eh6YPi83efqhaSbONHeiORGsLM/NYHFcviEvQ8aZXb9y/ojKPHdyjYvkedIU1alyfWqiz8+xP/H2JFPgMdDsO6Tt4IswTMCfbNOXY2+RwImLACxTDoeY9LX2wklrGWh7F7DqAYymM2T6PrulJqGtbrep3yEylb5kqPZU34aJQzdZ7/zA5EW68xTOWEElCcxfkr2ThCywk6quUQaaCsqVAjZhULRDYfDA/umF8r6S7eNh0eFm6X17xsLTgkSMkx4gLvaUxtLG9bGM/5FJ6823hyRSTNXZx0cV7f195mqeUhn6rvUIl6qC8O7Ln6auWxjuJDRo+1Phr4J3dQMBXBaG2WpQFufgXNw8qWpMEqpiN6CjXhFYWJT/TxCZR+Bdxqt8Fegk0DjcEQFbJDOKKV3/JMu1hIsydeVRTmyy06EbBKSfAIgFddQIA7DmxqK6tqLRtITQ1K9xGnt4msiqgfv1XiyeTo+vmptYVDGLSLtB6yfOKvs/U31RlNESwcHwIqlisl1bex5HV10OCcMkFVhhffoiT1Swdj9ilMhd3TkgL2uJstC26QuyB4Gdnmz28MWU28JXP7qVf0rvq6nNPYAKpO3LgNPx5JrCz6DGCxSZiJOQ0fYDxz5QC2EznAbmZachg8tBb4Hmd/CvEtMMvWfkxueadTV7fWR0l3R4H1cizUF8j2NIfqWb6TQLIy25PaOSNnyZ+a4NFZDgZQcpl4zbCLVKHEKGDGhMr4SpEtKzasZSwv1jw7TZoiN8I2g1hSdZRCq3KJ2nAIGvlZd8NUTsksxsIXcxaoM1rfl4dIOfHm3H+HcKmnMYafnCH0EgdRZeAv1sonDzUOEl2G8myUTa3xNlR43lauIG0ipat83UO6INFh4N0TFJtirPHjm72ZMfUK89ut5fWnYqiKopkJEtAy7Bk1EUbXwuRfBDB34m8AFdDGbVWWVaoVJkSuIr8PHMsFhJRGn1TUit7tDQfgPvLpPD0Wiq2PBgoExZ8qLYUDdOCvTxWnZ+gpTRghiBebulNR0xGOCeopg4qiMZ7rWfUJHsqNUazpak1JPIWC8wYIJ4vojjIH1TCpl11lYUvXy1ffFkcWBYplsGYBuY3qpXG/Od3yrdwPKzhHPjPpWDdxZJBW91HRdq0qhq9mYIr28kqGF4Mg60cGGdin+/O0jcfzWzwhjibEfrfuzBqhHknTPXDTlKPBctdvcQZRUsOS0d6SrNRXOvvzlSTrUowaQTSrZNzNDpAt3VKYJDnXGgwnAZSk8zhRM7J6bc9artgm75qBWuZCxLHbcqyBeWVRALYPkWp5h1bLCaGHgC7x986d0mGxfU9p2szIRyacbJN/ITIuDuDmvBt9NWydkkdT3GZE9uhbxQMgfkKyLyXvf7LrF1iSmIos15tYCZrxAcu0LMo2mqW51e92uc4AXE8rVB4k7z2j19F5sW9GMQgKOk6qT1CSpzfHvPpVdKQ5cVVj4X5GZOao5flo1tO/sNwE92Jpc/jLw96737rRDGe9vSkdbyhSS1wrF4+P59QPxsdelSAYZF6YMgSN0yCJFuRLWfj6IpxpBIEEuB5QACCHnDiWi9cFEwRaq6EX6f87Joznd9o1kwASmMXpkXqv/rLorjlqdXajwdFXEmNUFMqX90va7LvlZJPHhvXmgJCwdHAKacQj1m0Ji4EqSZhM/I1uEhG6zTc2jE46N2peVf2JytEGpbgF/m2pyGJDDQ5SDIfG+4AdUXVTk68wl0Q2SSjBb4d/N8XNfPHHToXEuNsNmHZx/4Yt9b+RJqzl3Mi+HOvJP/mz8wR7TxceHnuqE0RTvl9TYN0MXkXVfh6ECj6AaDuiL930IYabRZ5do7eMaA2OYZoPvZA4udoctDApyzs0Dn0gVu9sFXUgmNV7YnkETeEtjKEn/sjWmkMFQ+vJoK27H4OuILxYj5jtBhWbjNYeheBVo5jXmANakDO95vlLhlp2t11LrEoR59dNVVvvN3zDuX1/EYI0OvS4Isl7HTk8ud0+8tfzywGAY3LtEhpEffe91gqEleu2atKYWZQ8917ugvmGkNQ5SNJloDFtUFvAAjJypoovQ6JxQOgFGSsgKMMUMSyuUQnjkxThrGL6oMavAGKElJn6xFc48xSvS4dluTotqwzN2gaV5a98PFbw4zda3ltx2uJD3XxYqr1J92P39YMjKihFIALrcXIESV0Aehfap3WATjlRLikTq726wo2n+k,iv:P8C/7NUd1G/VbKz7iWjTVXxMFOxZQxX5d0V4Tj6KeCw=,tag:iq4s3ahqkmf4e7BffjlIcQ==,type:str]
sops:
age:
- recipient: age1l8euy4w4nccrpdmfdfct468parcrulkqcts2jcljajs2as0k7passdv2x4
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxU2dMcDZjNHhFMmltNkRJ
VlZiYk1hdE1Dczhya3J4Q1EyUlY3ekZtVUFnCkpvN2Y0OFNUTnFtbFIxZVhDdnc3
YWh3S3FWeXFHTlU4Y0ZOZmI5d1F1dTAKLS0tIFhWSWp1d29ORnJGYWZxMDJib0ho
NTFaWFE0Rk4yU2hXYjRsUFhZY3pTR2cKoQkn7UJVh7uIyCEezrd34arkRxScIL3O
4P/6eDoqXJBkvzwDgidqLLcwuu1nanJpbmr662gRuZmnybwEVp504g==
-----END AGE ENCRYPTED FILE-----
- recipient: age10s6c9har9pg2a0md30fhpp2mfy89xxrrnu5dwrjtqzh3lktcdaysq7st65
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXRU8vd0I0bjRma1pveWVn
ZWFKci9ld2NuRmFla3R0azgzaHl0N20rMHlzCmpaaE1HYmYzVW1RWUw1L0hBclJk
eUlDTWk3ZXJ5Z25HYXJFODQ4T1lHMFUKLS0tIDg0QlhoQll1Q01BY2thSEFTN0RH
cGd4ZG9VUWVxeFlZL2VuVlFsRWVseDQKHKkQONzFlbKMFFzNeATkpUqJdWIAlEL8
QqUvujs1mMCWw9dqXhlT2ik7LHQO6yp5Oh4gxLg8nhZqs5O+leNdQQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age12apyh4f5m002npnfq5kansrzme6umtzsvc6m96fjz752gg8c7a8s8e48xd
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6Wmc1alppT1BSS0NKcDZ0
TWNOKzVmQkpmeG1YZ0p4Tm5BVlBxaS81VW44CllubzREc3g0dVB4dUhuMWJDMGtm
UTVBYlZjT3JEWExoSDV5a1BzYk1BMUUKLS0tICtnK2xNalBEWjFPZis2UFRubWxl
aDdZNVZqRnM5U3hRK1gyNFllRVJXMEkKko3YM1MtoWR01/YN/1QtTgtWsGf+r8MH
dZaWrIyAbRMeR/aBSZ3VjiuP1d2G7YtT1fa7/jaXd0igiYu2gWDu9A==
-----END AGE ENCRYPTED FILE-----
- recipient: age1z6d8gk5fhm5mkkcrm4dycs4ugqaar3ls2h5ehwul9qcqhl9x4q8szmz6c7
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBheDVNcVRKTHdxa01zTjJi
NUxGVVlleTNaZnJ6QVhreU9XbGkwaVh6R1N3CkR5T0VKTnd6N0hteDlOUHdKcS9p
YWwzL2lwTExyaUcrcXQ2dG4xOGpZN0UKLS0tIFJZU1hXMUtOSklXYjdtWkt6UTFl
MU43ZWEwMXEwdGx5d0hUNlhiaGdjWU0K9UoNQOnMxTy0KdfiYOgm0TxH5qFUV3gi
f7z2RzR44ndf0nHwIzr8e1bmF9q5mc685Wq9qyM7aLCE+yUU/vUO7Q==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-07-30T16:15:59Z"
mac: ENC[AES256_GCM,data:mmJH3BEqsrboGaQM7yWuHF1MWREC4bLc+RAZgsqlNvhgoWLoaVDLuBjEfuXCDPdnvDPesbUrI8HHA5gz523C0PoJdkoFcRoVOwhLqj6tJjT4JnlaTgpBMN5UqBqt9Gm68mqekE0bm7ihdc3lnn/OkRrxJI3Th5KzUC4zMmdjVsI=,iv:K0f75ft3PQdQ1AUFzrannvLv03fl6FS6se/muMcyQkY=,tag:y3FJQDthKoWvoMHdmcvRQA==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2

View file

@ -1,55 +0,0 @@
{
pkgs,
lib,
config,
hwconfig,
unstable-pkgs,
...
}: let
cfg = config.kk.steam;
in {
options.kk.steam = {
enable = lib.mkEnableOption "Enable steam";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
unzip
wget
xdotool
xorg.xprop
xorg.xrandr
unixtools.xxd
xorg.xwininfo
yad
protonup-qt
protontricks
bottles
];
programs.steam = {
enable = true; #!hwconfig.useImpermanence;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
package = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
sdl3
SDL2
stdenv.cc.cc.lib
libkrb5
keyutils
gamescope
];
};
};
programs.gamemode.enable = true;
};
}

View file

@ -1,58 +0,0 @@
{pkgs, ...}: {
programs.tmux = {
enable = true;
terminal = "tmux-256color";
#prefix = "C-Space";
clock24 = true;
mouse = true;
keyMode = "vi";
baseIndex = 1;
sensibleOnTop = true;
disableConfirmationPrompt = true;
plugins = with pkgs.tmuxPlugins; [
vim-tmux-navigator
{
plugin = catppuccin;
extraConfig = ''
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_date_time "%H:%M"
'';
}
{
plugin = resurrect;
extraConfig = ''
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
'';
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-save-interval '10'
'';
}
yank
];
extraConfig = ''
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
'';
};
}

View file

@ -1,43 +0,0 @@
{
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "andrej";
in {
imports = [
];
users.users.${username} = {
isNormalUser = true;
description = "Andrej Lebedev";
extraGroups = ["networkmanager"];
#initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; [
flatpak
];
};
sops.secrets = {
"users/${username}" = {
neededForUsers = true;
};
};
home-manager.users."${username}" = import ../../home.nix {
inherit lib;
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
inherit config;
inherit pkgs;
};
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
}

View file

@ -1,41 +0,0 @@
{
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "dima";
in {
imports = [
];
users.users.${username} = {
isNormalUser = true;
description = "Dima";
extraGroups = ["networkmanager"];
initialPassword = "1234";
#hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; [
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILIc/J6YxwWKajJ923/PZ2fcgLgWZdVMcZQ4oZZ+2hwn dima@dragonarch"
];
};
programs.ssh.forwardX11 = true;
home-manager.users."${username}" = import ../../home.nix {
inherit lib;
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
inherit config;
inherit pkgs;
};
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
}

View file

@ -1,53 +0,0 @@
{
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "kylekrein";
in {
imports = [
];
users.users.${username} = {
isNormalUser = true;
description = "Aleksandr Lebedev";
extraGroups = ["networkmanager" "wheel" "input" "touchscreen"];
#initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; [];
linger = false;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMt3PWVvmEL6a0HHTsxL4KMq1UGKFdzgX5iIkm6owGQ kylekrein@kylekrein-mac"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFDdxZ5OyGcfD1JwEa4RWw86HWZ2dKFR0syrRckl7EvG kylekrein@kylekrein-homepc"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILt+CDDU4gDo12IO2dc50fceIWkn26/NuTq4j25hiGre kylekrein@kylekrein-framework12"
];
};
sops.secrets = {
"users/${username}" = {
neededForUsers = true;
};
};
nix.settings.trusted-users = [
"kylekrein"
];
home-manager.extraSpecialArgs = {
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
};
home-manager.users."${username}" = ../../home.nix;
kylekrein.services.autoUpgrade = {
#configDir = lib.mkForce "/home/${username}/nixos-config";
#user = lib.mkForce username;
};
programs.nh.flake = lib.mkForce "/home/${username}/nixos-config";
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
}

View file

@ -1,42 +0,0 @@
{
pkgs,
config,
lib,
hwconfig,
inputs,
first-nixos-install,
...
}: let
username = "tania";
in {
imports = [
];
users.users.${username} = {
isNormalUser = true;
description = "Tetiana";
extraGroups = ["networkmanager"];
#initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; [
];
};
sops.secrets = {
"users/${username}" = {
neededForUsers = true;
};
};
home-manager.users."${username}" = import ../../home.nix {
inherit lib;
inherit username;
inherit inputs;
inherit first-nixos-install;
inherit hwconfig;
inherit config;
inherit pkgs;
};
systemd.tmpfiles.rules =
if hwconfig.useImpermanence
then ["d /persist/home/${username} 0700 ${username} users -"]
else []; # /persist/home/<user> created, owned by that user
}

View file

@ -1,157 +0,0 @@
{
config,
lib,
pkgs,
hwconfig,
first-nixos-install,
inputs,
unstable-pkgs,
...
}: {
imports =
[
./modules/firefox
./modules/flatpak
./modules/gnupg
./modules/direnv
./hosts/${hwconfig.hostname}
]
++ lib.optional (hwconfig.useImpermanence) ./modules/impermanence;
networking.hostName = hwconfig.hostname;
time.timeZone = "Europe/Berlin";
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
#flatpak
#kk.services.flatpak.enable = hwconfig.system != "aarch64-linux";
services.flatpak.packages = [
];
# Enable common container config files in /etc/containers
virtualisation.containers.enable = true;
virtualisation = {
docker.enable = true;
};
users.extraGroups.docker.members = ["nixos"];
environment.systemPackages = with pkgs; [
inputs.emacs-kylekrein.packages.${pkgs.system}.with-lsps-native
killall
nix-output-monitor
eza
fd
(pkgs.writeShellScriptBin "root-files" ''
${pkgs.fd}/bin/fd --one-file-system --base-directory / --type f --hidden --exclude "{tmp,etc/passwd}"
'') # https://www.reddit.com/r/NixOS/comments/1d1apm0/comment/l5tgbwz/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
tealdeer
docker-compose
fzf
lazygit
fastfetch
wl-clipboard
git
git-credential-manager
egl-wayland
xclip
btop
comma
csharp-ls
];
wsl = {
enable = true;
defaultUser = "nixos";
useWindowsDriver = true;
};
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/nixos/nixos-config";
};
services.ollama = {
enable = true;
loadModels = ["llama3.1" "qwen2.5-coder:7b"];
acceleration = "cuda";
user = "ollama";
group = "ollama";
};
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
font-awesome
nerd-fonts.symbols-only
hack-font
# microsoft fonts:
corefonts
vistafonts
];
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_RUNTIME_DIR = "/mnt/wslg/runtime-dir"; #sometimes gui apps stop working in wsl. This option makes GUI apps load much slower but at least they work https://github.com/microsoft/wslg/issues/1303#issuecomment-2764300164
EDITOR = "emacsclient -c";
};
hardware = {
graphics = {
enable = true;
};
};
security.polkit.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
programs.bash = {
shellAliases = {
ls = "${pkgs.eza}/bin/eza --icons=always";
};
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [22];
networking.firewall.allowedUDPPorts = [22];
# Or disable the firewall altogether.
#networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
substituters = [
"https://hyprland.cachix.org"
"https://nix-gaming.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
}