1
1
Fork 0

Compare commits

..

No commits in common. "1aed4c8c73e04e6990ad425f9a9f3be871a6425a" and "2f78903651c3351e39d55a27561a86162355035a" have entirely different histories.

183 changed files with 2968 additions and 2646 deletions

View file

@ -3,26 +3,33 @@
inputs, inputs,
lib, lib,
... ...
}: { }:
age.secrets = let
{
age.secrets =
let
secret = filename: { secret = filename: {
file = "${inputs.self}/secrets/${filename}"; file = "${inputs.self}/secrets/${filename}";
}; };
in { in
{
"common/nix/access-tokens.conf" = secret "common/nix/access-tokens.conf"; "common/nix/access-tokens.conf" = secret "common/nix/access-tokens.conf";
}; };
### NixOS ### NixOS
nixpkgs = let nixpkgs =
let
config = { config = {
allowUnfree = true; allowUnfree = true;
allowInsecurePredicate = pkg: let allowInsecurePredicate =
pkg:
let
name = lib.getName pkg; name = lib.getName pkg;
in in
# HACK: Allow all insecure electron versions # HACK: Allow all insecure electron versions
name name == "electron"
== "electron"
# HACK: Some Matrix clients rely on libolm, which is deprecated # HACK: Some Matrix clients rely on libolm, which is deprecated
# https://github.com/NixOS/nixpkgs/pull/334638 # https://github.com/NixOS/nixpkgs/pull/334638
|| name == "cinny" || name == "cinny"
@ -31,13 +38,16 @@
|| name == "olm" || name == "olm"
|| name == "openssl"; # Cisco Packet Tracer || name == "openssl"; # Cisco Packet Tracer
}; };
in { in
{
inherit config; inherit config;
overlays = [ overlays = [
( (
final: prev: let final: prev:
nixpkgs = branch: let
nixpkgs =
branch:
import inputs."nixpkgs-${branch}" { import inputs."nixpkgs-${branch}" {
inherit config; inherit config;
system = prev.system; system = prev.system;
@ -47,7 +57,8 @@
unstable = nixpkgs "unstable"; unstable = nixpkgs "unstable";
staging-next = nixpkgs "staging-next"; staging-next = nixpkgs "staging-next";
local = nixpkgs "local"; local = nixpkgs "local";
in { in
{
# Overlay nixpkgs branches # Overlay nixpkgs branches
#?? nixpkgs.BRANCH.PACKAGE #?? nixpkgs.BRANCH.PACKAGE
inherit stable unstable staging-next; inherit stable unstable staging-next;

View file

@ -6,20 +6,23 @@
#?? nix run .#genflake flake.nix #?? nix run .#genflake flake.nix
# TODO: Remove flakegen hook when nix expressions are officially implemented # TODO: Remove flakegen hook when nix expressions are officially implemented
# https://github.com/NixOS/nix/issues/3966 # https://github.com/NixOS/nix/issues/3966
{ {
# https://wiki.nixos.org/wiki/Flakes # https://wiki.nixos.org/wiki/Flakes
# https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake.html # https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake.html
inputs = let inputs =
flake = url: {inherit url;}; let
follows = input: {inputs.${input}.follows = input;}; flake = url: { inherit url; };
stable = input: {inputs.${input}.follows = "${input}-stable";}; follows = input: { inputs.${input}.follows = input; };
unstable = input: {inputs.${input}.follows = "${input}-unstable";}; stable = input: { inputs.${input}.follows = "${input}-stable"; };
unstable = input: { inputs.${input}.follows = "${input}-unstable"; };
source = url: { source = url: {
inherit url; inherit url;
flake = false; flake = false;
}; };
in { in
{
#?? branch = "git+https://REPO?ref=BRANCH" #?? branch = "git+https://REPO?ref=BRANCH"
#?? commit = "git+https://REPO?ref=BRANCH&rev=COMMIT" #?? commit = "git+https://REPO?ref=BRANCH&rev=COMMIT"
#?? tag = "git+https://REPO?ref=refs/tags/TAG" #?? tag = "git+https://REPO?ref=refs/tags/TAG"
@ -59,17 +62,24 @@
fw-fanctrl = flake "github:TamtamHero/fw-fanctrl/packaging/nix" // unstable "nixpkgs"; fw-fanctrl = flake "github:TamtamHero/fw-fanctrl/packaging/nix" // unstable "nixpkgs";
hypridle = flake "github:hyprwm/hypridle" // unstable "nixpkgs"; hypridle = flake "github:hyprwm/hypridle" // unstable "nixpkgs";
#// hyprland = flake "git+https://github.com/hyprwm/Hyprland?submodules=1" // unstable "nixpkgs"; #// hyprland = flake "git+https://github.com/hyprwm/Hyprland?submodules=1" // unstable "nixpkgs";
hyprland = flake "git+https://github.com/hyprwm/Hyprland?ref=refs/tags/v0.43.0&submodules=1" // unstable "nixpkgs"; hyprland =
#// hyprland = flake "git+https://github.com/UjinT34/Hyprland?ref=vrr-cursor-fix&submodules=1" // unstable "nixpkgs"; flake "git+https://github.com/hyprwm/Hyprland?ref=refs/tags/v0.43.0&submodules=1"
// unstable "nixpkgs";
#// hyprland =
#// flake "git+https://github.com/UjinT34/Hyprland?ref=vrr-cursor-fix&submodules=1"
#// // unstable "nixpkgs";
hyprland-contrib = flake "github:hyprwm/contrib" // unstable "nixpkgs"; hyprland-contrib = flake "github:hyprwm/contrib" // unstable "nixpkgs";
hyprland-plugins = flake "github:hyprwm/hyprland-plugins" // unstable "nixpkgs" // follows "hyprland"; hyprland-plugins =
flake "github:hyprwm/hyprland-plugins" // unstable "nixpkgs" // follows "hyprland";
hyprlock = flake "github:hyprwm/hyprlock" // unstable "nixpkgs"; hyprlock = flake "github:hyprwm/hyprlock" // unstable "nixpkgs";
hyprpaper = flake "github:hyprwm/hyprpaper" // unstable "nixpkgs"; hyprpaper = flake "github:hyprwm/hyprpaper" // unstable "nixpkgs";
hyprpicker = flake "github:hyprwm/hyprpicker" // unstable "nixpkgs"; hyprpicker = flake "github:hyprwm/hyprpicker" // unstable "nixpkgs";
nix-flatpak = flake "github:gmodena/nix-flatpak?ref=v0.4.1"; nix-flatpak = flake "github:gmodena/nix-flatpak?ref=v0.4.1";
nix-vscode-extensions = flake "github:nix-community/nix-vscode-extensions" // unstable "nixpkgs"; nix-vscode-extensions = flake "github:nix-community/nix-vscode-extensions" // unstable "nixpkgs";
nixd = flake "github:nix-community/nixd" // unstable "nixpkgs"; nixd = flake "github:nix-community/nixd" // unstable "nixpkgs";
xdg-desktop-portal-hyprland = flake "github:hyprwm/xdg-desktop-portal-hyprland" // unstable "nixpkgs"; xdg-desktop-portal-hyprland =
flake "github:hyprwm/xdg-desktop-portal-hyprland"
// unstable "nixpkgs";
# Server flakes # Server flakes
conduwuit = flake "github:Myned/conduwuit" // unstable "nixpkgs"; conduwuit = flake "github:Myned/conduwuit" // unstable "nixpkgs";
@ -91,39 +101,38 @@
outputs = inputs: { outputs = inputs: {
# TODO: Use forAllSystems # TODO: Use forAllSystems
# FIXME: nixd always uses nixfmt when importing flakes
# https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-fmt # https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-fmt
# https://github.com/kamadorueda/alejandra/blob/main/STYLE.md formatter.x86_64-linux = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.nixfmt-rfc-style;
formatter.x86_64-linux = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.alejandra;
nixosConfigurations = let nixosConfigurations =
let
# TODO: Use inline modules instead of specialArgs # TODO: Use inline modules instead of specialArgs
# https://jade.fyi/blog/flakes-arent-real#nixos-modules # https://jade.fyi/blog/flakes-arent-real#nixos-modules
# Boilerplate systems with global imports # Boilerplate systems with global imports
#!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist #!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist
#?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ] #?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ]
common = branch: arch: modules: common =
branch: arch: modules:
inputs."nixpkgs-${branch}".lib.nixosSystem { inputs."nixpkgs-${branch}".lib.nixosSystem {
system = arch; system = arch;
specialArgs = {inherit inputs;};
specialArgs = {
inherit inputs;
};
# TODO: Clean up optional attributes with each new release # TODO: Clean up optional attributes with each new release
#!! Options will diverge between branches over time #!! Options will diverge between branches over time
#?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... }; #?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... };
modules = modules = modules ++ [
modules
++ [
./options ./options
./configuration.nix ./configuration.nix
#!! Avoid globally importing modules that are not guarded by .enable #!! Avoid globally importing modules that are not guarded by .enable
# https://github.com/NixOS/nixpkgs/issues/137168 # https://github.com/NixOS/nixpkgs/issues/137168
( (
{ config, inputs, ... }:
{ {
config,
inputs,
...
}: {
imports = [ imports = [
inputs."aagl-gtk-on-nix-${branch}".nixosModules.default inputs."aagl-gtk-on-nix-${branch}".nixosModules.default
inputs."home-manager-${branch}".nixosModules.home-manager inputs."home-manager-${branch}".nixosModules.home-manager
@ -146,16 +155,39 @@
#?? system = branch "ARCHITECTURE" [ MODULES ] #?? system = branch "ARCHITECTURE" [ MODULES ]
stable = arch: modules: common "stable" "${arch}-linux" modules; stable = arch: modules: common "stable" "${arch}-linux" modules;
unstable = arch: modules: common "unstable" "${arch}-linux" modules; unstable = arch: modules: common "unstable" "${arch}-linux" modules;
in { in
{
### Stable ### Stable
myarm = stable "aarch64" [./profiles/server ./machines/myarm]; myarm = stable "aarch64" [
myne = stable "x86_64" [./profiles/server ./machines/myne]; ./profiles/server
mypi3 = stable "aarch64" [./profiles/sbc ./machines/mypi3]; ./machines/myarm
];
myne = stable "x86_64" [
./profiles/server
./machines/myne
];
mypi3 = stable "aarch64" [
./profiles/sbc
./machines/mypi3
];
### Unstable ### Unstable
myeck = unstable "x86_64" [./profiles/console ./machines/myeck]; myeck = unstable "x86_64" [
mynix = unstable "x86_64" [./profiles/desktop ./machines/mynix]; ./profiles/console
myork = unstable "x86_64" [./profiles/laptop ./machines/myork]; ./machines/myeck
];
mynix = unstable "x86_64" [
./profiles/desktop
./machines/mynix
];
myork = unstable "x86_64" [
./profiles/laptop
./machines/myork
];
}; };
}; };
} }

View file

@ -21,7 +21,7 @@
size = "100%"; size = "100%";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = ["-f"]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
"/root" = { "/root" = {
mountpoint = "/"; mountpoint = "/";

View file

@ -7,17 +7,19 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
"virtio_scsi" "virtio_scsi"
"sr_mod" "sr_mod"
]; ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -19,5 +19,5 @@
}; };
}; };
systemd.tmpfiles.rules = ["z /mnt/external 0755 myned users"]; systemd.tmpfiles.rules = [ "z /mnt/external 0755 myned users" ];
} }

View file

@ -21,7 +21,7 @@
size = "100%"; size = "100%";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = ["-f"]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
"/root" = { "/root" = {
mountpoint = "/"; mountpoint = "/";

View file

@ -7,8 +7,10 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"nvme" "nvme"
@ -19,9 +21,9 @@
"sd_mod" "sd_mod"
"sdhci_pci" "sdhci_pci"
]; ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -26,7 +26,7 @@
size = "100%"; size = "100%";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = ["-f"]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
"/root" = { "/root" = {
mountpoint = "/"; mountpoint = "/";

View file

@ -7,8 +7,10 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"ahci" "ahci"
@ -18,9 +20,9 @@
"sd_mod" "sd_mod"
"sr_mod" "sr_mod"
]; ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -26,7 +26,7 @@
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = ["-f"]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
"/root" = { "/root" = {
mountpoint = "/"; mountpoint = "/";

View file

@ -7,8 +7,10 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
@ -19,9 +21,9 @@
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -4,9 +4,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
in { in
{
imports = [ imports = [
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
@ -32,7 +35,7 @@ in {
home-manager.users.${config.custom.username} = with lib; { home-manager.users.${config.custom.username} = with lib; {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
exec-once = ["${brightnessctl} set 0%"]; exec-once = [ "${brightnessctl} set 0%" ];
master = { master = {
mfact = mkForce 0.5; mfact = mkForce 0.5;

View file

@ -26,7 +26,7 @@
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = ["-f"]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
"/root" = { "/root" = {
mountpoint = "/"; mountpoint = "/";

View file

@ -7,8 +7,10 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"nvme" "nvme"
@ -18,9 +20,9 @@
"uas" "uas"
"sd_mod" "sd_mod"
]; ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,5 +1,5 @@
{ {
imports = [./hardware-configuration.nix]; imports = [ ./hardware-configuration.nix ];
custom.hostname = "mypi3"; custom.hostname = "mypi3";

View file

@ -7,20 +7,22 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules = []; {
boot.initrd.kernelModules = []; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.kernelModules = [];
boot.extraModulePackages = []; boot.initrd.availableKernelModules = [ ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = []; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,38 +1,38 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom; cfg = config.custom;
in { in
{
options.custom = { options.custom = {
### Profiles ### Profiles
default = mkOption {default = true;}; default = mkOption { default = true; };
full = mkOption {default = false;}; full = mkOption { default = false; };
minimal = mkOption {default = cfg.full;}; minimal = mkOption { default = cfg.full; };
profile = mkOption {}; profile = mkOption { };
### Users ### Users
domain = mkOption {default = "bjork.tech";}; domain = mkOption { default = "bjork.tech"; };
hostname = mkOption {}; hostname = mkOption { };
realname = mkOption {default = "Myned";}; realname = mkOption { default = "Myned"; };
username = mkOption {default = "myned";}; username = mkOption { default = "myned"; };
### Hardware ### Hardware
width = mkOption {default = 1920;}; width = mkOption { default = 1920; };
height = mkOption {default = 1080;}; height = mkOption { default = 1080; };
ultrawide = mkOption {default = cfg.width * 9 / 16 > cfg.height;}; # Wider than 16:9 ultrawide = mkOption { default = cfg.width * 9 / 16 > cfg.height; }; # Wider than 16:9
hidpi = mkOption {default = cfg.scale > 1;}; hidpi = mkOption { default = cfg.scale > 1; };
scale = mkOption {default = 1;}; scale = mkOption { default = 1; };
# TODO: Use option for border size # TODO: Use option for border size
border = mkOption {default = 2;}; border = mkOption { default = 2; };
gap = mkOption {default = 10;}; gap = mkOption { default = 10; };
padding = mkOption {default = 56;}; # ?? journalctl --user -u waybar.service | grep height: padding = mkOption { default = 56; }; # ?? journalctl --user -u waybar.service | grep height:
### Misc ### Misc
wallpaper = mkOption {default = false;}; wallpaper = mkOption { default = false; };
}; };
} }

View file

@ -1,8 +1,7 @@
{ config, lib, ... }:
with lib;
{ {
config,
lib,
...
}:
with lib; {
config.custom.desktops.hyprland.enable = config.custom.full; config.custom.desktops.hyprland.enable = config.custom.full;
} }

View file

@ -4,12 +4,16 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.desktops.gnome; cfg = config.custom.desktops.gnome;
in { in
{
options.custom.desktops.gnome = { options.custom.desktops.gnome = {
enable = mkOption {default = false;}; enable = mkOption { default = false; };
gdm = mkOption {default = true;}; gdm = mkOption { default = true; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -26,6 +30,6 @@ in {
# Remove default packages # Remove default packages
# https://wiki.nixos.org/wiki/GNOME#Excluding_GNOME_Applications # https://wiki.nixos.org/wiki/GNOME#Excluding_GNOME_Applications
environment.gnome.excludePackages = [pkgs.gnome-shell-extensions]; environment.gnome.excludePackages = [ pkgs.gnome-shell-extensions ];
}; };
} }

View file

@ -5,17 +5,27 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
clipse = "${pkgs.clipse}/bin/clipse"; clipse = "${pkgs.clipse}/bin/clipse";
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium"; codium = "${
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr"; config.home-manager.users.${config.custom.username}.programs.vscode.package
}/bin/codium";
firefox-esr = "${
config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage
}/bin/firefox-esr";
gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor"; gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor";
hyprctl = "${pkgs.hyprland}/bin/hyprctl"; hyprctl = "${pkgs.hyprland}/bin/hyprctl";
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock"; hyprlock = "${
config.home-manager.users.${config.custom.username}.programs.hyprlock.package
}/bin/hyprlock";
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker"; hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
jq = "${pkgs.jq}/bin/jq"; jq = "${pkgs.jq}/bin/jq";
kill = "${pkgs.procps}/bin/kill"; kill = "${pkgs.procps}/bin/kill";
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty"; kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
libreoffice = "${config.custom.programs.libreoffice.package}/bin/libreoffice";
loginctl = "${pkgs.systemd}/bin/loginctl"; loginctl = "${pkgs.systemd}/bin/loginctl";
nautilus = "${pkgs.nautilus}/bin/nautilus"; nautilus = "${pkgs.nautilus}/bin/nautilus";
networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu"; networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu";
@ -25,7 +35,6 @@ with lib; let
playerctl = "${pkgs.playerctl}/bin/playerctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw"; rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
sleep = "${pkgs.coreutils}/bin/sleep"; sleep = "${pkgs.coreutils}/bin/sleep";
steam = "${config.programs.steam.package}/bin/steam";
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client"; swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
systemctl = "${pkgs.systemd}/bin/systemctl"; systemctl = "${pkgs.systemd}/bin/systemctl";
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager"; virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
@ -33,206 +42,214 @@ with lib; let
wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi";
cfg = config.custom.desktops.hyprland.binds; cfg = config.custom.desktops.hyprland.binds;
in { in
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;}; {
options.custom.desktops.hyprland.binds.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = let wayland.windowManager.hyprland.settings = {
# Reverse mods and key for alphabetical sorting
#?? key <"KEY"> <"MODS"|null> <"DISPATCHER"> <"PARAMS"|null>
key = key: mods: dispatcher: params: "${
if (isNull mods)
then ""
else mods
}, ${key}, ${dispatcher}${
if (isNull params)
then ""
else ", ${params}"
}";
in {
# https://wiki.hyprland.org/Configuring/Binds # https://wiki.hyprland.org/Configuring/Binds
#?? bind = MODS, KEY, DISPATCHER, [PARAMS] #?? bind = MODS, KEY, DISPATCHER, [PARAMS]
#?? wev #?? wev
binds = {
allow_workspace_cycles = true;
disable_keybind_grabbing = true;
scroll_event_delay = 0;
};
# Lockscreen binds # Lockscreen binds
bindl = [ bindl = [
(key "Delete" "Ctrl" "exec" "${hyprctl} reload") ### System
(key "Delete" "Ctrl+Alt" "exec" "${loginctl} terminate-session ''") "CTRL, Delete, exec, ${hyprctl} reload"
(key "Delete" "Super" "exec" "inhibit") "CTRL+ALT, Delete, exec, ${loginctl} terminate-session ''"
(key "L" "Super" "exec" "${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off") "SUPER, L, exec, ${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off"
# Laptop lid switches # Laptop lid switches
# https://wiki.hyprland.org/Configuring/Binds/#switches # https://wiki.hyprland.org/Configuring/Binds/#switches
#?? hyprctl devices #?? hyprctl devices
(key "switch:off:Lid Switch" null "dpms" "on") # Open ", switch:on:Lid Switch, dpms, off" # Close
(key "switch:on:Lid Switch" null "dpms" "off") # Close ", switch:off:Lid Switch, dpms, on" # Open
### Scripts
"SUPER, Delete, exec, inhibit"
]; ];
# Mouse binds # Mouse binds
bindm = [ bindm = [
(key "mouse:272" "Super" "movewindow" null) # LMB "SUPER, mouse:272, movewindow" # LMB
(key "mouse:273" "Super" "resizewindow" null) # RMB "SUPER, mouse:273, resizewindow" # RMB
]; ];
# Repeat binds # Repeat binds
binde = [ binde = [
# Media keys # Media keys
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h # https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
(key "XF86AudioMute" null "exec" "${swayosd-client} --output-volume mute-toggle") # F1 ", XF86AudioMute, exec, ${swayosd-client} --output-volume mute-toggle"
(key "XF86AudioLowerVolume" null "exec" "${swayosd-client} --output-volume lower") # F2 ", XF86AudioLowerVolume, exec, ${swayosd-client} --output-volume lower"
(key "XF86AudioRaiseVolume" null "exec" "${swayosd-client} --output-volume raise") # F3 ", XF86AudioRaiseVolume, exec, ${swayosd-client} --output-volume raise"
(key "XF86AudioPrev" null "exec" "${playerctl} previous") # F4 ", XF86AudioPlay, exec, ${playerctl} play-pause"
(key "XF86AudioPlay" null "exec" "${playerctl} play-pause") # F5 ", XF86AudioPrev, exec, ${playerctl} previous"
(key "XF86AudioNext" null "exec" "${playerctl} next") # F6 ", XF86AudioNext, exec, ${playerctl} next"
(key "XF86MonBrightnessDown" null "exec" "${swayosd-client} --brightness lower") # F7 ", XF86MonBrightnessDown, exec, ${swayosd-client} --brightness lower"
(key "XF86MonBrightnessUp" null "exec" "${swayosd-client} --brightness raise") # F8 ", XF86MonBrightnessUp, exec, ${swayosd-client} --brightness raise"
(key "XF86AudioMedia" null "exec" "${notify-send} test") # F12
# TODO: Unused media key
#// ", XF86AudioMedia, exec, null"
]; ];
# Release binds # Release binds
bindr = [ bindr = [
(key "Alt_L" "Super+Alt" "togglespecialworkspace" "wallpaper") ### Layouts
(key "Control_L" "Super+Ctrl" "layoutmsg" "swapwithmaster master") "SUPER+CTRL, Control_L, layoutmsg, swapwithmaster master"
(key "Control_L" "Super+Ctrl+Alt+Shift" "layoutmsg" "removemaster") "SUPER+SHIFT+CTRL, Control_L, layoutmsg, addmaster"
(key "Control_L" "Super+Ctrl+Shift" "layoutmsg" "addmaster") "SUPER+SHIFT+CTRL+ALT, Control_L, layoutmsg, removemaster"
(key "Shift_L" "Super+Shift" "workspace" "previous")
(key "Super_L" "Super" "exec" "${pkill} wofi || ${wofi} --show drun") ### Workspaces
(key "Super_L" "Super+Alt" "exec" "${pkill} wofi || ${rofi-rbw}") "SUPER+SHIFT, Shift_L, workspace, previous"
(key "Super_L" "Super+Ctrl" "exec" "${pkill} wofi || calc")
(key "Super_L" "Super+Ctrl+Shift" "exec" "${pkill} wofi || ${networkmanager_dmenu}") # Special workspaces
(key "Super_L" "Super+Shift" "exec" "${pkill} wofi || ${wofi} --show run") "SUPER, Super_L, togglespecialworkspace, scratchpad"
"SUPER+SHIFT, Super_L, movetoworkspacesilent, special:scratchpad"
"SUPER+ALT, Alt_L, togglespecialworkspace, wallpaper"
]; ];
# Regular binds # Regular binds
bind = [ bind = [
(key "mouse:274" "Super" "layoutmsg" "swapwithmaster master") ### Scripts
(key "mouse:274" "Super+Shift" "layoutmsg" "addmaster") ", Print, exec, screenshot"
(key "mouse:274" "Super+Ctrl+Shift" "layoutmsg" "removemaster") "SHIFT, Print, exec, screenshot -d"
"SUPER, Print, exec, screenshot -e"
"SUPER+SHIFT, Print, exec, screenshot -ed"
"SUPER+SHIFT, Delete, exec, vrr"
"SUPER, Minus, exec, audio"
"SUPER, Equal, exec, audio Normalizer"
"SUPER+SHIFT, W, exec, vm -x ${if config.custom.hidpi then "/scale:140 +f" else ""}"
"SUPER+SHIFT+CTRL, W, exec, vm ${virt-manager} --connect qemu:///system --show-domain-console myndows"
"SUPER+SHIFT+CTRL, Q, exec, close" # Quit all windows
(key "Backslash" "Super" "layoutmsg" "orientationcenter") # BUG: Freezes window when toggled
(key "Backslash" "Super+Shift" "splitratio" "exact 0.5") # Reset layout ratio # https://github.com/hyprwm/Hyprland/issues/7609
(key "Backspace" "Super" "changegroupactive" "f") "CTRL, Space, exec, toggle dropdown special:dropdown ${kitty} --app-id dropdown --override font_size=12"
(key "Backspace" "Super+Ctrl" "togglegroup" null)
(key "Backspace" "Super+Ctrl+Shift" "lockactivegroup" "toggle") "CTRL+SHIFT, Space, exec, toggle pip special:pip"
(key "Backspace" "Super+Shift" "changegroupactive" "b")
(key "Bracketleft" "Super" "layoutmsg" "orientationprev")
(key "Bracketleft" "Super+Shift" "splitratio" "-0.1")
(key "Bracketright" "Super" "layoutmsg" "orientationnext")
(key "Bracketright" "Super+Shift" "splitratio" "+0.1")
# TODO: Toggle trackball hand # TODO: Toggle trackball hand
#// (key "Delete" "Super" "exec" "left") #// "SUPER, Delete, exec, left"
(key "Delete" "Super+Shift" "exec" "vrr") ### Applications
(key "Down" "Super" "movewindoworgroup" "d") "SUPER, B, exec, [tag +browser] ${firefox-esr}"
(key "Equal" "Super" "exec" "audio Normalizer") "SUPER, C, exec, ${codium}"
(key "Escape" "Super" "togglefloating" null) "SUPER, E, exec, ${gnome-text-editor}"
(key "Escape" "Super+Alt" "exec" "lifx state --color red") "SUPER, F, exec, ${nautilus}"
(key "Escape" "Super+Shift" "centerwindow" null) "SUPER, K, exec, ${obsidian}"
(key "Left" "Super" "movewindoworgroup" "l") "SUPER, O, exec, ${libreoffice}"
(key "Minus" "Super" "exec" "audio") "SUPER, P, exec, ${hyprpicker} --autocopy"
(key "Print" "Shift" "exec" "screenshot -d") "SUPER+SHIFT, P, exec, ${hyprpicker} --autocopy --format rgb"
(key "Print" "Super" "exec" "screenshot -e") "SUPER+CTRL, T, exec, ${kitty}"
(key "Print" "Super+Shift" "exec" "screenshot -ed") "SUPER+SHIFT+CTRL, T, exec, ${pkill} kitty"
(key "Print" null "exec" "screenshot") "SUPER, V, exec, ${kitty} --app-id clipboard --override font_size=12 ${clipse}"
(key "Return" "Super" "fullscreen" "1") # Maximize "SUPER+SHIFT, V, exec, ${clipse} -clear && ${notify-send} clipse 'Clipboard cleared' --urgency low"
(key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen "SUPER, Space, exec, ${pkill} wofi || ${wofi} --show drun"
(key "Right" "Super" "movewindoworgroup" "r") "SUPER+SHIFT, Space, exec, ${pkill} wofi || ${wofi} --show run"
(key "Space" "Ctrl" "exec" (concatStringsSep " " [ "SUPER+CTRL, Space, exec, ${pkill} wofi || calc"
"toggle" "SUPER+ALT, Space, exec, ${pkill} wofi || ${rofi-rbw}"
"--focus" "SUPER+SHIFT+CTRL, Space, exec, ${pkill} wofi || ${networkmanager_dmenu}"
"--type class"
"--expression '^dropdown$'"
"--workspace special:dropdown"
"--"
"${kitty} --app-id dropdown --override font_size=12"
]))
(key "Space" "Ctrl+Alt" "exec" "lifx toggle")
(key "Space" "Ctrl+Shift" "exec" (concatStringsSep " " [
"toggle"
"--type title"
"--expression '^Picture.in.[Pp]icture$'"
"--workspace special:pip"
]))
(key "Space" "Super" "togglespecialworkspace" "scratchpad")
(key "Space" "Super+Ctrl" "movetoworkspacesilent" "special:scratchpad")
(key "Tab" "Super" "cyclenext" "tiled")
(key "Tab" "Super+Shift" "alterzorder" "top")
(key "Tab" "Super+Shift" "cyclenext" "floating")
(key "Up" "Super" "movewindoworgroup" "u")
(key "0" "Super" "workspace" "10") # Kill applications
(key "0" "Super+Ctrl" "movetoworkspacesilent" "10") "SUPER, Q, killactive"
(key "1" "Ctrl+Alt" "exec" "lifx state --brightness 0.01") "SUPER+SHIFT, Q, exec, ${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)"
(key "1" "Super" "workspace" "1") "SUPER+SHIFT, A, exec, ${waydroid} session stop"
(key "1" "Super+Alt" "exec" "lifx state --kelvin 1500") "SUPER+SHIFT, S, exec, ${pkill} steam"
(key "1" "Super+Ctrl" "movetoworkspacesilent" "1") "SUPER+SHIFT+CTRL, G, exec, ${pkill} gamescope"
(key "2" "Ctrl+Alt" "exec" "lifx state --brightness 0.25")
(key "2" "Super" "workspace" "2") # LIFX
(key "2" "Super+Alt" "exec" "lifx state --kelvin 2500") "SUPER+ALT, Escape, exec, lifx state --color red"
(key "2" "Super+Ctrl" "movetoworkspacesilent" "2") "SUPER+ALT, 1, exec, lifx state --kelvin 1500"
(key "3" "Ctrl+Alt" "exec" "lifx state --brightness 0.50") "SUPER+ALT, 2, exec, lifx state --kelvin 2500"
(key "3" "Super" "workspace" "3") "SUPER+ALT, 3, exec, lifx state --kelvin 3000"
(key "3" "Super+Alt" "exec" "lifx state --kelvin 3000") "SUPER+ALT, 4, exec, lifx state --kelvin 4000"
(key "3" "Super+Ctrl" "movetoworkspacesilent" "3") "SUPER+ALT, 5, exec, lifx state --kelvin 5000"
(key "4" "Ctrl+Alt" "exec" "lifx state --brightness 0.75") "CTRL+ALT, 1, exec, lifx state --brightness 0.01"
(key "4" "Super" "workspace" "4") "CTRL+ALT, 2, exec, lifx state --brightness 0.25"
(key "4" "Super+Alt" "exec" "lifx state --kelvin 4000") "CTRL+ALT, 3, exec, lifx state --brightness 0.50"
(key "4" "Super+Ctrl" "movetoworkspacesilent" "4") "CTRL+ALT, 4, exec, lifx state --brightness 0.75"
(key "5" "Ctrl+Alt" "exec" "lifx state --brightness 1.00") "CTRL+ALT, 5, exec, lifx state --brightness 1.00"
(key "5" "Super" "workspace" "5") "CTRL+ALT, Space, exec, lifx toggle"
(key "5" "Super+Alt" "exec" "lifx state --kelvin 5000")
(key "5" "Super+Ctrl" "movetoworkspacesilent" "5") ### Windows
(key "6" "Super" "workspace" "6") "SUPER, Escape, togglefloating"
(key "6" "Super+Ctrl" "movetoworkspacesilent" "6") "SUPER+SHIFT, Escape, centerwindow"
(key "7" "Super" "workspace" "7") "SUPER, Return, fullscreen, 1" # Maximize
(key "7" "Super+Ctrl" "movetoworkspacesilent" "7") "SUPER+SHIFT, Return, fullscreen, 0" # Fullscreen
(key "8" "Super" "workspace" "8") "SUPER, Tab, cyclenext, tiled"
(key "8" "Super+Ctrl" "movetoworkspacesilent" "8")
(key "9" "Super" "workspace" "9") # FIXME: Handle hover focus and zorder
(key "9" "Super+Ctrl" "movetoworkspacesilent" "9") "SUPER+SHIFT, Tab, cyclenext, floating"
(key "A" "Ctrl+Alt" "exec" "${waydroid} session stop") "SUPER+SHIFT, Tab, alterzorder, top"
(key "A" "Super" "togglespecialworkspace" "android")
(key "A" "Super+Ctrl" "movetoworkspacesilent" "android") ### Groups
(key "B" "Super" "exec" "[group new lock; tile] ${firefox-esr}") "SUPER, Backspace, changegroupactive, f"
(key "C" "Super" "exec" codium) "SUPER+SHIFT, Backspace, changegroupactive, b"
(key "E" "Super" "exec" gnome-text-editor) "SUPER+CTRL, Backspace, togglegroup"
(key "F" "Super" "exec" nautilus) "SUPER+SHIFT+CTRL, Backspace, lockactivegroup, toggle"
(key "G" "Super" "workspace" "name:game") "SUPER, Up, movewindoworgroup, u"
(key "G" "Super+Alt" "workspace" "name:gamescope") "SUPER, Down, movewindoworgroup, d"
(key "G" "Super+Ctrl" "movetoworkspacesilent" "name:game") "SUPER, Left, movewindoworgroup, l"
(key "G" "Super+Ctrl+Alt" "exec" "${pkill} gamescope") "SUPER, Right, movewindoworgroup, r"
(key "K" "Super" "exec" obsidian)
(key "M" "Super" "togglespecialworkspace" "music") ### Layouts
(key "M" "Super+Ctrl" "movetoworkspacesilent" "music") "SUPER, mouse:274, layoutmsg, swapwithmaster master"
(key "O" "Super" "togglespecialworkspace" "office") "SUPER+SHIFT, mouse:274, layoutmsg, addmaster"
(key "P" "Super" "exec" "${hyprpicker} --autocopy") "SUPER+SHIFT+CTRL, mouse:274, layoutmsg, removemaster"
(key "P" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb") "SUPER, Bracketleft, layoutmsg, orientationprev"
(key "Q" "Ctrl+Alt" "exec" "${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)") "SUPER, Bracketright, layoutmsg, orientationnext"
(key "Q" "Ctrl+Alt+Shift" "exec" "close") # Quit all windows "SUPER, Backslash, layoutmsg, orientationcenter"
(key "Q" "Super" "killactive" null) "SUPER+SHIFT, Backslash, splitratio, exact 0.5" # Reset layout ratio
(key "S" "Ctrl+Alt" "exec" "${pkill} steam") "SUPER+SHIFT, Bracketleft, splitratio, -0.1"
(key "S" "Super" "togglespecialworkspace" "steam") "SUPER+SHIFT, Bracketright, splitratio, +0.1"
(key "S" "Super+Ctrl" "movetoworkspacesilent" "steam")
(key "S" "Super+Shift" "exec" steam) ### Workspaces
(key "T" "Ctrl+Alt" "exec" "${pkill} kitty") "SUPER, 1, workspace, 1"
(key "T" "Super" "togglespecialworkspace" "terminal") "SUPER+SHIFT, 1, movetoworkspacesilent, 1"
(key "T" "Super+Ctrl" "movetoworkspacesilent" "terminal") "SUPER, 2, workspace, 2"
(key "T" "Super+Shift" "exec" kitty) "SUPER+SHIFT, 2, movetoworkspacesilent, 2"
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}") "SUPER, 3, workspace, 3"
(key "V" "Super+Shift" "exec" "${clipse} -clear && ${notify-send} clipse 'Clipboard cleared' --urgency low") "SUPER+SHIFT, 3, movetoworkspacesilent, 3"
(key "W" "Super" "togglespecialworkspace" "vm") "SUPER, 4, workspace, 4"
(key "W" "Super+Shift" "exec" "vm -x ${ "SUPER+SHIFT, 4, movetoworkspacesilent, 4"
if config.custom.hidpi "SUPER, 5, workspace, 5"
then "/scale:140 +f" "SUPER+SHIFT, 5, movetoworkspacesilent, 5"
else "" "SUPER, 6, workspace, 6"
}") "SUPER+SHIFT, 6, movetoworkspacesilent, 6"
(key "W" "Super+Ctrl" "movetoworkspacesilent" "vm") "SUPER, 7, workspace, 7"
(key "W" "Super+Ctrl+Shift" "exec" "vm ${virt-manager} --show-domain-console myndows") "SUPER+SHIFT, 7, movetoworkspacesilent, 7"
(key "X" "Super" "workspace" "+1") "SUPER, 8, workspace, 8"
(key "X" "Super+Ctrl" "movetoworkspacesilent" "+1") "SUPER+SHIFT, 8, movetoworkspacesilent, 8"
(key "Z" "Super" "workspace" "-1") "SUPER, 9, workspace, 9"
(key "Z" "Super+Ctrl" "movetoworkspacesilent" "-1") "SUPER+SHIFT, 9, movetoworkspacesilent, 9"
"SUPER, 0, workspace, 10"
"SUPER+SHIFT, 0, movetoworkspacesilent, 10"
"SUPER, Z, workspace, -1"
"SUPER+SHIFT, Z, movetoworkspacesilent, -1"
"SUPER, X, workspace, +1"
"SUPER+SHIFT, X, movetoworkspacesilent, +1"
# Named workspaces
"SUPER, G, workspace, name:game"
"SUPER+SHIFT, G, movetoworkspacesilent, name:game"
"SUPER+CTRL, G, workspace, name:gamescope"
# Special workspaces
"SUPER, A, togglespecialworkspace, android"
"SUPER+SHIFT, A, movetoworkspacesilent, android"
"SUPER, M, togglespecialworkspace, music"
"SUPER+SHIFT, M, movetoworkspacesilent, music"
"SUPER, S, togglespecialworkspace, steam"
"SUPER+SHIFT, S, movetoworkspacesilent, steam"
"SUPER, T, togglespecialworkspace, terminal"
"SUPER+SHIFT, T, movetoworkspacesilent, terminal"
"SUPER, W, togglespecialworkspace, vm"
"SUPER+SHIFT, W, movetoworkspacesilent, vm"
]; ];
}; };
}; };

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.desktops.hyprland; cfg = config.custom.desktops.hyprland;
in { in
options.custom.desktops.hyprland.enable = mkOption {default = false;}; {
options.custom.desktops.hyprland.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
custom.desktops.hyprland = mkIf config.custom.full { custom.desktops.hyprland = mkIf config.custom.full {
@ -22,7 +26,7 @@ in {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = [pkgs.xdg-desktop-portal-gtk]; extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# Prefer hyprland over gtk portal # Prefer hyprland over gtk portal
config.common.default = [ config.common.default = [
@ -34,7 +38,7 @@ in {
# https://wiki.hyprland.org # https://wiki.hyprland.org
home-manager.users.${config.custom.username}.wayland.windowManager.hyprland = { home-manager.users.${config.custom.username}.wayland.windowManager.hyprland = {
enable = true; enable = true;
systemd.variables = ["--all"]; # Import some environment variables into session systemd.variables = [ "--all" ]; # Import some environment variables into session
}; };
}; };
} }

View file

@ -4,18 +4,22 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
hyprctl = "${pkgs.hyprland}/bin/hyprctl"; hyprctl = "${pkgs.hyprland}/bin/hyprctl";
cfg = config.custom.desktops.hyprland.plugins; cfg = config.custom.desktops.hyprland.plugins;
in { in
options.custom.desktops.hyprland.plugins.enable = mkOption {default = false;}; {
options.custom.desktops.hyprland.plugins.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
# https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars # https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars
# https://wiki.hyprland.org/Plugins/Using-Plugins # https://wiki.hyprland.org/Plugins/Using-Plugins
plugins = with pkgs.hyprlandPlugins; [hyprbars]; plugins = with pkgs.hyprlandPlugins; [ hyprbars ];
settings = { settings = {
#!! Static rules #!! Static rules

View file

@ -4,20 +4,22 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
gamescope = "${config.programs.gamescope.package}/bin/gamescope"; gamescope = "${config.programs.gamescope.package}/bin/gamescope";
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
libreoffice = "${config.custom.programs.libreoffice.package}/bin/libreoffice";
loupe = "${pkgs.loupe}/bin/loupe"; loupe = "${pkgs.loupe}/bin/loupe";
pgrep = "${pkgs.procps}/bin/pgrep";
steam = "${config.programs.steam.package}/bin/steam"; steam = "${config.programs.steam.package}/bin/steam";
virt-manager = "${pkgs.virt-manager}/bin/virt-manager"; virt-manager = "${pkgs.virt-manager}/bin/virt-manager";
waydroid = "${pkgs.waydroid}/bin/waydroid"; waydroid = "${pkgs.waydroid}/bin/waydroid";
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
youtube-music = "${pkgs.youtube-music}/bin/youtube-music"; youtube-music = "${pkgs.youtube-music}/bin/youtube-music";
cfg = config.custom.desktops.hyprland.rules; cfg = config.custom.desktops.hyprland.rules;
in { in
options.custom.desktops.hyprland.rules.enable = mkOption {default = false;}; {
options.custom.desktops.hyprland.rules.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
@ -28,16 +30,51 @@ in {
"special:android, on-created-empty:${waydroid} app launch com.YoStarEN.Arknights" "special:android, on-created-empty:${waydroid} app launch com.YoStarEN.Arknights"
"special:music, on-created-empty:${youtube-music}" "special:music, on-created-empty:${youtube-music}"
"special:office, on-created-empty:${libreoffice}"
"special:steam, on-created-empty:${steam}" "special:steam, on-created-empty:${steam}"
"special:terminal, on-created-empty:${kitty}" "special:terminal, on-created-empty:${kitty}"
"special:vm, on-created-empty:${pgrep} -x vm || ${virt-manager}"
"special:wallpaper, on-created-empty:[tile] ${loupe} /tmp/wallpaper.png" "special:wallpaper, on-created-empty:[tile] ${loupe} /tmp/wallpaper.png"
]; ];
# https://wiki.hyprland.org/Configuring/Window-Rules # https://wiki.hyprland.org/Configuring/Window-Rules
#?? windowrulev2 = RULE, WINDOW #?? windowrulev2 = RULE, WINDOW
windowrulev2 = with config.custom; let windowrulev2 =
with config.custom;
let
# Return hypr-formatted string, converting booleans into 0/1
format =
field: expr:
"${field}:${
toString (
if expr == true then
1
else if expr == false then
0
else
expr
)
}";
# Generate hypr-formatted window rules
#?? merge <FIELD|{FIELDS}> <EXPRESSION> <RULES>
merge =
field: expr: rules:
map (
rule:
if builtins.isAttrs field then
"${rule}, ${lib.concatStringsSep ", " (lib.mapAttrsToList (f: e: format f e) field)}"
else
"${rule}, ${format field expr}"
) rules;
class = expr: rules: merge "class" "^${expr}$" rules;
floating = expr: rules: merge "floating" expr rules;
fullscreen = expr: rules: merge "fullscreen" expr rules;
pinned = expr: rules: merge "pinned" expr rules;
tag = expr: rules: merge "tag" expr rules;
title = expr: rules: merge "title" "^${expr}$" rules;
fields = fields: rules: merge fields null rules;
### Hardware-dependent rules ### Hardware-dependent rules
# Convert truncated float to string # Convert truncated float to string
tr = num: toString (builtins.floor num); tr = num: toString (builtins.floor num);
@ -54,16 +91,7 @@ in {
dropdown = rec { dropdown = rec {
x = tr (width / scale / 2 - (toInt w) / 2); x = tr (width / scale / 2 - (toInt w) / 2);
y = tr (height / scale - (toInt h) - gap - border - padding); y = tr (height / scale - (toInt h) - gap - border - padding);
w = tr (width w = tr (width / scale * (if ultrawide then 0.5 else 1) - gap - gap / 2 + 1);
/ scale
* (
if ultrawide
then 0.5
else 1
)
- gap
- gap / 2
+ 1);
h = tr (height / scale * 0.2 * scale); h = tr (height / scale * 0.2 * scale);
}; };
@ -74,147 +102,174 @@ in {
w = tr (width / scale * 0.25 - gap - gap + 1); w = tr (width / scale * 0.25 - gap - gap + 1);
h = tr ((toInt w) * 9 / 16); # 16:9 aspect ratio h = tr ((toInt w) * 9 / 16); # 16:9 aspect ratio
}; };
### Rules
# Return hypr-formatted string, converting booleans into 0/1
format = field: expr: "${field}:${
toString (
if expr == true
then 1
else if expr == false
then 0
else expr
)
}";
# Generate hypr-formatted window rules
#?? merge <FIELD|{FIELDS}> <EXPRESSION> <RULES>
merge = field: expr: rules:
map (
rule:
if builtins.isAttrs field
then "${rule}, ${lib.concatStringsSep ", " (lib.mapAttrsToList (f: e: format f e) field)}"
else "${rule}, ${format field expr}"
)
rules;
class = expr: rules: merge "class" "^${expr}$" rules;
floating = expr: rules: merge "floating" expr rules;
fullscreen = expr: rules: merge "fullscreen" expr rules;
pinned = expr: rules: merge "pinned" expr rules;
title = expr: rules: merge "title" "^${expr}$" rules;
fields = fields: rules: merge fields null rules;
### Pseudo-tags
# Wrap generated rules in Nix categories
tag = {
android = rules: [
(class "waydroid.*" rules)
];
clipboard = rules: [
(class "clipboard" rules)
];
dropdown = rules: [
(class "dropdown" rules)
];
editor = rules: [
(class "codium-url-handler" rules) # VSCode
(class "obsidian" (rules ++ ["group barred"]))
];
files = rules: [
(class "org\\.gnome\\.Nautilus" rules)
];
game = rules: [
(class "moe\\.launcher\\.the-honkers-railway-launcher" (rules ++ ["size 1280 730"])) # Honkai: Star Rail
(class "steam_app_.+" rules) # Proton
];
music = rules: [
(class "Spotify" rules)
(class "YouTube Music" rules)
(title "Spotify Premium" rules)
];
office = rules: [
(class "libreoffice.+" rules)
];
pip = rules: [
(title "Picture.in.[Pp]icture" rules)
];
social = rules: [
(class "cinny" rules)
(class "discord" rules)
(class "Element" rules)
(class "org\\.telegram\\.desktop" rules)
];
steam = rules: [
(class "SDL Application" rules) # Steam
(class "steam" rules)
];
terminal = rules: [
(class "foot" rules)
(class "kitty" rules)
(class "org\\.wezfurlong\\.wezterm" rules)
];
vm = rules: [
(class "(sdl-|wl|x)freerdp" (rules ++ ["nomaxsize" "tile"]))
(class "virt-manager" rules)
];
wine = rules: [
(class ".*\\.(exe|x86_64)" rules) # Wine
];
};
in in
flatten [ flatten [
### Defaults ### Defaults
(class ".*" ["float" "suppressevent maximize" "syncfullscreen"]) (class ".*" [
(floating true ["bordercolor rgb(073642)"]) "center"
(fullscreen true ["idleinhibit focus"]) "float"
(pinned true ["bordercolor rgb(073642) rgb(073642)"]) "suppressevent maximize"
"syncfullscreen"
])
(floating true [
"bordercolor rgb(073642)"
"workspace special:scratchpad"
])
(fullscreen true [ "idleinhibit focus" ])
(pinned true [ "bordercolor rgb(073642) rgb(073642)" ])
(tag.android ["tile" "workspace special:android"]) # TODO: Convert to nix variables instead of tags
(tag.clipboard ["move ${clipboard.x} ${clipboard.y}" "pin" "size ${clipboard.w} ${clipboard.h}" "stayfocused"]) ### Tags
(tag.dropdown ["move ${dropdown.x} ${dropdown.y}" "pin" "size ${dropdown.w} ${dropdown.h}"]) (tag "android" [
(tag.editor ["group invade" "tile"]) "tile"
(tag.files ["size 1000 625"]) "workspace special:android"
(tag.game ["group barred" "idleinhibit always" "noborder" "noshadow" "renderunfocused" "workspace name:game"]) ])
(tag.music ["tile" "workspace special:music"]) (tag "browser" [
(tag.office ["tile" "workspace special:office"]) "group new lock"
(tag.pip ["keepaspectratio" "move ${pip.x} ${pip.y}" "pin" "size ${pip.w} ${pip.h}"]) "tile"
(tag.social ["group" "tile"]) "workspace unset"
(tag.steam ["workspace special:steam"]) ])
(tag.terminal ["tile"]) (tag "clipboard" [
(tag.vm ["workspace special:vm"]) "move ${clipboard.x} ${clipboard.y}"
(tag.wine ["noborder" "noshadow"]) "pin"
"size ${clipboard.w} ${clipboard.h}"
"stayfocused"
])
(tag "dropdown" [
"move ${dropdown.x} ${dropdown.y}"
"pin"
"size ${dropdown.w} ${dropdown.h}"
"workspace special:dropdown"
])
(tag "editor" [
"group invade"
"tile"
"workspace unset"
])
(tag "files" [
"size 1000 625"
])
(tag "game" [
"group barred"
"idleinhibit always"
"noborder"
"noshadow"
"renderunfocused"
"workspace name:game"
])
(tag "music" [
"tile"
"workspace special:music"
])
(tag "pip" [
"keepaspectratio"
"move ${pip.x} ${pip.y}"
"pin"
"size ${pip.w} ${pip.h}"
])
(tag "social" [
"group"
"tile"
"workspace unset"
])
(tag "steam" [ "workspace special:steam" ])
(tag "terminal" [
"tile"
"workspace unset"
])
(tag "vm" [ "workspace special:vm" ])
(tag "wine" [
"noborder"
"noshadow"
])
### Applications
(class ".*\\.(exe|x86_64)" [ "tag +wine" ]) # Wine
(class "(sdl-|wl|x)freerdp" [
"nomaxsize"
"tag +vm"
"tile"
])
(class "cinny" [ "tag +social" ])
(class "clipboard" [ "tag +clipboard" ])
(class "codium-url-handler" [ "tag +editor" ]) # VSCode
(class "discord" [ "tag +social" ])
(class "dropdown" [ "tag +dropdown" ])
(class "Element" [ "tag +social" ])
(class "foot" [ "tag +terminal" ])
(class "kitty" [ "tag +terminal" ])
(class "libreoffice.+" [
"tile"
"workspace unset"
])
(class "moe\\.launcher\\.the-honkers-railway-launcher" [
"size 1280 730"
"tag +game"
])
(class "obsidian" [
"group barred"
"tag +editor"
])
(class "org\\.gnome\\.Nautilus" [ "tag +files" ])
(class "org\\.telegram\\.desktop" [ "tag +social" ])
(class "org\\.wezfurlong\\.wezterm" [ "tag +terminal" ])
(class "SDL Application" [ "tag +steam" ]) # Steam
(class "Spotify" [ "tag +music" ])
(class "steam_app_1473350" [ "workspace 0" ]) # (the) Gnorp Apologue
(class "steam" [ "tag +steam" ])
(class "steam_app_.+" [ "tag +game" ]) # Proton
(class "Tap Wizard 2.x86_64" [ "workspace 0" ])
(class "virt-manager" [ "tag +vm" ])
(class "waydroid.*" [ "tag +android" ])
(class "YouTube Music" [ "tag +music" ])
(title "Picture.in.[Pp]icture" [ "tag +pip" ])
(title "Spotify Premium" [ "tag +music" ])
### Overrides ### Overrides
(class "steam_app_1473350" ["workspace 0"]) # (the) Gnorp Apologue
(class "Tap Wizard 2.x86_64" ["workspace 0"])
#!! Expressions are not wrapped in ^$ #!! Expressions are not wrapped in ^$
(fields { (fields
class = "^com\\.github\\.wwmm\\.easyeffects$"; {
title = "^Easy Effects$"; # Main window
} ["size 50% 50%"])
(fields {
class = "^discord$";
title = "^Discord Updater$"; # Update dialog
} ["float" "nofocus"])
(fields {
class = "^lutris$"; class = "^lutris$";
title = "^Lutris$"; # Main window title = "^Lutris$";
} ["center" "size 1000 500"]) }
[
"center"
"size 1000 500"
]
)
(fields { (fields {
class = "^steam$"; tag = "steam";
title = "^notificationtoasts$"; # Steam notifications title = "^notificationtoasts$";
} []) } [ "workspace unset" ])
(fields { (fields {
class = "^steam$"; tag = "steam";
title = "^Steam$"; # Main window title = "^Steam$";
} ["tile"]) } [ "tile" ])
(fields
{
class = "^com\\.github\\.wwmm\\.easyeffects$";
title = "^Easy Effects$";
}
[
"size 50% 50%"
]
)
(fields
{
class = "^discord$";
title = "^Discord Updater$";
}
[
"float"
"nofocus"
]
)
(fields { (fields {
class = "^virt-manager$"; class = "^virt-manager$";
title = "^.+on QEMU/KVM$"; # VM window title = "^.+on QEMU/KVM$";
} ["tile"]) } [ "tile" ])
]; ];
}; };
}; };

View file

@ -4,7 +4,10 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
clipse = "${pkgs.clipse}/bin/clipse"; clipse = "${pkgs.clipse}/bin/clipse";
firefox-esr = "${ firefox-esr = "${
config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage
@ -19,8 +22,9 @@ with lib; let
}/bin/waybar"; }/bin/waybar";
cfg = config.custom.desktops.hyprland.settings; cfg = config.custom.desktops.hyprland.settings;
in { in
options.custom.desktops.hyprland.settings.enable = mkOption {default = false;}; {
options.custom.desktops.hyprland.settings.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
@ -47,14 +51,12 @@ in {
#?? envd = VARIABLE, VALUE #?? envd = VARIABLE, VALUE
# HACK: Mapped home-manager variables to envd in lieu of upstream fix # HACK: Mapped home-manager variables to envd in lieu of upstream fix
# https://github.com/nix-community/home-manager/issues/2659 # https://github.com/nix-community/home-manager/issues/2659
envd = with builtins; envd =
attrValues with builtins;
( attrValues (
mapAttrs mapAttrs (
(
name: value: "${name}, ${toString value}" name: value: "${name}, ${toString value}"
) ) config.home-manager.users.${config.custom.username}.home.sessionVariables
config.home-manager.users.${config.custom.username}.home.sessionVariables
) )
++ [ ++ [
"EDITOR, gnome-text-editor" "EDITOR, gnome-text-editor"
@ -64,8 +66,7 @@ in {
#// exec = [ ]; #// exec = [ ];
# https://wiki.hyprland.org/Configuring/Keywords/#executing # https://wiki.hyprland.org/Configuring/Keywords/#executing
exec-once = exec-once = [
[
"${rm} ~/.config/qalculate/qalc.dmenu.history" # Clear calc history "${rm} ~/.config/qalculate/qalc.dmenu.history" # Clear calc history
"${clipse} -clear" # Clear clipboard history "${clipse} -clear" # Clear clipboard history
"${clipse} -listen" # Monitor clipboard "${clipse} -listen" # Monitor clipboard
@ -75,9 +76,8 @@ in {
# https://github.com/Alexays/Waybar/issues/2882 # https://github.com/Alexays/Waybar/issues/2882
"${sleep} 2 && ${systemctl} --user restart waybar" "${sleep} 2 && ${systemctl} --user restart waybar"
"[group new lock; tile] ${firefox-esr}" "[tag +browser] ${firefox-esr}"
] ] ++ optionals config.custom.wallpaper [ "wallpaper" ];
++ optionals config.custom.wallpaper ["wallpaper"];
# https://wiki.hyprland.org/Configuring/Variables/#xwayland # https://wiki.hyprland.org/Configuring/Variables/#xwayland
xwayland = { xwayland = {
@ -112,9 +112,9 @@ in {
#?? animation = NAME, ONOFF, SPEED, CURVE, [STYLE] #?? animation = NAME, ONOFF, SPEED, CURVE, [STYLE]
animation = [ animation = [
"global, 1, 5, default" "global, 1, 5, default"
"specialWorkspace, 1, 5, default, fade"
"windows, 1, 5, default, slide" "windows, 1, 5, default, slide"
"layers, 0" "layers, 1, 5, default, slide"
"specialWorkspace, 1, 5, default, fade"
]; ];
# https://wiki.hyprland.org/Configuring/Variables/#decoration # https://wiki.hyprland.org/Configuring/Variables/#decoration
@ -142,10 +142,7 @@ in {
"col.inactive" = "rgba(6c71c440)"; "col.inactive" = "rgba(6c71c440)";
"col.locked_active" = "rgb(d33682)"; "col.locked_active" = "rgb(d33682)";
"col.locked_inactive" = "rgba(d3368240)"; "col.locked_inactive" = "rgba(d3368240)";
font_size = font_size = if config.custom.hidpi then 16 else 10;
if config.custom.hidpi
then 16
else 10;
height = 5; height = 5;
render_titles = false; render_titles = false;
text_color = "rgb(93a1a1)"; text_color = "rgb(93a1a1)";
@ -169,22 +166,13 @@ in {
#// vrr = 2; # VRR in fullscreen #// vrr = 2; # VRR in fullscreen
}; };
# https://wiki.hyprland.org/Configuring/Variables/#binds
binds = {
allow_workspace_cycles = true;
disable_keybind_grabbing = true;
ignore_group_lock = true;
scroll_event_delay = 0;
};
# https://wiki.hyprland.org/Configuring/Variables/#input # https://wiki.hyprland.org/Configuring/Variables/#input
input = { input = {
accel_profile = "flat"; accel_profile = "flat";
float_switch_override_focus = 0; # Disable float to tile hover focus float_switch_override_focus = 0; # Disable float to tile hover focus
focus_on_close = 1; # Focus window under mouse
follow_mouse = 1; # Hover focus follow_mouse = 1; # Hover focus
mouse_refocus = false; mouse_refocus = false;
repeat_delay = 300; repeat_delay = 400;
repeat_rate = 40; repeat_rate = 40;
sensitivity = 0.5; sensitivity = 0.5;
#// scroll_factor = 0.75; #// scroll_factor = 0.75;
@ -218,9 +206,6 @@ in {
# https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs # https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs
#?? device = { name = NAME ... } #?? device = { name = NAME ... }
# https://wiki.hyprland.org/Configuring/Variables/#custom-accel-profiles
# https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile
#?? custom <STEP> <POINTS...>
# TODO: Combine same devices # TODO: Combine same devices
# FIXME: Hotplugging may result in different id # FIXME: Hotplugging may result in different id
device = [ device = [
@ -244,8 +229,8 @@ in {
{ {
name = "logitech-m570"; name = "logitech-m570";
accel_profile = "custom 1 0 1 3"; accel_profile = "adaptive";
sensitivity = -0.1; sensitivity = -0.9;
} }
{ {

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib,
...
}:
with lib; let
cfg = config.custom.desktops.kde;
in {
options.custom.desktops.kde.enable = mkOption {default = false;};
config = mkIf cfg.enable {services.desktopManager.plasma6.enable = true;}; with lib;
let
cfg = config.custom.desktops.kde;
in
{
options.custom.desktops.kde.enable = mkOption { default = false; };
config = mkIf cfg.enable { services.desktopManager.plasma6.enable = true; };
} }

View file

@ -1,16 +1,16 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.files.agenix; cfg = config.custom.files.agenix;
in { in
{
# https://wiki.nixos.org/wiki/Agenix # https://wiki.nixos.org/wiki/Agenix
# https://github.com/ryantm/agenix # https://github.com/ryantm/agenix
options.custom.files.agenix.enable = mkOption {default = false;}; options.custom.files.agenix.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
age.identityPaths = ["/etc/ssh/id_ed25519"]; # !! Must be set without sshd age.identityPaths = [ "/etc/ssh/id_ed25519" ]; # !! Must be set without sshd
}; };
} }

View file

@ -1,9 +1,8 @@
{ config, lib, ... }:
with lib;
{ {
config,
lib,
...
}:
with lib; {
config.custom.files = mkIf config.custom.default { config.custom.files = mkIf config.custom.default {
agenix.enable = true; agenix.enable = true;
dev.enable = true; dev.enable = true;

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.files.dev; cfg = config.custom.files.dev;
in { in
options.custom.files.dev.enable = mkOption {default = false;}; {
options.custom.files.dev.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# .keep empty file needed to create empty directory # .keep empty file needed to create empty directory

View file

@ -1,15 +1,15 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.files.mnt; cfg = config.custom.files.mnt;
in { in
options.custom.files.mnt.enable = mkOption {default = false;}; {
options.custom.files.mnt.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Set /mnt permissions # Set /mnt permissions
systemd.tmpfiles.rules = ["z /mnt 0755 root root"]; systemd.tmpfiles.rules = [ "z /mnt 0755 root root" ];
}; };
} }

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.files.nixos; cfg = config.custom.files.nixos;
in { in
options.custom.files.nixos.enable = mkOption {default = false;}; {
options.custom.files.nixos.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html # https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html

View file

@ -1,17 +1,17 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.adb; cfg = config.custom.programs.adb;
in { in
options.custom.programs.adb.enable = mkOption {default = false;}; {
options.custom.programs.adb.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Android # https://wiki.nixos.org/wiki/Android
# https://developer.android.com/tools/adb # https://developer.android.com/tools/adb
programs.adb.enable = true; programs.adb.enable = true;
users.users.${config.custom.username}.extraGroups = ["adbusers"]; users.users.${config.custom.username}.extraGroups = [ "adbusers" ];
}; };
} }

View file

@ -4,13 +4,17 @@
lib, lib,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.ags; cfg = config.custom.programs.ags;
in { in
options.custom.programs.ags.enable = mkOption {default = false;}; {
options.custom.programs.ags.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
imports = [inputs.ags.homeManagerModules.default]; imports = [ inputs.ags.homeManagerModules.default ];
# https://aylur.github.io/ags-docs # https://aylur.github.io/ags-docs
# https://github.com/Aylur/ags # https://github.com/Aylur/ags

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.alacritty; cfg = config.custom.programs.alacritty;
in { in
options.custom.programs.alacritty.enable = mkOption {default = false;}; {
options.custom.programs.alacritty.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/alacritty/alacritty # https://github.com/alacritty/alacritty

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.anime-game-launcher; cfg = config.custom.programs.anime-game-launcher;
in { in
options.custom.programs.anime-game-launcher.enable = mkOption {default = false;}; {
options.custom.programs.anime-game-launcher.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/an-anime-team # https://github.com/an-anime-team

View file

@ -5,13 +5,17 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.anyrun; cfg = config.custom.programs.anyrun;
in { in
options.custom.programs.anyrun.enable = mkOption {default = false;}; {
options.custom.programs.anyrun.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
imports = [inputs.anyrun.home-managerModules.default]; imports = [ inputs.anyrun.home-managerModules.default ];
# https://github.com/Kirottu/anyrun # https://github.com/Kirottu/anyrun
programs.anyrun = { programs.anyrun = {

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.appimage; cfg = config.custom.programs.appimage;
in { in
options.custom.programs.appimage.enable = mkOption {default = false;}; {
options.custom.programs.appimage.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Appimage # https://wiki.nixos.org/wiki/Appimage

View file

@ -1,14 +1,14 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi";
cfg = config.custom.programs.bitwarden-menu; cfg = config.custom.programs.bitwarden-menu;
in { in
options.custom.programs.bitwarden-menu.enable = mkOption {default = false;}; {
options.custom.programs.bitwarden-menu.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/firecat53/bitwarden-menu # https://github.com/firecat53/bitwarden-menu

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.chromium; cfg = config.custom.programs.chromium;
in { in
options.custom.programs.chromium.enable = mkOption {default = false;}; {
options.custom.programs.chromium.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Chromium # https://wiki.nixos.org/wiki/Chromium

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.clipse; cfg = config.custom.programs.clipse;
in { in
options.custom.programs.clipse.enable = mkOption {default = false;}; {
options.custom.programs.clipse.enable = mkOption { default = false; };
config = { config = {
# https://github.com/savedra1/clipse # https://github.com/savedra1/clipse

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.dconf; cfg = config.custom.programs.dconf;
in { in
options.custom.programs.dconf.enable = mkOption {default = false;}; {
options.custom.programs.dconf.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://gitlab.gnome.org/GNOME/dconf # https://gitlab.gnome.org/GNOME/dconf

View file

@ -1,9 +1,8 @@
{ config, lib, ... }:
with lib;
{ {
config,
lib,
...
}:
with lib; {
config.custom.programs = mkMerge [ config.custom.programs = mkMerge [
(mkIf config.custom.default { (mkIf config.custom.default {
direnv.enable = true; direnv.enable = true;

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.direnv; cfg = config.custom.programs.direnv;
in { in
options.custom.programs.direnv.enable = mkOption {default = false;}; {
options.custom.programs.direnv.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/direnv/direnv # https://github.com/direnv/direnv

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.discord; cfg = config.custom.programs.discord;
in { in
options.custom.programs.discord.enable = mkOption {default = false;}; {
options.custom.programs.discord.enable = mkOption { default = false; };
config.home-manager.users.myned = mkIf cfg.enable { config.home-manager.users.myned = mkIf cfg.enable {
home.file.".config/BetterDiscord".source = home.file.".config/BetterDiscord".source =

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.element-desktop; cfg = config.custom.programs.element-desktop;
in { in
options.custom.programs.element-desktop.enable = mkOption {default = false;}; {
options.custom.programs.element-desktop.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# Element Desktop custom themes # Element Desktop custom themes

View file

@ -4,19 +4,23 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
fastfetch = "${pkgs.fastfetch}/bin/fastfetch"; fastfetch = "${pkgs.fastfetch}/bin/fastfetch";
cfg = config.custom.programs.fastfetch; cfg = config.custom.programs.fastfetch;
in { in
{
options.custom.programs.fastfetch = { options.custom.programs.fastfetch = {
enable = mkOption {default = false;}; enable = mkOption { default = false; };
greet = mkOption {default = false;}; greet = mkOption { default = false; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/fastfetch-cli/fastfetch # https://github.com/fastfetch-cli/fastfetch
environment.systemPackages = [pkgs.fastfetch]; environment.systemPackages = [ pkgs.fastfetch ];
# System info greeting # System info greeting
programs.fish.interactiveShellInit = mkIf cfg.greet '' programs.fish.interactiveShellInit = mkIf cfg.greet ''

View file

@ -5,10 +5,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.firefox; cfg = config.custom.programs.firefox;
in { in
options.custom.programs.firefox.enable = mkOption {default = false;}; {
options.custom.programs.firefox.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# TODO: Switch to librewolf when supported by module # TODO: Switch to librewolf when supported by module
@ -112,7 +116,8 @@ in {
# https://mozilla.github.io/policy-templates/#extensionsettings # https://mozilla.github.io/policy-templates/#extensionsettings
#?? https://addons.mozilla.org/en-US/firefox #?? https://addons.mozilla.org/en-US/firefox
#?? about:support#addons #?? about:support#addons
ExtensionSettings = let ExtensionSettings =
let
extension = id: { extension = id: {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi";
installation_mode = "normal_installed"; installation_mode = "normal_installed";
@ -189,12 +194,14 @@ in {
#!! Only certain preferences are supported via policies #!! Only certain preferences are supported via policies
# https://mozilla.github.io/policy-templates/#preferences # https://mozilla.github.io/policy-templates/#preferences
#?? about:config #?? about:config
Preferences = let Preferences =
let
locked = value: { locked = value: {
Value = value; Value = value;
Status = "locked"; Status = "locked";
}; };
in { in
{
"accessibility.browsewithcaret" = locked false; "accessibility.browsewithcaret" = locked false;
"accessibility.typeaheadfind" = locked false; "accessibility.typeaheadfind" = locked false;
"browser.aboutConfig.showWarning" = locked false; "browser.aboutConfig.showWarning" = locked false;

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.fish; cfg = config.custom.programs.fish;
in { in
options.custom.programs.fish.enable = mkOption {default = false;}; {
options.custom.programs.fish.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Fish # https://wiki.nixos.org/wiki/Fish

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.foot; cfg = config.custom.programs.foot;
in { in
options.custom.programs.foot.enable = mkOption {default = false;}; {
options.custom.programs.foot.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://codeberg.org/dnkl/foot # https://codeberg.org/dnkl/foot

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.fuzzel; cfg = config.custom.programs.fuzzel;
in { in
options.custom.programs.fuzzel.enable = mkOption {default = false;}; {
options.custom.programs.fuzzel.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://codeberg.org/dnkl/fuzzel # https://codeberg.org/dnkl/fuzzel

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.gamemode; cfg = config.custom.programs.gamemode;
in { in
options.custom.programs.gamemode.enable = mkOption {default = false;}; {
options.custom.programs.gamemode.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/FeralInteractive/gamemode # https://github.com/FeralInteractive/gamemode

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.gamescope; cfg = config.custom.programs.gamescope;
in { in
options.custom.programs.gamescope.enable = mkOption {default = false;}; {
options.custom.programs.gamescope.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/ValveSoftware/gamescope # https://github.com/ValveSoftware/gamescope

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.git; cfg = config.custom.programs.git;
in { in
options.custom.programs.git.enable = mkOption {default = false;}; {
options.custom.programs.git.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://wiki.archlinux.org/title/Git # https://wiki.archlinux.org/title/Git

View file

@ -4,38 +4,43 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.gnome-shell; cfg = config.custom.programs.gnome-shell;
in { in
options.custom.programs.gnome-shell.enable = mkOption {default = false;}; {
options.custom.programs.gnome-shell.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# BUG: programs.gnome-shell.theme option forces installation of gnome-shell-extensions # BUG: programs.gnome-shell.theme option forces installation of gnome-shell-extensions
programs.gnome-shell = { programs.gnome-shell = {
enable = true; enable = true;
extensions = with pkgs.gnomeExtensions; extensions =
with pkgs.gnomeExtensions;
optionals config.custom.default [ optionals config.custom.default [
{package = appindicator;} # https://github.com/ubuntu/gnome-shell-extension-appindicator { package = appindicator; } # https://github.com/ubuntu/gnome-shell-extension-appindicator
] ]
++ optionals config.custom.minimal [ ++ optionals config.custom.minimal [
{package = caffeine;} # https://github.com/eonpatapon/gnome-shell-extension-caffeine { package = caffeine; } # https://github.com/eonpatapon/gnome-shell-extension-caffeine
{package = dash-to-dock;} # https://github.com/micheleg/dash-to-dock { package = dash-to-dock; } # https://github.com/micheleg/dash-to-dock
#// { package = dash2dock-lite; } # https://github.com/icedman/dash2dock-lite #// { package = dash2dock-lite; } # https://github.com/icedman/dash2dock-lite
{package = gsconnect;} # https://github.com/GSConnect/gnome-shell-extension-gsconnect { package = gsconnect; } # https://github.com/GSConnect/gnome-shell-extension-gsconnect
{package = just-perfection;} # https://gitlab.gnome.org/jrahmatzadeh/just-perfection { package = just-perfection; } # https://gitlab.gnome.org/jrahmatzadeh/just-perfection
{package = rounded-window-corners-reborn;} # https://github.com/flexagoon/rounded-window-corners { package = rounded-window-corners-reborn; } # https://github.com/flexagoon/rounded-window-corners
#// { package = user-themes; } # https://gitlab.gnome.org/GNOME/gnome-shell-extensions #// { package = user-themes; } # https://gitlab.gnome.org/GNOME/gnome-shell-extensions
] ]
++ optionals config.custom.full [ ++ optionals config.custom.full [
#// { package = auto-move-windows; } # https://gitlab.gnome.org/GNOME/gnome-shell-extensions #// { package = auto-move-windows; } # https://gitlab.gnome.org/GNOME/gnome-shell-extensions
{package = clipboard-indicator;} # https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator { package = clipboard-indicator; } # https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator
{package = ddterm;} # https://github.com/ddterm/gnome-shell-extension-ddterm { package = ddterm; } # https://github.com/ddterm/gnome-shell-extension-ddterm
#// { package = hide-top-bar; } # https://gitlab.gnome.org/tuxor1337/hidetopbar #// { package = hide-top-bar; } # https://gitlab.gnome.org/tuxor1337/hidetopbar
{package = media-controls;} # https://github.com/sakithb/media-controls { package = media-controls; } # https://github.com/sakithb/media-controls
#// { package = smart-auto-move; } # https://github.com/khimaros/smart-auto-move #// { package = smart-auto-move; } # https://github.com/khimaros/smart-auto-move
{package = tailscale-qs;} # https://github.com/joaophi/tailscale-gnome-qs { package = tailscale-qs; } # https://github.com/joaophi/tailscale-gnome-qs
{package = tiling-assistant;} # https://github.com/Leleat/Tiling-Assistant { package = tiling-assistant; } # https://github.com/Leleat/Tiling-Assistant
]; ];
}; };
}; };

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.gnome-terminal; cfg = config.custom.programs.gnome-terminal;
in { in
options.custom.programs.gnome-terminal.enable = mkOption {default = false;}; {
options.custom.programs.gnome-terminal.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://gitlab.gnome.org/GNOME/gnome-terminal # https://gitlab.gnome.org/GNOME/gnome-terminal

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.gpg; cfg = config.custom.programs.gpg;
in { in
options.custom.programs.gpg.enable = mkOption {default = false;}; {
options.custom.programs.gpg.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://wiki.archlinux.org/title/GnuPG # https://wiki.archlinux.org/title/GnuPG

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.htop; cfg = config.custom.programs.htop;
in { in
options.custom.programs.htop.enable = mkOption {default = false;}; {
options.custom.programs.htop.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/htop-dev/htop # https://github.com/htop-dev/htop

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.hyprlock; cfg = config.custom.programs.hyprlock;
in { in
options.custom.programs.hyprlock.enable = mkOption {default = false;}; {
options.custom.programs.hyprlock.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.hyprlock.enable = true; # Grant PAM access programs.hyprlock.enable = true; # Grant PAM access

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.kdeconnect; cfg = config.custom.programs.kdeconnect;
in { in
options.custom.programs.kdeconnect.enable = mkOption {default = false;}; {
options.custom.programs.kdeconnect.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/KDE/kdeconnect-kde # https://github.com/KDE/kdeconnect-kde

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.kitty; cfg = config.custom.programs.kitty;
in { in
options.custom.programs.kitty.enable = mkOption {default = false;}; {
options.custom.programs.kitty.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://sw.kovidgoyal.net/kitty/ # https://sw.kovidgoyal.net/kitty/

View file

@ -4,17 +4,21 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.libreoffice; cfg = config.custom.programs.libreoffice;
in { in
{
options.custom.programs.libreoffice = { options.custom.programs.libreoffice = {
enable = mkOption {default = false;}; enable = mkOption { default = false; };
package = mkOption {default = pkgs.libreoffice-fresh;}; package = mkOption { default = pkgs.libreoffice-fresh; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://www.libreoffice.org # https://www.libreoffice.org
environment.systemPackages = [cfg.package]; environment.systemPackages = [ cfg.package ];
#!! Options not available, files synced #!! Options not available, files synced
home-manager.users.${config.custom.username}.home.file.".config/libreoffice/4/user".source = home-manager.users.${config.custom.username}.home.file.".config/libreoffice/4/user".source =

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.librewolf; cfg = config.custom.programs.librewolf;
in { in
options.custom.programs.librewolf.enable = mkOption {default = false;}; {
options.custom.programs.librewolf.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://codeberg.org/librewolf # https://codeberg.org/librewolf

View file

@ -1,16 +1,15 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.localsend; cfg = config.custom.programs.localsend;
in { in
options.custom.programs.localsend.enable = mkOption {default = false;}; {
options.custom.programs.localsend.enable = mkOption { default = false; };
config = config =
if (versionAtLeast version "24.11") if (versionAtLeast version "24.11") then
then
(mkIf cfg.enable { (mkIf cfg.enable {
# https://github.com/localsend/localsend # https://github.com/localsend/localsend
programs.localsend = { programs.localsend = {
@ -18,5 +17,6 @@ in {
openFirewall = true; openFirewall = true;
}; };
}) })
else {}; else
{ };
} }

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.logseq; cfg = config.custom.programs.logseq;
in { in
options.custom.programs.logseq.enable = mkOption {default = false;}; {
options.custom.programs.logseq.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
#!! Synced imperative configuration #!! Synced imperative configuration

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.man; cfg = config.custom.programs.man;
in { in
options.custom.programs.man.enable = mkOption {default = false;}; {
options.custom.programs.man.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Enable as much offline docs as possible # Enable as much offline docs as possible

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.mangohud; cfg = config.custom.programs.mangohud;
in { in
options.custom.programs.mangohud.enable = mkOption {default = false;}; {
options.custom.programs.mangohud.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/flightlessmango/MangoHud # https://github.com/flightlessmango/MangoHud

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.mosh; cfg = config.custom.programs.mosh;
in { in
options.custom.programs.mosh.enable = mkOption {default = false;}; {
options.custom.programs.mosh.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Mosh # https://wiki.nixos.org/wiki/Mosh

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nano; cfg = config.custom.programs.nano;
in { in
options.custom.programs.nano.enable = mkOption {default = false;}; {
options.custom.programs.nano.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.archlinux.org/title/Nano # https://wiki.archlinux.org/title/Nano
@ -20,7 +20,6 @@ in {
set autoindent set autoindent
set magic set magic
set minibar set minibar
set linenumbers
set tabsize 2 set tabsize 2
set tabstospaces set tabstospaces
set trimblanks set trimblanks

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.nautilus; cfg = config.custom.programs.nautilus;
in { in
options.custom.programs.nautilus.enable = mkOption {default = false;}; {
options.custom.programs.nautilus.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.gvfs.enable = true; # Trash dependency services.gvfs.enable = true; # Trash dependency

View file

@ -1,21 +1,23 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.networkmanager-dmenu; cfg = config.custom.programs.networkmanager-dmenu;
in { in
options.custom.programs.networkmanager-dmenu.enable = mkOption {default = false;}; {
options.custom.programs.networkmanager-dmenu.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/firecat53/networkmanager-dmenu # https://github.com/firecat53/networkmanager-dmenu
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example # https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
#!! Option not available, files written directly #!! Option not available, files written directly
# FIXME: active_chars does not take effect # FIXME: active_chars does not take effect
home.file.".config/networkmanager-dmenu/config.ini".text = let home.file.".config/networkmanager-dmenu/config.ini".text =
let
wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi"; wofi = "${config.home-manager.users.${config.custom.username}.programs.wofi.package}/bin/wofi";
in '' in
''
[dmenu] [dmenu]
dmenu_command = ${wofi} --dmenu --lines 11 dmenu_command = ${wofi} --dmenu --lines 11
active_chars = > active_chars = >

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nh; cfg = config.custom.programs.nh;
in { in
options.custom.programs.nh.enable = mkOption {default = false;}; {
options.custom.programs.nh.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/viperML/nh # https://github.com/viperML/nh
@ -16,11 +16,7 @@ in {
clean = { clean = {
enable = true; enable = true;
extraArgs = "--keep-since ${ extraArgs = "--keep-since ${if config.custom.minimal then "7" else "30"}d";
if config.custom.minimal
then "7"
else "30"
}d";
}; };
}; };
}; };

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nheko; cfg = config.custom.programs.nheko;
in { in
options.custom.programs.nheko.enable = mkOption {default = false;}; {
options.custom.programs.nheko.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/Nheko-Reborn/nheko # https://github.com/Nheko-Reborn/nheko

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nix-index; cfg = config.custom.programs.nix-index;
in { in
options.custom.programs.nix-index.enable = mkOption {default = false;}; {
options.custom.programs.nix-index.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/nix-community/nix-index # https://github.com/nix-community/nix-index

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nix-ld; cfg = config.custom.programs.nix-ld;
in { in
options.custom.programs.nix-ld.enable = mkOption {default = false;}; {
options.custom.programs.nix-ld.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://github.com/nix-community/nix-ld # https://github.com/nix-community/nix-ld

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nushell; cfg = config.custom.programs.nushell;
in { in
options.custom.programs.nushell.enable = mkOption {default = false;}; {
options.custom.programs.nushell.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# TODO: Create config # TODO: Create config

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.nvtop; cfg = config.custom.programs.nvtop;
in { in
options.custom.programs.nvtop.enable = mkOption {default = false;}; {
options.custom.programs.nvtop.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/Syllo/nvtop # https://github.com/Syllo/nvtop

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.obs-studio; cfg = config.custom.programs.obs-studio;
in { in
options.custom.programs.obs-studio.enable = mkOption {default = false;}; {
options.custom.programs.obs-studio.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/obsproject/obs-studio # https://github.com/obsproject/obs-studio

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.onedrive; cfg = config.custom.programs.onedrive;
in { in
options.custom.programs.onedrive.enable = mkOption {default = false;}; {
options.custom.programs.onedrive.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/abraunegg/onedrive # https://github.com/abraunegg/onedrive

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.path-of-building; cfg = config.custom.programs.path-of-building;
in { in
options.custom.programs.path-of-building.enable = mkOption {default = false;}; {
options.custom.programs.path-of-building.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
xdg.desktopEntries.path-of-building = { xdg.desktopEntries.path-of-building = {

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.rbw; cfg = config.custom.programs.rbw;
in { in
options.custom.programs.rbw.enable = mkOption {default = false;}; {
options.custom.programs.rbw.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/doy/rbw # https://github.com/doy/rbw

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.rofi-rbw; cfg = config.custom.programs.rofi-rbw;
in { in
options.custom.programs.rofi-rbw.enable = mkOption {default = false;}; {
options.custom.programs.rofi-rbw.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/fdw/rofi-rbw # https://github.com/fdw/rofi-rbw

View file

@ -4,10 +4,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.rofi; cfg = config.custom.programs.rofi;
in { in
options.custom.programs.rofi.enable = mkOption {default = false;}; {
options.custom.programs.rofi.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
#!! Creates package derivation #!! Creates package derivation
@ -26,8 +30,8 @@ in {
# Build against rofi-wayland due to ABI incompatibility with upstream # Build against rofi-wayland due to ABI incompatibility with upstream
# https://github.com/lbonn/rofi/issues/96 # https://github.com/lbonn/rofi/issues/96
# https://github.com/NixOS/nixpkgs/issues/298539 # https://github.com/NixOS/nixpkgs/issues/298539
(rofi-calc.override {rofi-unwrapped = rofi-wayland-unwrapped;}) # Calculator (rofi-calc.override { rofi-unwrapped = rofi-wayland-unwrapped; }) # Calculator
(rofi-top.override {rofi-unwrapped = rofi-wayland-unwrapped;}) # System monitor (rofi-top.override { rofi-unwrapped = rofi-wayland-unwrapped; }) # System monitor
]; ];
#?? rofi-theme-selector #?? rofi-theme-selector

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.seahorse; cfg = config.custom.programs.seahorse;
in { in
options.custom.programs.seahorse.enable = mkOption {default = false;}; {
options.custom.programs.seahorse.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.seahorse.enable = true; programs.seahorse.enable = true;

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.slurp; cfg = config.custom.programs.slurp;
in { in
options.custom.programs.slurp.enable = mkOption {default = false;}; {
options.custom.programs.slurp.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/emersion/slurp # https://github.com/emersion/slurp

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.ssh; cfg = config.custom.programs.ssh;
in { in
options.custom.programs.ssh.enable = mkOption {default = false;}; {
options.custom.programs.ssh.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Disable prompt for new hosts # Disable prompt for new hosts

View file

@ -4,22 +4,25 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.steam; cfg = config.custom.programs.steam;
in { in
{
# https://wiki.nixos.org/wiki/Steam # https://wiki.nixos.org/wiki/Steam
# https://store.steampowered.com # https://store.steampowered.com
options.custom.programs.steam = { options.custom.programs.steam = {
enable = mkOption {default = false;}; enable = mkOption { default = false; };
extest = mkOption {default = false;}; extest = mkOption { default = false; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.steam = programs.steam = {
{
enable = true; enable = true;
extest.enable = cfg.extest; # Work around invisible cursor on Wayland extest.enable = cfg.extest; # Work around invisible cursor on Wayland
extraCompatPackages = [pkgs.proton-ge-bin]; extraCompatPackages = [ pkgs.proton-ge-bin ];
gamescopeSession = { gamescopeSession = {
enable = true; enable = true;
@ -28,7 +31,6 @@ in {
# "--fullscreen" # "--fullscreen"
# ]; # ];
}; };
} } // optionalAttrs (versionAtLeast version "24.11") { protontricks.enable = true; };
// optionalAttrs (versionAtLeast version "24.11") {protontricks.enable = true;};
}; };
} }

View file

@ -4,15 +4,19 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.swaylock; cfg = config.custom.programs.swaylock;
in { in
options.custom.programs.swaylock.enable = mkOption {default = false;}; {
options.custom.programs.swaylock.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Allow swaylock to unlock the session # Allow swaylock to unlock the session
# https://wiki.nixos.org/wiki/Sway#Swaylock_cannot_be_unlocked_with_the_correct_password # https://wiki.nixos.org/wiki/Sway#Swaylock_cannot_be_unlocked_with_the_correct_password
security.pam.services.swaylock = {}; security.pam.services.swaylock = { };
# https://github.com/swaywm/swaylock # https://github.com/swaywm/swaylock
home-manager.users.${config.custom.username}.programs.swaylock = { home-manager.users.${config.custom.username}.programs.swaylock = {

View file

@ -5,10 +5,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.thunderbird; cfg = config.custom.programs.thunderbird;
in { in
options.custom.programs.thunderbird.enable = mkOption {default = false;}; {
options.custom.programs.thunderbird.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Thunderbird # https://wiki.nixos.org/wiki/Thunderbird

View file

@ -1,17 +1,17 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.tio; cfg = config.custom.programs.tio;
in { in
options.custom.programs.tio.enable = mkOption {default = false;}; {
options.custom.programs.tio.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Allow serial device access # Allow serial device access
# https://github.com/tio/tio?tab=readme-ov-file#46-known-issues # https://github.com/tio/tio?tab=readme-ov-file#46-known-issues
users.users.${config.custom.username}.extraGroups = ["dialout"]; users.users.${config.custom.username}.extraGroups = [ "dialout" ];
# https://github.com/tio/tio # https://github.com/tio/tio
#!! Options not available, files written directly #!! Options not available, files written directly

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.tmux; cfg = config.custom.programs.tmux;
in { in
options.custom.programs.tmux.enable = mkOption {default = false;}; {
options.custom.programs.tmux.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Tmux # https://wiki.nixos.org/wiki/Tmux

View file

@ -5,10 +5,14 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.custom.programs.vscode; cfg = config.custom.programs.vscode;
in { in
options.custom.programs.vscode.enable = mkOption {default = false;}; {
options.custom.programs.vscode.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/VSCodium # https://wiki.nixos.org/wiki/VSCodium
@ -63,9 +67,9 @@ in {
home = { home = {
# Extension dependencies # Extension dependencies
packages = with pkgs; [ packages = with pkgs; [
alejandra # nix-ide
blueprint-compiler # blueprint-gtk blueprint-compiler # blueprint-gtk
nixd # nix-ide nixd # nix-ide
nixfmt-rfc-style # nix-ide
shfmt # shell-format shfmt # shell-format
]; ];

View file

@ -4,7 +4,10 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
bash = "${pkgs.bash}/bin/bash"; bash = "${pkgs.bash}/bin/bash";
blueberry = "${pkgs.blueberry}/bin/blueberry"; blueberry = "${pkgs.blueberry}/bin/blueberry";
bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl"; bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl";
@ -32,8 +35,9 @@ with lib; let
wttrbar = "${pkgs.wttrbar}/bin/wttrbar"; wttrbar = "${pkgs.wttrbar}/bin/wttrbar";
cfg = config.custom.programs.waybar; cfg = config.custom.programs.waybar;
in { in
options.custom.programs.waybar.enable = mkOption {default = false;}; {
options.custom.programs.waybar.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/Alexays/Waybar # https://github.com/Alexays/Waybar
@ -46,7 +50,8 @@ in {
### SETTINGS ### ### SETTINGS ###
# https://github.com/Alexays/Waybar/wiki/Configuration # https://github.com/Alexays/Waybar/wiki/Configuration
#?? pkill -SIGUSR2 -x waybar #?? pkill -SIGUSR2 -x waybar
settings = let settings =
let
## INHERIT ## ## INHERIT ##
#!! Module defaults are not accurate to documentation #!! Module defaults are not accurate to documentation
# TODO: Submit pull request to fix in addition to inconsistent hyphen vs underscore # TODO: Submit pull request to fix in addition to inconsistent hyphen vs underscore
@ -87,7 +92,8 @@ in {
on-scroll-down = "${swayosd-client} --output-volume lower"; on-scroll-down = "${swayosd-client} --output-volume lower";
rotate = 180; rotate = 180;
}; };
in { in
{
status = { status = {
## GLOBAL ## ## GLOBAL ##
layer = "top"; layer = "top";
@ -132,11 +138,7 @@ in {
"custom/vm" = { "custom/vm" = {
interval = 5; interval = 5;
exec = "~/.config/waybar/scripts/vm.sh"; exec = "~/.config/waybar/scripts/vm.sh";
on-click = "~/.local/bin/vm -x ${ on-click = "~/.local/bin/vm -x ${if config.custom.hidpi then "/scale:140" else ""}";
if config.custom.hidpi
then "/scale:140"
else ""
}";
}; };
"custom/vpn" = { "custom/vpn" = {
@ -157,7 +159,6 @@ in {
}; };
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland # https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
# https://www.nerdfonts.com/cheat-sheet
"hyprland/workspaces" = { "hyprland/workspaces" = {
show-special = true; show-special = true;
format = "{icon}"; format = "{icon}";
@ -166,9 +167,8 @@ in {
dropdown = "󰞷"; dropdown = "󰞷";
game = "󰊴"; game = "󰊴";
music = "󰝚"; music = "󰝚";
office = "󰈙";
pip = "󰹙"; pip = "󰹙";
scratchpad = ""; scratchpad = "󰎚";
steam = "󰓓"; steam = "󰓓";
terminal = ""; terminal = "";
vm = "󰢹"; vm = "󰢹";
@ -215,9 +215,7 @@ in {
]; ];
}; };
"cava#reverse" = "cava#reverse" = cava-config // {
cava-config
// {
reverse = true; reverse = true;
}; };
@ -343,7 +341,7 @@ in {
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}
case "$(virsh domstate myndows)" in case "$(virsh --connect qemu:///system domstate myndows)" in
'running') 'running')
${echo} ${echo}
${echo} Online ${echo} Online

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.wezterm; cfg = config.custom.programs.wezterm;
in { in
options.custom.programs.wezterm.enable = mkOption {default = false;}; {
options.custom.programs.wezterm.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/wez/wezterm # https://github.com/wez/wezterm

View file

@ -1,21 +1,17 @@
{ { config, lib, ... }:
config,
lib, with lib;
pkgs,
... let
}:
with lib; let
cfg = config.custom.programs.wireshark; cfg = config.custom.programs.wireshark;
in { in
options.custom.programs.wireshark.enable = mkOption {default = false;}; {
options.custom.programs.wireshark.enable = mkOption { default = false; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# https://gitlab.com/wireshark/wireshark # https://gitlab.com/wireshark/wireshark
programs.wireshark = { programs.wireshark.enable = true;
enable = true;
package = pkgs.wireshark; # GUI
};
users.users.${config.custom.username}.extraGroups = ["wireshark"]; users.users.${config.custom.username}.extraGroups = [ "wireshark" ];
}; };
} }

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.wofi; cfg = config.custom.programs.wofi;
in { in
options.custom.programs.wofi.enable = mkOption {default = false;}; {
options.custom.programs.wofi.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://hg.sr.ht/~scoopta/wofi # https://hg.sr.ht/~scoopta/wofi

View file

@ -1,12 +1,12 @@
{ { config, lib, ... }:
config,
lib, with lib;
...
}: let
with lib; let
cfg = config.custom.programs.wpaperd; cfg = config.custom.programs.wpaperd;
in { in
options.custom.programs.wpaperd.enable = mkOption {default = false;}; {
options.custom.programs.wpaperd.enable = mkOption { default = false; };
config.home-manager.users.${config.custom.username} = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
# https://github.com/danyspin97/wpaperd # https://github.com/danyspin97/wpaperd

View file

@ -4,14 +4,19 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
# Use packages from local derivation # Use packages from local derivation
git = config.home-manager.users.${config.custom.username}.programs.git.package; git = config.home-manager.users.${config.custom.username}.programs.git.package;
hyprland = hyprland =
config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage; config.home-manager.users.${config.custom.username}.wayland.windowManager.hyprland.finalPackage;
wofi = config.home-manager.users.${config.custom.username}.programs.wofi.package; wofi = config.home-manager.users.${config.custom.username}.programs.wofi.package;
in { in
config.home-manager.users.${config.custom.username}.home.file = let {
config.home-manager.users.${config.custom.username}.home.file =
let
# Place script.ext in the same directory as this file # Place script.ext in the same directory as this file
#?? pkg = (SHELL "NAME" [ DEPENDENCIES ]) #?? pkg = (SHELL "NAME" [ DEPENDENCIES ])
# https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-writeShellApplication # https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-writeShellApplication
@ -30,7 +35,7 @@ in {
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/writers/scripts.nix#L605 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/writers/scripts.nix#L605
python = name: dependencies: { python = name: dependencies: {
".local/bin/${name}".source = ".local/bin/${name}".source =
pkgs.writers.writePython3Bin name {libraries = dependencies;} pkgs.writers.writePython3Bin name { libraries = dependencies; }
# Disable linting # Disable linting
# https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files # https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files
("# flake8: noqa\n" + builtins.readFile ./${name}.py) ("# flake8: noqa\n" + builtins.readFile ./${name}.py)
@ -167,10 +172,11 @@ in {
swww swww
tailscale tailscale
]) ])
] ]
++ (with pkgs.python3Packages; [ ++ (with pkgs.python3Packages; [
# Python files with extension .py # Python files with extension .py
(python "bcrypt" [bcrypt]) (python "bcrypt" [ bcrypt ])
]) ])
) )
); );

View file

@ -6,7 +6,7 @@
workspace="$(hyprctl activewindow -j | jq -r .workspace.name)" workspace="$(hyprctl activewindow -j | jq -r .workspace.name)"
if [[ "$workspace" == "special:scratchpad" ]]; then if [[ "$workspace" == "special:scratchpad" ]]; then
hyprctl dispatch movetoworkspacesilent 0 hyprctl dispatch movetoworkspacesilent +0
else else
hyprctl dispatch movetoworkspacesilent special:scratchpad hyprctl dispatch movetoworkspacesilent special:scratchpad
fi fi

View file

@ -15,9 +15,9 @@ function round() {
# TODO: Use proper flags # TODO: Use proper flags
# TODO: Add clipboard support # TODO: Add clipboard support
if [[ "${1-}" == '-e' ]]; then if [[ "${1-}" == '-e' ]]; then
grimblast --freeze save area - | swappy --file - grimblast save area - | swappy --file -
elif [[ "${1-}" == '-d' ]]; then elif [[ "${1-}" == '-d' ]]; then
grimblast --freeze save output - > "$XDG_SCREENSHOTS_DIR/$(date +'%F %H-%M-%S').png" grimblast save output - > "$XDG_SCREENSHOTS_DIR/$(date +'%F %H-%M-%S').png"
else else
grimblast --freeze save area - > "$XDG_SCREENSHOTS_DIR/$(date +'%F %H-%M-%S').png" grimblast save area - > "$XDG_SCREENSHOTS_DIR/$(date +'%F %H-%M-%S').png"
fi fi

View file

@ -1,58 +1,27 @@
#! /usr/bin/env bash #! /usr/bin/env bash
set -x # Toggle tagged window, launch if needed
#?? toggle TAG WORKSPACE [COMMAND]
# TODO: Use proper flags
# TODO: Support floating groups
# Toggle pinned window, launch if needed if (("$#" >= 3)); then
#?? toggle --type TYPE --expression EXPRESSION --workspace WORKSPACE [COMMAND] # Launch if tag does not exist yet
#!! Regex may need to be double-escaped if ! hyprctl -j clients | jq -r '.[].tags[]' | grep "$1"; then
# https://jqlang.github.io/jq/manual/#regular-expressions hyprctl dispatch exec -- "${@:3}"
focus=false
while (("$#" > 0)); do
case "$1" in
-e | --expression)
shift
expression="$1"
;;
-f | --focus)
focus=true
;;
-t | --type)
shift
type="$1"
;;
-w | --workspace)
shift
workspace="$1"
;;
--)
shift
break
;;
esac
shift
done
command="${*}"
if [[ "$command" ]]; then
if ! hyprctl -j clients | jq -re "any(.[].$type | test(\"$expression\"); . == true)"; then
hyprctl dispatch exec -- "$command" # Launch window
exit exit
fi fi
fi fi
current_workspace="$(hyprctl -j clients | jq -r "first(.[] | select(.$type | test(\"$expression\")).workspace.name)")" # Dispatchers do not currently support matching by tag, so select address
window="address:$(hyprctl -j clients | jq -r "first(.[] | select(.tags[] | startswith(\"$1\")).address)")"
if [[ "$current_workspace" == "$workspace" ]]; then workspace="$(hyprctl -j clients | jq -r "first(.[] | select(.tags[] | startswith(\"$1\")).workspace.name)")"
hyprctl dispatch movetoworkspacesilent "0,$type:$expression" # Move to current workspace first, otherwise some windows freeze
hyprctl dispatch pin "$type:$expression" # Pin
if "$focus"; then if [[ "$workspace" == "$2" ]]; then
hyprctl dispatch focuswindow "$type:$expression" # Focus hyprctl dispatch pin "$window" # Pin
fi (("$#" >= 3)) && hyprctl dispatch focuswindow "$window" # Focus if third argument
else else
hyprctl dispatch pin "$type:$expression" # Unpin hyprctl dispatch pin "$window" # Unpin
hyprctl dispatch movetoworkspacesilent "$workspace,$type:$expression" # Move to workspace hyprctl dispatch movetoworkspacesilent "$2,$window"
fi fi

View file

@ -3,6 +3,8 @@
# Start/resume VM if needed and launch viewer # Start/resume VM if needed and launch viewer
#?? man xfreerdp #?? man xfreerdp
function virsh() { command virsh --connect qemu:///system "$@"; }
state="$(virsh domstate myndows)" state="$(virsh domstate myndows)"
if [[ "$state" == 'paused' ]]; then if [[ "$state" == 'paused' ]]; then

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