Merge branch 'main' of github.com:bloxx12/nichts

This commit is contained in:
LarsZauberer 2024-04-13 09:33:46 +02:00
commit 53a226f32b
57 changed files with 1977 additions and 139 deletions

View file

@ -37,4 +37,15 @@ in {
inputs.agenix.nixosModules.default
];
};
flocke = lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit lib inputs self; };
modules = [
./dragyx/flocke
../modules
inputs.home-manager.nixosModules.home-manager
inputs.agenix.nixosModules.default
];
};
}

View file

@ -0,0 +1,65 @@
# which default packages to use for the system
{ inputs, outputs, profile-config, pkgs, ...}:
let
python-packages = ps: with ps; [
pandas
numpy
opencv4
ipython
];
in
{
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
(python3.withPackages python-packages)
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
neovim
eza # exa is unmaintained
hwinfo
zsh
git
broot
unzip
rsync
# neofetch
# fastfetch has the option to set a timeout for
# for each module, which makes it dramatically faster
# as counting the number of packages takes over 800 (!!!) ms,
# which makes it very unpleasant to use as default thing
# to display when starting a terminal
fastfetch
alacritty
wget
gnumake
zoxide
python3
nodejs
gcc
cargo
rustc
rust-analyzer
clippy
lsof
htop
okular
smartmontools
networkmanager
pkg-config
sof-firmware # audio
nix-index
# --------- optional
gnome.eog
sherlock
xfce.thunar
plocate
alsa-utils
# partition management
parted
gnufdisk
lapce
];
}

View file

@ -0,0 +1,163 @@
{ config, pkgs, ... }:
{
imports = [
../../../options/common/pin-registry.nix
../../../options/common/preserve-system.nix
../../../options/desktop/fonts.nix
];
nixpkgs.config.allowUnfree = true;
time.timeZone = "Europe/Zurich";
security.sudo.package = pkgs.sudo.override { withInsults = true; };
services.xserver = {
enable = true;
displayManager = {
sessionPackages = [ pkgs.hyprland ]; # pkgs.gnome.gnome-session.sessions ];
defaultSession = "hyprland";
sddm = {
enable = true;
};
};
windowManager.hypr.enable = true;
};
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.enable = true;
services.logrotate.checkConfig = false;
networking.hostName = "flocke"; # Define your hostname.
networking.hostId = "adf23c31";
networking.interfaces.wlp1s0.useDHCP = true;
networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [ networkmanager ]; # cli tool for managing connections
boot = {
kernelParams = [ ];
initrd.supportedFilesystems = [ "ext4" ];
supportedFilesystems = [ "ext4" ];
loader = {
efi.efiSysMountPoint = "/boot";
efi.canTouchEfiVariables = true;
grub = {
enable = true;
device = "nodev";
efiSupport = true;
enableCryptodisk = true;
};
};
initrd.luks.devices = {
cryptroot = {
device = "/dev/disk/by-uuid/ec5ff3a1-9b39-4ba5-aa0f-19e898b4f6e8";
preLVM = true;
};
};
};
# see https://nixos.wiki/wiki/AMD_GPU
services.xserver.videoDrivers = [ "amdgpu" ];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
hardware.opengl.extraPackages = with pkgs; [
rocmPackages.clr.icd
];
services.power-profiles-daemon.enable = false;
# stock nixos power management
powerManagement.enable = true;
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
#Optional helps save long term battery health
START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge
STOP_CHARGE_THRESH_BAT0 = 85; # 80 and above it stops charging
};
};
swapDevices = [ {
device = "/var/lib/swapfile";
size = 32*1024;
} ];
# be nice to your ssds
services.fstrim.enable = true;
# services.xserver.enable = pkgs.lib.mkForce false;
security.polkit.enable = true;
modules = {
other = {
system = {
hostname = "flocke";
username = "dragyx";
monitors = {
name = "LaptopMain";
resolution = {
x = 2256;
y = 1504;
};
scale = 1.0;
refresh_rate = 60;
};
};
home-manager = {
enable = true;
enableDirenv = true;
};
};
programs = {
vesktop.enable = true;
btop.enable = true;
mpv.enable = true;
schizofox.enable = true;
obs.enable = true;
neovim.enable = true;
git = {
enable = true;
userName = "Dragyx";
userEmail = "66752602+Dragyx@users.noreply.github.com";
defaultBranch = "main";
};
starship.enable = true;
zsh = {
enable = true;
profiling = false;
};
# badneovim.enable = true;
};
services = {
pipewire.enable = true;
};
WM.hyprland.enable = true;
};
# 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 = "21.11"; # Did you read the comment?
}

View file

@ -0,0 +1,8 @@
_: {
imports = [
../../../options/desktop/monitors.nix
./configuration.nix
./hardware-configuration.nix
# ./packages.nix
];
}

View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/2aaba0f2-e8dc-4583-a81e-2d35cc238e79";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/9D34-36F8";
fsType = "vfat";
};
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.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,56 @@
# which default packages to use for the system
{ inputs, outputs, profile-config, pkgs, ...}:
let
python-packages = ps: with ps; [
pandas
numpy
opencv4
ipython
];
in
{
imports = [
../common/packages.nix
];
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# security audits
lynis
element-desktop
jetbrains.idea-community
baobab
amdvlk
texlive.combined.scheme-full
android-tools
signal-desktop
nextcloud-client
etcher
vlc
audacity
thunderbird
eclipses.eclipse-java
openjdk
firefox
# pkgs.nordvpn # nur.repos.LuisChDev.nordvpn
material-icons
material-design-icons
libreoffice
gimp
spotify
okular
# minecraft
prismlauncher-unwrapped
glfw-wayland-minecraft
glxinfo
# window manager
flameshot
feh
# Animeeeeee!
ani-cli # The stable version is very outdated
];
}

View file

@ -5,7 +5,7 @@
security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true;
programs.kdeconnect.enable = true;
myOptions = {
modules = {
other = {
system = {
gitPath = "/home/lars/nichts";

View file

@ -1,11 +1,15 @@
{ config, inputs, pkgs, ... }:
{
myOptions = {
modules = {
other = {
system = {
hostname = "dyonisos";
username = "lars";
};
};
hyprland = {
enable = true;
monitor = ",preferred,auto,1";
};
};
}

View file

@ -1,6 +1,6 @@
{ config, inputs, pkgs, ... }:
let
username = config.myOptions.other.system.username;
username = config.modules.other.system.username;
in {
home-manager.users.${username} = {
home.packages = let

View file

@ -1,10 +1,17 @@
{ config, lib, inputs, pkgs, ... }:
with lib; let
username = config.myOptions.other.system.username;
cfg = config.myOptions.hyprland;
username = config.modules.other.system.username;
cfg = config.modules.hyprland;
in {
options.myOptions.hyprland.nvidia.enable = mkEnableOption "nvidia";
options.myOptions.hyprland.enable = mkEnableOption "hyprland";
options.modules.hyprland.nvidia.enable = mkEnableOption "nvidia";
options.modules.hyprland = {
enable = mkEnableOption "hyprland";
monitor = mkOption {
description = "hyprland monitor config";
default = ",preferred,auto,1";
type = types.listof(types.str);
};
};
config = mkIf cfg.enable {
environment.sessionVariables = mkIf cfg.nvidia.enable {
@ -36,11 +43,6 @@ in {
settings = {
"$mod" = "SUPER";
monitor = [
"DP-2,2560x1440@144,0x0,1"
"DP-1,1920x1080@60,2560x0,1"
];
input = {
kb_layout = "ch";
};
@ -56,6 +58,16 @@ in {
# Monitor management
"$mod SHIFT, k, movecurrentworkspacetomonitor, DP-2"
"$mod SHIFT, j, movecurrentworkspacetomonitor, DP-1"
# Window Management
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
"$mod, F, fullscreen"
# Screenshot
"$mod SHIFT, s, exec, grim -g 'slurp -d' - | wl-copy"
]
++ (
builtins.concatLists (builtins.genList (

View file

@ -1,6 +1,6 @@
{ config, inputs, pkgs, ... }:
{
myOptions = {
modules = {
other = {
system = {
hostname = "kronos";
@ -10,6 +10,10 @@
hyprland = {
enable = true;
nvidia.enable = true;
monitor = [
"DP-2,2560x1440@144,0x0,1"
"DP-1,1920x1080@60,2560x0,1"
];
};
};

View file

@ -1,6 +1,6 @@
{ config, inputs, pkgs, ... }:
let
username = config.myOptions.other.system.username;
username = config.modules.other.system.username;
in {
home-manager.users.${username} = {
home.packages = let

View file

@ -1,6 +1,6 @@
{ config, inputs, pkgs, ... }:
let
username = config.myOptions.other.system.username;
username = config.modules.other.system.username;
in {
home-manager.users.${username} = {
home.packages = let
@ -50,6 +50,9 @@ in {
kitty
nextcloud-client
vscode
grim
slurp
wl-clipboard
];
};
}

View file

@ -1,8 +1,8 @@
{ pkgs, lib, config, ... }:
with lib; let
cfg = config.myOptions.programs.awesome;
cfg = config.modules.programs.awesome;
in {
options.myOptions.programs.awesome.enable = mkEnableOption "awesome";
options.modules.programs.awesome.enable = mkEnableOption "awesome";
config = mkIf cfg.enable {
services.xserver = {

View file

@ -6,7 +6,7 @@
security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true;
programs.kdeconnect.enable = true;
myOptions = {
modules = {
other = {
system = {
hostname = "mars";
@ -20,12 +20,11 @@
};
programs = {
vesktop.enable = true;
ssh.enable = true;
btop.enable = true;
mpv.enable = true;
i3.enable = true;
awesome.enable = true;
schizofox.enable = true;
obs.enable = true;
displaymanager.enable = true;
#neovim.enable = true;
#git = {
@ -42,7 +41,7 @@
};
services = {
pipewire.enable = true;
};
};
themes = {
cursor = {
enable = true;

View file

@ -6,5 +6,6 @@ _: {
./profile.nix
./i3.nix
./awesome.nix
./hypr/default.nix
];
}

View file

@ -0,0 +1,7 @@
_: {
imports = [
./idle.nix
./land.nix
./lock.nix
];
}

View file

@ -0,0 +1 @@
_: {}

View file

@ -0,0 +1,423 @@
{ config, inputs, lib, pkgs, ... }:
with lib; let
cfg = config.modules.programs.hypr.land;
username = config.modules.other.system.username;
hmCfg = config.home-manager.users.${username};
smwPresent = elem inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces cfg.extraPlugins;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset;
inherit (inputs.anyrun.packages.${pkgs.system}) anyrun;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
inherit (inputs.hyprlock.packages.${pkgs.system}) hyprlock;
in {
options.modules.programs.hypr.land = {
enable = mkEnableOption "huperland";
startupSound = mkOption {
type = with types; nullOr path;
description = "sound to play on hyprland startup";
default = null;
};
tearing = mkOption {
type = types.bool;
description = "enable tearing";
default = false;
};
extraSettings = mkOption {
type = types.attrs;
description = "extra per host hyprland settings";
default = {};
};
extraPlugins = mkOption {
type = with types; listOf package;
description = "extra per host hyprland plugins";
default = [];
};
};
disabledModules = [ "programs/hyprland.nix" ];
config = mkIf cfg.enable {
nix.settings = {
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
environment.sessionVariables = {
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland";
SDL_VIDEODRIVER = "wayland";
_JAVA_AWT_WM_NONEREPARENTING = "1";
CLUTTER_BACKEND = "wayland";
GDK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland";
LIBSEAT_BACKEND = "logind";
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
];
# TODO look into and make use of this
config.common.default = "*";
};
home-manager.users.${username} = {
xdg.dataFile = mkIf (cfg.startupSound != null) { "hypr/startup_sound".source = cfg.startupSound; };
wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
#portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
plugins = [] ++ cfg.extraPlugins;
# TODO make these work with the config below (infinite recursion)
# and make this file stop hanging my neovim every 2 seconds
# and figure out why it triggers E79 every single time I edit something
extraConfig = ''
bind=$mainMod, W, exec, schizofox
${if (cfg.startupSound != null) then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ${hmCfg.xdg.dataHome}/hypr/startup_sound" else ""}
'';
settings = {
"$mainMod" = "SUPER";
monitor = [
# second monitor
"HDMI-A-1, 1920@1080, 0x0, 1"
];
workspace = [
# second monitor
"1, monitor:HDMI-A-1, default:true"
"2, monitor:HDMI-A-1"
"3, monitor:HDMI-A-1"
"4, monitor:HDMI-A-1"
"5, monitor:HDMI-A-1"
"6, monitor:HDMI-A-1"
"7, monitor:HDMI-A-1"
"8, monitor:HDMI-A-1"
"9, monitor:HDMI-A-1"
"10, monitor:HDMI-A-1"
# scratchpads
"special:btop, decorate:false"
"special:pipewire, decorate:false"
"special:nixos, decorate:false"
(mkIf config.services.asusd.enable
"special:rog, decorate:false")
"special:keepassxc, decorate:false"
];
input = {
kb_layout = "de";
kb_variant = "";
kb_model = "";
kb_options = "";
kb_rules = "";
follow_mouse = true;
touchpad = {
disable_while_typing = false;
};
repeat_rate = 50;
repeat_delay = 250;
touchdevice = {
output = "eDP-1";
};
tablet = {
output = "HDMI-A-1";
};
};
general = {
sensitivity = 1.0;
gaps_in = 5;
gaps_out = 5;
border_size = 2;
apply_sens_to_raw = 0;
#no_border_on_floating = true;
allow_tearing = mkIf cfg.tearing true;
"col.active_border" = "0xFFF5C2E7";
"col.inactive_border" = "0xFF45475A";
#col.group_border_active = "0xFFA6E3A1";
#col.group_border = "0xFF45475A";
};
env = optionals cfg.tearing [ "WLR_DRM_NO_ATOMIC,1" ];
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 2;
};
drop_shadow = 1;
shadow_range = 15;
shadow_render_power = 2;
shadow_ignore_window = 1;
shadow_offset = "2 4";
shadow_scale = 1;
"col.shadow" = "0xAF1E1E2E";
};
bezier = [
"dupa, 0.1, 0.9, 0.1, 1.05"
];
animations = {
enabled = true;
animation = [
"windows, 1, 4, dupa, popin"
"windowsOut, 1, 7, dupa, slide"
"border, 1, 15, default"
"fade, 1, 10, default"
"workspaces, 1, 5, dupa, slidevert"
];
};
dwindle = {
no_gaps_when_only = true;
};
misc = {
enable_swallow = false;
swallow_regex = "foot";
focus_on_activate = true;
vrr = 1;
vfr = true;
animate_manual_resizes = false;
animate_mouse_windowdragging = false;
force_default_wallpaper = 0;
};
windowrulev2 = [
"float, class:^(Tor Browser)$"
"float, class:^(foot)$"
"float, class:^(mpv)$"
"float, class:^(imv)$"
"float, class:^(Vieb)$"
"float, title:^(Picture-in-Picture)$"
"float, title:^(.*)(Choose User Profile)(.*)$"
"float, title:^(blob:null/)(.*)$"
"float, class:^(xdg-desktop-portal-gtk)$"
"float, class:^(code), title: ^(Open*)"
"size 70% 70%, class:^(code), title: ^(Open*)"
"center, class: ^(code), title: ^(Open*)"
"float, class:^(org.keepassxc.KeePassXC)$"
(mkIf config.services.asusd.enable
"size 960 670, title:^(ROG Control Center)$")
];
bind = [
"$mainMod, RETURN, exec, ${foot}/bin/${foot}"
"$mainMod SHIFT, Q, killactive"
"$mainMod, F, fullscreen, 0"
"$mainMod, M, fullscreen, 1"
"$mainMod, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun"
"$mainMod, SPACE, togglefloating, active"
"$mainMod SHIFT, C, centerwindow"
"$mainMod CONTROL, R, bringactivetotop"
"$mainMod, P, pin"
# workspaces
"$mainMod, 1, ${if smwPresent then "split-" else ""}workspace, 1"
"$mainMod, 2, ${if smwPresent then "split-" else ""}workspace, 2"
"$mainMod, 3, ${if smwPresent then "split-" else ""}workspace, 3"
"$mainMod, 4, ${if smwPresent then "split-" else ""}workspace, 4"
"$mainMod, 5, ${if smwPresent then "split-" else ""}workspace, 5"
"$mainMod, 6, ${if smwPresent then "split-" else ""}workspace, 6"
"$mainMod, 7, ${if smwPresent then "split-" else ""}workspace, 7"
"$mainMod, 8, ${if smwPresent then "split-" else ""}workspace, 8"
"$mainMod, 9, ${if smwPresent then "split-" else ""}workspace, 9"
"$mainMod, 0, ${if smwPresent then "split-" else ""}workspace, 10"
"$mainMod SHIFT, 1, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 1"
"$mainMod SHIFT, 2, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 2"
"$mainMod SHIFT, 3, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 3"
"$mainMod SHIFT, 4, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 4"
"$mainMod SHIFT, 5, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 5"
"$mainMod SHIFT, 6, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 6"
"$mainMod SHIFT, 7, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 7"
"$mainMod SHIFT, 8, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 8"
"$mainMod SHIFT, 9, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 9"
"$mainMod SHIFT, 0, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 10"
# screenshots
"$mainMod, S, exec, grimblast save area - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\""
"$mainMod CONTROL, S, exec, grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\""
"$mainMod SHIFT, R, exec, ${hyprland}/bin/hyprctl reload"
# TODO fix this maybe
"$mainMod, T, exec, grim -g \"$(slurp)\" -t ppm - | tesseract -l pol - - | wl-copy && notify-send \"Copied text: \" \"\\\"$(wl-paste)\\\"\""
# TODO fix this
"$mainMod, SEMICOLON, exec, ~/.config/rofi/powermenu/type-2/powermenu.sh"
"$mainMod, G, togglegroup"
# this sometimes fixes the portal
"$mainMod CONTROL, X, exec, ${pkgs.systemd}/bin/systemctl --user restart xdg-desktop-portal-hyprland"
"$mainMod SHIFT, X, exec, ${hyprland}/bin/hyprctl kill"
# scratchpad binds
"$mainMod, B, togglespecialworkspace, btop"
"$mainMod, V, togglespecialworkspace, pipewire"
"$mainMod, N, togglespecialworkspace, nixos"
"$mainMod, X, togglespecialworkspace, keepassxc"
"$mainMod, C, exec, ${hyprlock}/bin/hyprlock"
# toggle waybar
"$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || waybar"
#"$mainMod, mouse_up, exec, ${hyprland}/bin/hyprctl keyword misc:cursor_zoom_factor $(echo \"$(${hyprland}/bin/hyprctl getoption misc:cursor_zoom_factor -j | ${pkgs.jq}/bin/jq '.float') + 0.01\" | ${pkgs.bc}/bin/bc)"
#"$mainMod, mouse_down, exec, ${hyprland}/bin/hyprctl keyword misc:cursor_zoom_factor $(echo \"$(${hyprland}/bin/hyprctl getoption misc:cursor_zoom_factor -j | ${pkgs.jq}/bin/jq '.float') - 0.01\" | ${pkgs.bc}/bin/bc)"
#"$mainMod, mouse_up, exec, ${pkgs.libnotify}/bin/notify-send 'mouse_up'"
#"$mainMod, mouse_down, exec, ${pkgs.libnotify}/bin/notify-send 'mouse_down'"
];
# repeat
binde = [
# window / monitor focus
"$mainMod, H, movefocus, l"
"$mainMod, J, movefocus, d"
"$mainMod, K, movefocus, u"
"$mainMod, L, movefocus, r"
"$mainMod CONTROL, J, focusmonitor, l"
"$mainMod CONTROL, K, focusmonitor, r"
"$mainMod SHIFT, G, changegroupactive, f"
"$mainMod CONTROL, G, changegroupactive, b"
];
# locked
bindl = [
", XF86AudioMedia, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop"
", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous"
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
", XF86AudioMute, exec, ~/Scripts/notif_volume.sh --toggle-mute"
];
# locked + repeat
bindle = [
", XF86MonBrightnessUp, exec, ~/Scripts/notif_brightness.sh set +5%"
", XF86MonBrightnessDown, exec, ~/Scripts/notif_brightness.sh set 5%-"
", XF86AudioRaiseVolume, exec, ~/Scripts/notif_volume.sh -ui 5"
", XF86AudioLowerVolume, exec, ~/Scripts/notif_volume.sh -ud 5"
];
# mouse
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
binds = {
pass_mouse_when_bound = false;
movefocus_cycles_fullscreen = false;
};
exec-once = let
# https://wiki.hyprland.org/IPC/#how-to-use-socket2-with-bash
handle_hyprland_events = pkgs.writeShellScriptBin "handle_hyprland_events" ''
#!/bin/sh
handle() {
case $1 in
configreloaded*)
${hyprland}/bin/hyprctl notify 1 2500 "" " Reloading Hyprland..."
;;
esac
}
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock |
while read -r line; do
handle "$line"
done
'';
in [
"waybar"
# run persistent special workspace windows
"[workspace special:nixos silent;tile] cd ~/niksos; ${foot}/bin/foot"
(mkIf config.services.asusd.enable
"[workspace special:rog silent;tile] ${config.services.asusd.package}/bin/rog-control-center")
"[workspace special:keepassxc silent;tile] ${pkgs.keepassxc}/bin/keepassxc"
(if config.modules.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";")
"${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24"
# TODO do something with this
#"${wl-clipboard}/bin/wl-paste --watch cliphist store"
"${swww}/bin/swww init"
"${wlsunset}/bin/wlsunset -S 06:00 -s 20:00"
# TODO fix fcitx5
#"fcitx5"
# TODO do these do anything anymore
"${pkgs.systemd}/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"${pkgs.dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP"
"rot8 --threshold 0.75"
"${handle_hyprland_events}/bin/handle_hyprland_events"
"wvkbd-mobintl --hidden -L 500"
];
exec = [
# kill (almost) everything on special workspaces
"${pkgs.procps}/bin/pkill btop"
"${pkgs.procps}/bin/pkill helvum"
"${pkgs.procps}/bin/pkill pavucontrol"
# and run it all again
"[workspace special:btop silent;tile] ${foot}/bin/foot -e ${pkgs.btop}/bin/btop"
"[workspace special:pipewire silent;tile] ${pkgs.helvum}/bin/helvum"
"[workspace special:pipewire silent;tile] ${pkgs.pavucontrol}/bin/pavucontrol"
# wait a bit then set the wallpapers
# "sleep 0.5 && ${swww}/bin/swww img -o eDP-1 ~/catppuccin-wall0.png"
# "sleep 0.5 && ${swww}/bin/swww img -o HDMI-A-1 ~/catppuccin-wall1.png"
"${pkgs.networkmanagerapplet}/bin/nm-applet --indicator"
"${pkgs.blueman}/bin/blueman-applet"
];
layerrule = [
# no black border on grimblast screenshots
"noanim, ^(selection)$"
"blur, ^(waybar)$"
"blur, ^(eww)$"
# TODO maybe this isn't needed
# temporary fix to swaylock screenshoting rofi before locking
#"noanim, ^(rofi)$"
"blur, ^(anyrun)$"
];
plugin = {
split-monitor-workspaces = {
count = 10;
keep_focused = true;
};
};
} // cfg.extraSettings;
};
};
};
}

View file

@ -0,0 +1,81 @@
{
config,
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.modules.programs.hypr.lock;
username = config.modules.other.system.username;
text_color = "rgba(eae0e4FF)";
in {
options.modules.programs.hypr.lock = {
enable = mkEnableOption "hiper zamek";
extraSettings = mkOption {
type = types.attrs;
description = "extra per host hyprlock settings";
default = {};
};
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [ inputs.hyprlock.homeManagerModules.default ];
programs.hyprlock = {
enable = true;
package = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
general = {
grace = 2;
};
backgrounds = [
{
color = "rgba(120f1177)";
path = "screenshot";
blur_size = 5;
blur_passes = 4;
}
];
input-fields = [
{
size = {
width = 600;
height = 50;
};
outline_thickness = 3;
dots_size = 0.1;
dots_spacing = 0.3;
outer_color = "rgba(9a8d9555)";
inner_color = "rgba(120f1111)";
font_color = "rgba(d1c2cbff)";
fade_on_empty = true;
position = {
x = 0;
y = 20;
};
halign = "center";
valign = "center";
}
];
labels = [
{
# clock
text = "$TIME";
color = text_color;
font_size = 65;
position = {
x = 0;
y = 300;
};
halign = "center";
valign = "center";
}
];
};
};
};
}

View file

@ -1,20 +1,26 @@
{ pkgs, lib, config, callPackage, ... }:
with lib; let
cfg = config.myOptions.programs.i3;
cfg = config.modules.programs.i3;
in {
options.myOptions.programs.i3.enable = mkEnableOption "i3";
options.modules.programs.i3.enable = mkEnableOption "i3";
config = mkIf cfg.enable {
services.xserver = {
enable = true;
xkb.layout = "de";
windowManager = {
bspwm.enable = true;
i3.enable = true;
};
displayManager = {
gdm.enable = true;
defaultSession = "none+i3";
setupCommands = ''
LEFT='DP-2'
CENTER='HDMI-1'
RIGHT='HDMI-0'
${pkgs.xorg.xrandr}/bin/xrandr --output $CENTER --rotate left --output $LEFT --rotate left --left-of $CENTER --output $RIGHT --right-of $CENTER
'';
# xrandr --output HDMI-1 --rotate normal --output DP-2 --rotate normal --left-of HDMI-1 --output HDMI-0 --right-of HDMI-1
};
};
};

View file

@ -4,6 +4,7 @@ _: {
../../../options/desktop/fonts.nix
../../../options/common/networking.nix
../../../options/common/gpu/nvidia.nix
# ../../../overlay.nix
# ../../options/common/pin-registry.nix
# ../../options/common/preserve-system.nix
#../../options/

View file

@ -1,45 +1,24 @@
{ config, inputs, pkgs, ... }:
let
username = config.myOptions.other.system.username;
username = config.modules.other.system.username;
in {
home-manager.users.${username} = {
home.packages = let
fenix = inputs.fenix.packages.${pkgs.system};
in with pkgs; [
pfetch
git
keepassxc
eza ripgrep
signal-desktop-beta
element-desktop
steam
tor-browser-bundle-bin
betterbird
telegram-desktop
libreoffice-fresh
qbittorrent
ventoy-full
lazygit
neofetch
zip
vlc
zathura
alacritty
scc
texliveFull
st
unzip
gcc
trash-cli
alsa-utils
asciinema
betterbird
bibata-cursors
networkmanagerapplet
xclip
pamixer
chromium
dig
pcmanfm
ffmpeg_6-full
yt-dlp
easyeffects
element-desktop
eza
ripgrep
fastfetch
(fenix.complete.withComponents [
"cargo"
"clippy"
@ -47,22 +26,51 @@ in {
"rustc"
"rustfmt"
])
polkit
asciinema
fastfetch
alsa-utils
imagemagick
pavucontrol
ffmpeg_6-full
foot
gcc
gdb
tree
smartmontools
krita
python3
rustdesk
grimblast
git
httpie
sherlock
strawberry
imagemagick
keepassxc
krita
lazygit
libreoffice-fresh
neofetch
neovim
networkmanagerapplet
nextcloud-client
pamixer
pavucontrol
pcmanfm
pfetch
polkit
python3
qbittorrent
rustdesk
scc
sherlock
signal-desktop-beta
smartmontools
st
steam
strawberry-qt6
telegram-desktop
texliveFull
thunderbird
tor-browser-bundle-bin
trash-cli
tree
unzip
ventoy-full
vesktop
vlc
xclip
yt-dlp
zathura
zip
];
};
}