This commit is contained in:
DashieTM 2025-05-10 13:29:37 +02:00
parent 1cb30eadca
commit cee415973f
13 changed files with 1747 additions and 1678 deletions

View file

@ -1,174 +1,174 @@
{ {
mkDashDefault, mkDashDefault,
pkgs, pkgs,
config, config,
lib, lib,
hostName, hostName,
modulesPath, modulesPath,
... ...
}: let }: let
username = config.conf.username; username = config.conf.username;
in { in {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
wsl.enable = mkDashDefault config.conf.wsl; wsl.enable = mkDashDefault config.conf.wsl;
# Bootloader. # Bootloader.
boot = lib.mkIf (!config.conf.wsl) { boot = lib.mkIf (!config.conf.wsl) {
consoleLogLevel = mkDashDefault 0; consoleLogLevel = mkDashDefault 0;
lanzaboote = lib.mkIf config.conf.secureBoot { lanzaboote = lib.mkIf config.conf.secureBoot {
enable = mkDashDefault true; enable = mkDashDefault true;
pkiBundle = mkDashDefault "/var/lib/sbctl"; pkiBundle = mkDashDefault "/var/lib/sbctl";
settings.reboot-for-bitlocker = mkDashDefault true; settings.reboot-for-bitlocker = mkDashDefault true;
}; };
loader = { loader = {
systemd-boot = { systemd-boot = {
enable = enable =
if config.conf.secureBoot if config.conf.secureBoot
then lib.mkForce false then lib.mkForce false
else if config.conf.useSystemdBootloader else if config.conf.useSystemdBootloader
then true then true
else mkDashDefault false; else mkDashDefault false;
configurationLimit = 5; configurationLimit = 5;
}; };
efi.canTouchEfiVariables = mkDashDefault true; efi.canTouchEfiVariables = mkDashDefault true;
}; };
kernelPackages = mkDashDefault pkgs.linuxPackages_latest; kernelPackages = mkDashDefault pkgs.linuxPackages_latest;
initrd = { initrd = {
verbose = mkDashDefault false; verbose = mkDashDefault false;
availableKernelModules = [ availableKernelModules = [
"nvme" "nvme"
"xhci_pci" "xhci_pci"
"ahci" "ahci"
"usbhid" "usbhid"
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
}; };
kernelParams = kernelParams =
[ [
''resume="PARTLABEL=SWAP"'' ''resume="PARTLABEL=SWAP"''
''quiet'' ''quiet''
''udev.log_level=3'' ''udev.log_level=3''
] ]
++ config.conf.bootParams; ++ config.conf.bootParams;
}; };
networking = { networking = {
useDHCP = mkDashDefault true; useDHCP = mkDashDefault true;
networkmanager.enable = mkDashDefault true; networkmanager.enable = mkDashDefault true;
hostName = mkDashDefault hostName; hostName = mkDashDefault hostName;
}; };
time = { time = {
timeZone = mkDashDefault config.conf.timezone; timeZone = mkDashDefault config.conf.timezone;
hardwareClockInLocalTime = mkDashDefault config.conf.systemLocalTime; hardwareClockInLocalTime = mkDashDefault config.conf.systemLocalTime;
}; };
i18n.defaultLocale = mkDashDefault config.conf.locale; i18n.defaultLocale = mkDashDefault config.conf.locale;
services = { services = {
lorri.enable = mkDashDefault true; lorri.enable = mkDashDefault true;
xserver.enable = mkDashDefault true; xserver.enable = mkDashDefault true;
fstrim.enable = mkDashDefault true; fstrim.enable = mkDashDefault true;
pulseaudio.enable = mkDashDefault false; pulseaudio.enable = mkDashDefault false;
pipewire = { pipewire = {
enable = mkDashDefault true; enable = mkDashDefault true;
alsa = { alsa = {
enable = mkDashDefault true; enable = mkDashDefault true;
support32Bit = mkDashDefault true; support32Bit = mkDashDefault true;
}; };
jack.enable = mkDashDefault true; jack.enable = mkDashDefault true;
pulse.enable = mkDashDefault true; pulse.enable = mkDashDefault true;
}; };
}; };
nixpkgs.hostPlatform = mkDashDefault config.conf.system; nixpkgs.hostPlatform = mkDashDefault config.conf.system;
nix = { nix = {
gc = { gc = {
automatic = mkDashDefault true; automatic = mkDashDefault true;
dates = mkDashDefault "weekly"; dates = mkDashDefault "weekly";
options = mkDashDefault "--delete-older-than 7d --delete-generations +5"; options = mkDashDefault "--delete-older-than 7d --delete-generations +5";
}; };
settings = { settings = {
trusted-users = [username]; trusted-users = [username];
auto-optimise-store = mkDashDefault true; auto-optimise-store = mkDashDefault true;
builders-use-substitutes = mkDashDefault true; builders-use-substitutes = mkDashDefault true;
substituters = [ substituters = [
"https://hyprland.cachix.org" "https://hyprland.cachix.org"
"https://anyrun.cachix.org" "https://anyrun.cachix.org"
"https://cache.garnix.io" "https://cache.garnix.io"
"https://oxipaste.cachix.org" "https://oxipaste.cachix.org"
"https://oxinoti.cachix.org" "https://oxinoti.cachix.org"
"https://oxishut.cachix.org" "https://oxishut.cachix.org"
"https://oxidash.cachix.org" "https://oxidash.cachix.org"
"https://oxicalc.cachix.org" "https://oxicalc.cachix.org"
"https://hyprdock.cachix.org" "https://hyprdock.cachix.org"
"https://reset.cachix.org" "https://reset.cachix.org"
"https://chaotic-nyx.cachix.org/" "https://chaotic-nyx.cachix.org/"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc=" "oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc="
"oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc=" "oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc="
"oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU=" "oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU="
"oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30=" "oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30="
"oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ=" "oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ="
"hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y=" "hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y="
"reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo=" "reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
]; ];
experimental-features = mkDashDefault "nix-command flakes pipe-operators"; experimental-features = mkDashDefault "nix-command flakes pipe-operators";
}; };
}; };
hardware = { hardware = {
cpu.${config.conf.cpu}.updateMicrocode = cpu.${config.conf.cpu}.updateMicrocode =
mkDashDefault mkDashDefault
config.hardware.enableRedistributableFirmware; config.hardware.enableRedistributableFirmware;
}; };
security.rtkit.enable = mkDashDefault true; security.rtkit.enable = mkDashDefault true;
environment.variables = { environment.variables = {
XDG_CACHE_HOME = mkDashDefault "$HOME/.cache"; XDG_CACHE_HOME = mkDashDefault "$HOME/.cache";
DIRENV_LOG_FORMAT = mkDashDefault ""; DIRENV_LOG_FORMAT = mkDashDefault "";
QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct"; QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct";
}; };
# allows user change later on # allows user change later on
users = { users = {
mutableUsers = mkDashDefault true; mutableUsers = mkDashDefault true;
users.${username} = { users.${username} = {
isNormalUser = mkDashDefault true; isNormalUser = mkDashDefault true;
description = mkDashDefault username; description = mkDashDefault username;
extraGroups = [ extraGroups = [
"networkmanager" "networkmanager"
"wheel" "wheel"
"gamemode" "gamemode"
"docker" "docker"
"vboxusers" "vboxusers"
"video" "video"
"audio" "audio"
]; ];
packages = with pkgs; [ packages = with pkgs; [
home-manager home-manager
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
]; ];
# this password will only last for the first login # this password will only last for the first login
# e.g. login, then change to whatever else, this also ensures no public hash is available # e.g. login, then change to whatever else, this also ensures no public hash is available
password = mkDashDefault "firstlogin"; password = mkDashDefault "firstlogin";
}; };
}; };
} }

View file

@ -1,24 +1,24 @@
{ {
mkDashDefault, mkDashDefault,
pkgs, pkgs,
config, config,
lib, lib,
... ...
}: { }: {
environment = { environment = {
variables = { variables = {
GSETTINGS_SCHEMA_DIR = mkDashDefault "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}"; GSETTINGS_SCHEMA_DIR = mkDashDefault "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
NEOVIDE_MAXIMIZED = mkDashDefault "0"; NEOVIDE_MAXIMIZED = mkDashDefault "0";
GPG_TTY = mkDashDefault "$(tty)"; GPG_TTY = mkDashDefault "$(tty)";
EDITOR = mkDashDefault "neovide --no-fork"; EDITOR = mkDashDefault "neovide --no-fork";
SUDO_EDITOR = mkDashDefault "neovide --no-fork"; SUDO_EDITOR = mkDashDefault "neovide --no-fork";
SCRIPTS = mkDashDefault "$HOME/.config/scripts"; SCRIPTS = mkDashDefault "$HOME/.config/scripts";
}; };
sessionVariables = { sessionVariables = {
NIXOS_OZONE_WL = mkDashDefault "1"; NIXOS_OZONE_WL = mkDashDefault "1";
GOPATH = mkDashDefault "$HOME/.go"; GOPATH = mkDashDefault "$HOME/.go";
FLAKE = mkDashDefault config.conf.nixosConfigPath; FLAKE = mkDashDefault config.conf.nixosConfigPath;
NH_FLAKE = mkDashDefault config.conf.nixosConfigPath; NH_FLAKE = mkDashDefault config.conf.nixosConfigPath;
}; };
}; };
} }

260
flake.nix
View file

@ -1,130 +1,130 @@
{ {
description = "DashNix"; description = "DashNix";
inputs = { inputs = {
unstable.url = "github:NixOs/nixpkgs/nixos-unstable"; unstable.url = "github:NixOs/nixpkgs/nixos-unstable";
stable.url = "github:NixOs/nixpkgs/nixos-24.11"; stable.url = "github:NixOs/nixpkgs/nixos-24.11";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
lanzaboote = { lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2"; url = "github:nix-community/lanzaboote/v0.4.2";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
Hyprspace = { Hyprspace = {
url = "github:KZDKM/Hyprspace"; url = "github:KZDKM/Hyprspace";
inputs.hyprland.follows = "hyprland"; inputs.hyprland.follows = "hyprland";
}; };
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
ironbar = { ironbar = {
url = "github:JakeStanger/ironbar"; url = "github:JakeStanger/ironbar";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
zen-browser.url = "github:youwen5/zen-browser-flake"; zen-browser.url = "github:youwen5/zen-browser-flake";
# TODO move to upstream repository after merged nix flake pr # TODO move to upstream repository after merged nix flake pr
fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake"; fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
base16.url = "github:SenchoPens/base16.nix"; base16.url = "github:SenchoPens/base16.nix";
disko.url = "github:nix-community/disko/latest"; disko.url = "github:nix-community/disko/latest";
anyrun.url = "github:Kirottu/anyrun"; anyrun.url = "github:Kirottu/anyrun";
oxicalc.url = "github:Xetibo/OxiCalc"; oxicalc.url = "github:Xetibo/OxiCalc";
oxishut.url = "github:Xetibo/OxiShut"; oxishut.url = "github:Xetibo/OxiShut";
oxinoti.url = "github:Xetibo/OxiNoti"; oxinoti.url = "github:Xetibo/OxiNoti";
oxidash.url = "github:Xetibo/OxiDash"; oxidash.url = "github:Xetibo/OxiDash";
oxipaste.url = "github:Xetibo/OxiPaste"; oxipaste.url = "github:Xetibo/OxiPaste";
oxirun.url = "github:Xetibo/OxiRun"; oxirun.url = "github:Xetibo/OxiRun";
hyprdock.url = "github:Xetibo/hyprdock"; hyprdock.url = "github:Xetibo/hyprdock";
reset.url = "github:Xetibo/ReSet"; reset.url = "github:Xetibo/ReSet";
reset-plugins.url = "github:Xetibo/ReSet-Plugins"; reset-plugins.url = "github:Xetibo/ReSet-Plugins";
# absolute insanity # absolute insanity
chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
dashvim = { dashvim = {
url = "github:Xetibo/DashVim"; url = "github:Xetibo/DashVim";
}; };
}; };
outputs = {self, ...} @ inputs: let outputs = {self, ...} @ inputs: let
currentSystem = "x86_64-linux"; currentSystem = "x86_64-linux";
permittedPackages = [ permittedPackages = [
"olm-3.2.16" "olm-3.2.16"
# well done dotnet... # well done dotnet...
# this is just for omnisharp # this is just for omnisharp
"dotnet-core-combined" "dotnet-core-combined"
"dotnet-wrapped-combined" "dotnet-wrapped-combined"
"dotnet-combined" "dotnet-combined"
"dotnet-sdk-6.0.428" "dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428" "dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-6.0.136" "dotnet-sdk-6.0.136"
"dotnet-sdk-wrapped-6.0.136" "dotnet-sdk-wrapped-6.0.136"
"dotnet-sdk-7.0.120" "dotnet-sdk-7.0.120"
"dotnet-sdk-wrapped-7.0.120" "dotnet-sdk-wrapped-7.0.120"
"dotnet-sdk-7.0.410" "dotnet-sdk-7.0.410"
"dotnet-sdk-wrapped-7.0.410" "dotnet-sdk-wrapped-7.0.410"
"jitsi-meet-1.0.8043" "jitsi-meet-1.0.8043"
"nextcloud-27.1.11" "nextcloud-27.1.11"
]; ];
stable = import inputs.stable { stable = import inputs.stable {
system = currentSystem; system = currentSystem;
config = { config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = permittedPackages; permittedInsecurePackages = permittedPackages;
}; };
overlays = [ overlays = [
inputs.nur.overlays.default inputs.nur.overlays.default
inputs.chaoticNyx.overlays.default inputs.chaoticNyx.overlays.default
]; ];
}; };
unstable = import inputs.unstable { unstable = import inputs.unstable {
system = currentSystem; system = currentSystem;
config = { config = {
allowUnsupportedSystem = true; allowUnsupportedSystem = true;
permittedInsecurePackages = permittedPackages; permittedInsecurePackages = permittedPackages;
# Often happens with neovim, this should not block everything. # Often happens with neovim, this should not block everything.
allowBroken = true; allowBroken = true;
allowUnfree = true; allowUnfree = true;
}; };
overlays = [ overlays = [
inputs.nur.overlays.default inputs.nur.overlays.default
inputs.chaoticNyx.overlays.default inputs.chaoticNyx.overlays.default
]; ];
}; };
in rec { in rec {
dashNixLib = import ./lib { dashNixLib = import ./lib {
inherit inherit
self self
inputs inputs
unstable unstable
stable stable
; ;
system = currentSystem; system = currentSystem;
lib = inputs.unstable.lib; lib = inputs.unstable.lib;
}; };
docs = import ./docs { docs = import ./docs {
inherit inputs; inherit inputs;
pkgs = unstable; pkgs = unstable;
system = currentSystem; system = currentSystem;
lib = inputs.unstable.lib; lib = inputs.unstable.lib;
build_systems = dashNixLib.build_systems; build_systems = dashNixLib.build_systems;
}; };
dashNixInputs = inputs; dashNixInputs = inputs;
stablePkgs = stable; stablePkgs = stable;
unstablePkgs = unstable; unstablePkgs = unstable;
modules = ./modules; modules = ./modules;
iso = dashNixLib.buildIso.config.system.build.isoImage; iso = dashNixLib.buildIso.config.system.build.isoImage;
}; };
} }

View file

@ -1,41 +1,41 @@
{ {
mkDashDefault, mkDashDefault,
config, config,
lib, lib,
... ...
}: let }: let
username = config.conf.username; username = config.conf.username;
in { in {
manual = { manual = {
html.enable = mkDashDefault false; html.enable = mkDashDefault false;
json.enable = mkDashDefault false; json.enable = mkDashDefault false;
manpages.enable = mkDashDefault false; manpages.enable = mkDashDefault false;
}; };
fonts.fontconfig.enable = mkDashDefault true; fonts.fontconfig.enable = mkDashDefault true;
home = { home = {
username = mkDashDefault username; username = mkDashDefault username;
homeDirectory = mkDashDefault "/home/${username}"; homeDirectory = mkDashDefault "/home/${username}";
sessionPath = ["$HOME/.cargo/bin"]; sessionPath = ["$HOME/.cargo/bin"];
enableNixpkgsReleaseCheck = mkDashDefault false; enableNixpkgsReleaseCheck = mkDashDefault false;
sessionVariables = { sessionVariables = {
GOROOT = mkDashDefault "$HOME/.go"; GOROOT = mkDashDefault "$HOME/.go";
QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct"; QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct";
}; };
keyboard = mkDashDefault null; keyboard = mkDashDefault null;
}; };
programs.nix-index = { programs.nix-index = {
enable = mkDashDefault true; enable = mkDashDefault true;
enableFishIntegration = mkDashDefault true; enableFishIntegration = mkDashDefault true;
}; };
nix = { nix = {
extraOptions = lib.mkIf (config ? sops.secrets && config.sops.secrets ? access.path) '' extraOptions = lib.mkIf (config ? sops.secrets && config.sops.secrets ? access.path) ''
!include ${config.sops.secrets.access.path} !include ${config.sops.secrets.access.path}
''; '';
}; };
} }

View file

@ -1,49 +1,49 @@
{ {
mkDashDefault, mkDashDefault,
additionalHomeConfig, additionalHomeConfig,
additionalHomeMods, additionalHomeMods,
additionalInputs, additionalInputs,
config, config,
homeMods, homeMods,
inputs, inputs,
lib, lib,
mod, mod,
pkgs, pkgs,
root, root,
alternativePkgs, alternativePkgs,
system, system,
stable, stable,
unstable, unstable,
... ...
}: { }: {
xdg = { xdg = {
portal.config.common.default = mkDashDefault "*"; portal.config.common.default = mkDashDefault "*";
portal = { portal = {
enable = mkDashDefault true; enable = mkDashDefault true;
extraPortals = [pkgs.xdg-desktop-portal-gtk]; extraPortals = [pkgs.xdg-desktop-portal-gtk];
}; };
}; };
home-manager = { home-manager = {
useGlobalPkgs = mkDashDefault true; useGlobalPkgs = mkDashDefault true;
useUserPackages = mkDashDefault true; useUserPackages = mkDashDefault true;
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs root additionalInputs alternativePkgs system stable unstable; inherit inputs root additionalInputs alternativePkgs system stable unstable;
mkDashDefault = import ../lib/override.nix {inherit lib;}; mkDashDefault = import ../lib/override.nix {inherit lib;};
}; };
users.${config.conf.username} = { users.${config.conf.username} = {
disabledModules = ["programs/anyrun.nix"]; disabledModules = ["programs/anyrun.nix"];
imports = imports =
[ [
./common.nix ./common.nix
./themes ./themes
./sync.nix ./sync.nix
../lib/foxwrappers.nix ../lib/foxwrappers.nix
] ]
++ homeMods ++ homeMods
++ additionalHomeMods ++ additionalHomeMods
++ lib.optional (builtins.pathExists mod) mod ++ lib.optional (builtins.pathExists mod) mod
++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig; ++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig;
}; };
}; };
} }

View file

@ -1,144 +1,144 @@
{ {
inputs, inputs,
lib, lib,
unstable, unstable,
self, self,
stable, stable,
system, system,
... ...
}: { }: {
/* /*
* *
# build_systems # build_systems
Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well. Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well.
A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration. A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration.
The second parameter is the root of your configuration, which should be ./. in most cases. The second parameter is the root of your configuration, which should be ./. in most cases.
`root` `root`
: the root path of your configuration : the root path of your configuration
# Example usage # Example usage
:::{.example} :::{.example}
```nix ```nix
nixosConfigurations = build_systems { root = ./.; }; nixosConfigurations = build_systems { root = ./.; };
``` ```
::: :::
*/ */
# let # let
# paths = builtins.readDir ; # paths = builtins.readDir ;
# names = lib.lists.remove "default" ( # names = lib.lists.remove "default" (
# map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths) # map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
# ); # );
# in # in
build_systems = { build_systems = {
root, root,
additionalMods ? { additionalMods ? {
nixos = []; nixos = [];
home = []; home = [];
}, },
mods ? { mods ? {
nixos = [ nixos = [
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
inputs.nixos-wsl.nixosModules.default inputs.nixos-wsl.nixosModules.default
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
../base ../base
../home ../home
../modules ../modules
]; ];
home = [ home = [
inputs.anyrun.homeManagerModules.default inputs.anyrun.homeManagerModules.default
inputs.ironbar.homeManagerModules.default inputs.ironbar.homeManagerModules.default
inputs.oxicalc.homeManagerModules.default inputs.oxicalc.homeManagerModules.default
inputs.oxishut.homeManagerModules.default inputs.oxishut.homeManagerModules.default
inputs.oxinoti.homeManagerModules.default inputs.oxinoti.homeManagerModules.default
inputs.oxidash.homeManagerModules.default inputs.oxidash.homeManagerModules.default
inputs.oxipaste.homeManagerModules.default inputs.oxipaste.homeManagerModules.default
inputs.oxirun.homeManagerModules.default inputs.oxirun.homeManagerModules.default
inputs.hyprdock.homeManagerModules.default inputs.hyprdock.homeManagerModules.default
inputs.hyprland.homeManagerModules.default inputs.hyprland.homeManagerModules.default
inputs.reset.homeManagerModules.default inputs.reset.homeManagerModules.default
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.dashvim.homeManagerModules.dashvim inputs.dashvim.homeManagerModules.dashvim
inputs.fancontrol.homeManagerModules.default inputs.fancontrol.homeManagerModules.default
../modules ../modules
]; ];
}, },
additionalInputs ? {}, additionalInputs ? {},
overridePkgs ? false, overridePkgs ? false,
... ...
}: }:
builtins.listToAttrs ( builtins.listToAttrs (
map map
(name: { (name: {
name = name; name = name;
value = let value = let
mod = root + /hosts/${name}/configuration.nix; mod = root + /hosts/${name}/configuration.nix;
additionalNixosConfig = root + /hosts/${name}/hardware.nix; additionalNixosConfig = root + /hosts/${name}/hardware.nix;
additionalHomeConfig = root + /hosts/${name}/home.nix; additionalHomeConfig = root + /hosts/${name}/home.nix;
args = { args = {
inherit inherit
self self
inputs inputs
mod mod
additionalHomeConfig additionalHomeConfig
system system
root root
stable stable
unstable unstable
; ;
pkgs = lib.mkForce ( pkgs = lib.mkForce (
if overridePkgs if overridePkgs
then stable then stable
else unstable else unstable
); );
alternativePkgs = alternativePkgs =
if overridePkgs if overridePkgs
then unstable then unstable
else stable; else stable;
hostName = name; hostName = name;
homeMods = mods.home; homeMods = mods.home;
additionalHomeMods = additionalMods.home; additionalHomeMods = additionalMods.home;
additionalInputs = additionalInputs; additionalInputs = additionalInputs;
mkDashDefault = import ./override.nix {inherit lib;}; mkDashDefault = import ./override.nix {inherit lib;};
}; };
in in
inputs.unstable.lib.nixosSystem { inputs.unstable.lib.nixosSystem {
modules = modules =
[ [
{_module.args = args;} {_module.args = args;}
mod mod
] ]
++ mods.nixos ++ mods.nixos
++ additionalMods.nixos ++ additionalMods.nixos
++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig ++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
++ inputs.unstable.lib.optional (builtins.pathExists mod) mod; ++ inputs.unstable.lib.optional (builtins.pathExists mod) mod;
}; };
}) })
( (
lib.lists.remove "" ( lib.lists.remove "" (
lib.attrsets.mapAttrsToList (name: fType: lib.attrsets.mapAttrsToList (name: fType:
if fType == "directory" if fType == "directory"
then name then name
else "") ( else "") (
builtins.readDir (root + /hosts) builtins.readDir (root + /hosts)
) )
) )
) )
); );
buildIso = inputs.unstable.lib.nixosSystem { buildIso = inputs.unstable.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit self inputs unstable; inherit self inputs unstable;
}; };
modules = [ modules = [
../iso/configuration.nix ../iso/configuration.nix
]; ];
}; };
} }

View file

@ -1,128 +1,128 @@
{ {
mkDashDefault, mkDashDefault,
config, config,
lib, lib,
options, options,
pkgs, pkgs,
... ...
}: { }: {
options.mods = { options.mods = {
basePackages = { basePackages = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
Enables default system packages. Enables default system packages.
''; '';
}; };
additionalPackages = lib.mkOption { additionalPackages = lib.mkOption {
default = []; default = [];
example = [pkgs.openssl]; example = [pkgs.openssl];
type = with lib.types; listOf package; type = with lib.types; listOf package;
description = '' description = ''
Additional packages to install. Additional packages to install.
Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install. Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install.
''; '';
}; };
specialPrograms = lib.mkOption { specialPrograms = lib.mkOption {
default = {}; default = {};
example = {}; example = {};
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
special program configuration to be added which require programs.something notation. special program configuration to be added which require programs.something notation.
''; '';
}; };
specialServices = lib.mkOption { specialServices = lib.mkOption {
default = {}; default = {};
example = {}; example = {};
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
special services configuration to be added which require an services.something notation. special services configuration to be added which require an services.something notation.
''; '';
}; };
}; };
}; };
config = lib.optionalAttrs (options ? environment.systemPackages) { config = lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages = environment.systemPackages =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
with pkgs; with pkgs;
[ [
adwaita-icon-theme adwaita-icon-theme
dbus dbus
dconf dconf
direnv direnv
glib glib
gnome.nixos-gsettings-overrides gnome.nixos-gsettings-overrides
gsettings-desktop-schemas gsettings-desktop-schemas
gtk-layer-shell gtk-layer-shell
gtk3 gtk3
gtk4 gtk4
gtk4-layer-shell gtk4-layer-shell
hicolor-icon-theme hicolor-icon-theme
icon-library icon-library
kdePackages.breeze-icons kdePackages.breeze-icons
kdePackages.breeze kdePackages.breeze
libsForQt5.breeze-qt5 libsForQt5.breeze-qt5
kdePackages.qtstyleplugin-kvantum kdePackages.qtstyleplugin-kvantum
libsForQt5.qtstyleplugin-kvantum libsForQt5.qtstyleplugin-kvantum
libadwaita libadwaita
libxkbcommon libxkbcommon
alejandra alejandra
openssl openssl
seahorse seahorse
upower upower
xorg.xkbutils xorg.xkbutils
sbctl sbctl
] ]
++ config.mods.basePackages.additionalPackages ++ config.mods.basePackages.additionalPackages
else config.mods.basePackages.additionalPackages; else config.mods.basePackages.additionalPackages;
gtk.iconCache.enable = false; gtk.iconCache.enable = false;
services = services =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
{ {
preload.enable = mkDashDefault true; preload.enable = mkDashDefault true;
upower.enable = mkDashDefault true; upower.enable = mkDashDefault true;
dbus = { dbus = {
enable = mkDashDefault true; enable = mkDashDefault true;
}; };
avahi = { avahi = {
enable = mkDashDefault true; enable = mkDashDefault true;
nssmdns4 = mkDashDefault true; nssmdns4 = mkDashDefault true;
openFirewall = mkDashDefault true; openFirewall = mkDashDefault true;
}; };
} }
// config.mods.basePackages.specialServices // config.mods.basePackages.specialServices
else config.mods.basePackages.specialServices; else config.mods.basePackages.specialServices;
programs = programs =
if config.mods.basePackages.enable if config.mods.basePackages.enable
then then
{ {
nix-ld = { nix-ld = {
enable = mkDashDefault true; enable = mkDashDefault true;
libraries = with pkgs; [ libraries = with pkgs; [
jdk jdk
zlib zlib
]; ];
}; };
direnv = { direnv = {
package = mkDashDefault pkgs.direnv; package = mkDashDefault pkgs.direnv;
silent = mkDashDefault false; silent = mkDashDefault false;
loadInNixShell = mkDashDefault true; loadInNixShell = mkDashDefault true;
direnvrcExtra = mkDashDefault ""; direnvrcExtra = mkDashDefault "";
nix-direnv = { nix-direnv = {
enable = mkDashDefault true; enable = mkDashDefault true;
package = mkDashDefault pkgs.nix-direnv; package = mkDashDefault pkgs.nix-direnv;
}; };
}; };
gnupg.agent.enable = mkDashDefault true; gnupg.agent.enable = mkDashDefault true;
} }
// config.mods.basePackages.specialPrograms // config.mods.basePackages.specialPrograms
else config.mods.basePackages.specialPrograms; else config.mods.basePackages.specialPrograms;
}; };
} }

File diff suppressed because it is too large Load diff

View file

@ -1,49 +1,49 @@
{ {
imports = [ imports = [
./acpid.nix ./acpid.nix
./basePackages.nix ./basePackages.nix
./bluetooth.nix ./bluetooth.nix
./browser ./browser
./coding.nix ./coding.nix
./containers.nix ./containers.nix
./drives.nix ./drives.nix
./fancontrol.nix ./fancontrol.nix
./fastfetch.nix ./fastfetch.nix
./fish.nix ./fish.nix
./flatpak.nix ./flatpak.nix
./gaming.nix ./gaming.nix
./gdm.nix ./gdm.nix
./git.nix ./git.nix
./gnome.nix ./gnome.nix
./gnomeServices.nix ./gnomeServices.nix
./gpu.nix ./gpu.nix
./greetd.nix ./greetd.nix
./homePackages.nix ./homePackages.nix
./hyprland ./hyprland
./kde.nix ./kde.nix
./kdeConnect.nix ./kdeConnect.nix
./keepassxc.nix ./keepassxc.nix
./kitty.nix ./kitty.nix
./media.nix ./media.nix
./mime.nix ./mime.nix
./ncspot.nix ./ncspot.nix
./nextcloud.nix ./nextcloud.nix
./oxi ./oxi
./piper.nix ./piper.nix
./plymouth.nix ./plymouth.nix
./printing.nix ./printing.nix
./scripts.nix ./scripts.nix
./sddm.nix ./sddm.nix
./sops.nix ./sops.nix
./starship.nix ./starship.nix
./streamcontroller.nix ./streamcontroller.nix
./stylix.nix ./stylix.nix
./supersonic.nix ./supersonic.nix
./sway.nix ./sway.nix
./teams.nix ./teams.nix
./virtmanager.nix ./virtmanager.nix
./xkb.nix ./xkb.nix
./xone.nix ./xone.nix
./yazi ./yazi
]; ];
} }

View file

@ -1,36 +1,36 @@
{ {
lib, lib,
config, config,
options, options,
... ...
}: { }: {
options.mods.fancontrol = { options.mods.fancontrol = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
example = true; example = true;
type = lib.types.bool; type = lib.types.bool;
description = "Enables fancontrol-gui with needed drivers"; description = "Enables fancontrol-gui with needed drivers";
}; };
forceId = lib.mkOption { forceId = lib.mkOption {
default = null; default = null;
example = "force_id=0x8628"; example = "force_id=0x8628";
type = with lib.types; nullOr str; type = with lib.types; nullOr str;
description = "Modprobe options for the it87 driver. Information at: https://wiki.archlinux.org/title/Lm_sensors#Gigabyte_B250/Z370/B450M/B560M/B660M/Z690/B550_motherboards"; description = "Modprobe options for the it87 driver. Information at: https://wiki.archlinux.org/title/Lm_sensors#Gigabyte_B250/Z370/B450M/B560M/B660M/Z690/B550_motherboards";
}; };
}; };
config = lib.mkIf config.mods.fancontrol.enable ( config = lib.mkIf config.mods.fancontrol.enable (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.fancontrol-gui.enable = true; programs.fancontrol-gui.enable = true;
} }
// (lib.optionalAttrs (options ? boot.kernelModules) { // (lib.optionalAttrs (options ? boot.kernelModules) {
boot = { boot = {
kernelParams = ["acpi_enforce_resources=lax"]; kernelParams = ["acpi_enforce_resources=lax"];
extraModulePackages = with config.boot.kernelPackages; [liquidtux it87]; extraModulePackages = with config.boot.kernelPackages; [liquidtux it87];
kernelModules = ["v4l2loopback" "it87"]; kernelModules = ["v4l2loopback" "it87"];
extraModprobeConfig = lib.mkIf (config.mods.fancontrol.forceId != null) '' extraModprobeConfig = lib.mkIf (config.mods.fancontrol.forceId != null) ''
options it87 ${config.mods.fancontrol.forceId} options it87 ${config.mods.fancontrol.forceId}
''; '';
}; };
}) })
); );
} }

View file

@ -52,6 +52,7 @@ in {
alias rebuild='nh os switch -- --accept-flake-config' alias rebuild='nh os switch -- --accept-flake-config'
alias update='nix flake update --flake $FLAKE --accept-flake-config' alias update='nix flake update --flake $FLAKE --accept-flake-config'
alias gcli='gh'
abbr --add ls 'lsd' abbr --add ls 'lsd'
abbr --add :q 'exit' abbr --add :q 'exit'
abbr --add gh 'git push origin' abbr --add gh 'git push origin'

View file

@ -6,13 +6,13 @@
}: { }: {
options.mods.git = { options.mods.git = {
username = lib.mkOption { username = lib.mkOption {
default = "DashieTM"; default = "";
example = "globi"; example = "globi";
type = lib.types.str; type = lib.types.str;
description = "Git user name"; description = "Git user name";
}; };
email = lib.mkOption { email = lib.mkOption {
default = "fabio.lenherr@gmail.com"; default = "";
example = "globi@globus.glob"; example = "globi@globus.glob";
type = lib.types.str; type = lib.types.str;
description = "Git email"; description = "Git email";

View file

@ -1,402 +1,402 @@
{ {
mkDashDefault, mkDashDefault,
config, config,
lib, lib,
options, options,
pkgs, pkgs,
inputs, inputs,
... ...
}: let }: let
browserName = browserName =
if (builtins.isString config.mods.homePackages.browser) if (builtins.isString config.mods.homePackages.browser)
then config.mods.homePackages.browser then config.mods.homePackages.browser
else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram else if config.mods.homePackages.browser ? meta && config.mods.homePackages.browser.meta ? mainProgram
then config.mods.homePackages.browser.meta.mainProgram then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname; else config.mods.homePackages.browser.pname;
in { in {
options.mods.hyprland = { options.mods.hyprland = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
Enable Hyprland Enable Hyprland
''; '';
}; };
monitor = lib.mkOption { monitor = lib.mkOption {
default = [ default = [
# main monitor # main monitor
"${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}" "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# all others # all others
]; ];
example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"]; example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"];
type = with lib.types; listOf str; type = with lib.types; listOf str;
description = '' description = ''
The monitor configuration for hyprland. The monitor configuration for hyprland.
''; '';
}; };
workspace = lib.mkOption { workspace = lib.mkOption {
default = []; default = [];
example = ["2,monitor:DP-1, default:true"]; example = ["2,monitor:DP-1, default:true"];
type = with lib.types; listOf str; type = with lib.types; listOf str;
description = '' description = ''
The workspace configuration for hyprland. The workspace configuration for hyprland.
''; '';
}; };
noAtomic = lib.mkOption { noAtomic = lib.mkOption {
default = false; default = false;
example = true; example = true;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
Use tearing Use tearing
''; '';
}; };
extraAutostart = lib.mkOption { extraAutostart = lib.mkOption {
default = []; default = [];
example = ["your application"]; example = ["your application"];
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
description = '' description = ''
Extra exec_once. Extra exec_once.
''; '';
}; };
useDefaultConfig = lib.mkOption { useDefaultConfig = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
Use preconfigured Hyprland config. Use preconfigured Hyprland config.
''; '';
}; };
customConfig = lib.mkOption { customConfig = lib.mkOption {
default = {}; default = {};
example = {}; example = {};
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
Custom Hyprland configuration. Custom Hyprland configuration.
Will be merged with default configuration if enabled. Will be merged with default configuration if enabled.
''; '';
}; };
plugins = lib.mkOption { plugins = lib.mkOption {
default = []; default = [];
example = []; example = [];
type = with lib.types; listOf package; type = with lib.types; listOf package;
description = '' description = ''
Plugins to be added to Hyprland. Plugins to be added to Hyprland.
''; '';
}; };
pluginConfig = lib.mkOption { pluginConfig = lib.mkOption {
default = {}; default = {};
example = {}; example = {};
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = '' description = ''
Plugin configuration to be added to Hyprland. Plugin configuration to be added to Hyprland.
''; '';
}; };
hyprspaceEnable = lib.mkOption { hyprspaceEnable = lib.mkOption {
default = false; default = false;
type = lib.types.bool; type = lib.types.bool;
example = true; example = true;
description = '' description = ''
Enables Hyprspace plugin for hyprland. Enables Hyprspace plugin for hyprland.
Please note, plugins tend to break VERY often. Please note, plugins tend to break VERY often.
''; '';
}; };
}; };
config = lib.mkIf config.mods.hyprland.enable ( config = lib.mkIf config.mods.hyprland.enable (
lib.optionalAttrs (options ? wayland.windowManager.hyprland) { lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# install Hyprland related packages # install Hyprland related packages
home.packages = with pkgs; [ home.packages = with pkgs; [
xorg.xprop xorg.xprop
grim grim
slurp slurp
satty satty
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
# xdg-desktop-portal-hyprland # xdg-desktop-portal-hyprland
copyq copyq
wl-clipboard wl-clipboard
hyprcursor hyprcursor
hyprpicker hyprpicker
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
settings = settings =
if config.mods.hyprland.useDefaultConfig if config.mods.hyprland.useDefaultConfig
then then
lib.mkMerge lib.mkMerge
[ [
{ {
"$mod" = "SUPER"; "$mod" = "SUPER";
bindm = [ bindm = [
"$mod, mouse:272, movewindow" "$mod, mouse:272, movewindow"
"$mod, mouse:273, resizeactive" "$mod, mouse:273, resizeactive"
]; ];
bind = [ bind = [
# screenshots # screenshots
''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy'' ''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy''
''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -'' ''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -''
''$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy'' ''$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
# regular programs # regular programs
"$mod SUPER,F,exec,${browserName}" "$mod SUPER,F,exec,${browserName}"
(lib.mkIf ( (lib.mkIf (
browserName == "firefox" || browserName == "zen" browserName == "firefox" || browserName == "zen"
) "$mod SUPERSHIFT,F,exec,${browserName} -p special") ) "$mod SUPERSHIFT,F,exec,${browserName} -p special")
"$mod SUPER,T,exec,kitty -1" "$mod SUPER,T,exec,kitty -1"
"$mod SUPER,E,exec,nautilus -w" "$mod SUPER,E,exec,nautilus -w"
"$mod SUPER,N,exec,neovide" "$mod SUPER,N,exec,neovide"
(lib.mkIf (config.mods.hyprland.anyrun.enable) "$mod SUPER,R,exec,anyrun") (lib.mkIf (config.mods.hyprland.anyrun.enable) "$mod SUPER,R,exec,anyrun")
(lib.mkIf (config.mods.oxi.oxirun.enable) "$mod SUPER,R,exec,oxirun") (lib.mkIf (config.mods.oxi.oxirun.enable) "$mod SUPER,R,exec,oxirun")
(lib.mkIf (config.mods.oxi.oxidash.enable) "$mod SUPER,M,exec,oxidash") (lib.mkIf (config.mods.oxi.oxidash.enable) "$mod SUPER,M,exec,oxidash")
(lib.mkIf (config.mods.oxi.oxicalc.enable) "$mod SUPER,G,exec,oxicalc") (lib.mkIf (config.mods.oxi.oxicalc.enable) "$mod SUPER,G,exec,oxicalc")
(lib.mkIf (config.mods.oxi.oxishut.enable) "$mod SUPER,D,exec,oxishut") (lib.mkIf (config.mods.oxi.oxishut.enable) "$mod SUPER,D,exec,oxishut")
(lib.mkIf (config.mods.oxi.oxipaste.enable) "$mod SUPER,A,exec,oxipaste-iced") (lib.mkIf (config.mods.oxi.oxipaste.enable) "$mod SUPER,A,exec,oxipaste-iced")
(lib.mkIf (config.mods.oxi.hyprdock.enable) "$mod SUPERSHIFT,P,exec,hyprdock --gui") (lib.mkIf (config.mods.oxi.hyprdock.enable) "$mod SUPERSHIFT,P,exec,hyprdock --gui")
"$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend" "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend"
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
# media keys # media keys
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute") (lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute")
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioLowerVolume,exec, audioControl sink -5%") (lib.mkIf config.mods.scripts.audioControl ",XF86AudioLowerVolume,exec, audioControl sink -5%")
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioRaiseVolume,exec, audioControl sink +5%") (lib.mkIf config.mods.scripts.audioControl ",XF86AudioRaiseVolume,exec, audioControl sink +5%")
",XF86AudioPlay,exec, playerctl play-pause" ",XF86AudioPlay,exec, playerctl play-pause"
",XF86AudioNext,exec, playerctl next" ",XF86AudioNext,exec, playerctl next"
",XF86AudioPrev,exec, playerctl previous" ",XF86AudioPrev,exec, playerctl previous"
(lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessDown,exec, changeBrightness brightness 10%-") (lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessDown,exec, changeBrightness brightness 10%-")
(lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessUp,exec, changeBrightness brightness +10%") (lib.mkIf config.mods.scripts.changeBrightness ",XF86MonBrightnessUp,exec, changeBrightness brightness +10%")
# hyprland keybinds # hyprland keybinds
# misc # misc
"$mod SUPER,V,togglefloating," "$mod SUPER,V,togglefloating,"
"$mod SUPER,B,fullscreen," "$mod SUPER,B,fullscreen,"
"$mod SUPER,C,togglesplit" "$mod SUPER,C,togglesplit"
"$mod SUPER,Q,killactive," "$mod SUPER,Q,killactive,"
"$mod SUPERSHIFTALT,M,exit," "$mod SUPERSHIFTALT,M,exit,"
"$mod SUPERSHIFT,W,togglespecialworkspace" "$mod SUPERSHIFT,W,togglespecialworkspace"
# move # move
"$mod SUPER,left,movewindow,l" "$mod SUPER,left,movewindow,l"
"$mod SUPER,right,movewindow,r" "$mod SUPER,right,movewindow,r"
"$mod SUPER,up,movewindow,u" "$mod SUPER,up,movewindow,u"
"$mod SUPER,down,movewindow,d" "$mod SUPER,down,movewindow,d"
# workspaces # workspaces
"$mod SUPER,1,workspace,1" "$mod SUPER,1,workspace,1"
"$mod SUPER,2,workspace,2" "$mod SUPER,2,workspace,2"
"$mod SUPER,3,workspace,3" "$mod SUPER,3,workspace,3"
"$mod SUPER,4,workspace,4" "$mod SUPER,4,workspace,4"
"$mod SUPER,5,workspace,5" "$mod SUPER,5,workspace,5"
"$mod SUPER,6,workspace,6" "$mod SUPER,6,workspace,6"
"$mod SUPER,7,workspace,7" "$mod SUPER,7,workspace,7"
"$mod SUPER,8,workspace,8" "$mod SUPER,8,workspace,8"
"$mod SUPER,9,workspace,9" "$mod SUPER,9,workspace,9"
"$mod SUPER,0,workspace,10" "$mod SUPER,0,workspace,10"
# move to workspace # move to workspace
"$mod SUPERSHIFT,1,movetoworkspace,1" "$mod SUPERSHIFT,1,movetoworkspace,1"
"$mod SUPERSHIFT,2,movetoworkspace,2" "$mod SUPERSHIFT,2,movetoworkspace,2"
"$mod SUPERSHIFT,3,movetoworkspace,3" "$mod SUPERSHIFT,3,movetoworkspace,3"
"$mod SUPERSHIFT,4,movetoworkspace,4" "$mod SUPERSHIFT,4,movetoworkspace,4"
"$mod SUPERSHIFT,5,movetoworkspace,5" "$mod SUPERSHIFT,5,movetoworkspace,5"
"$mod SUPERSHIFT,6,movetoworkspace,6" "$mod SUPERSHIFT,6,movetoworkspace,6"
"$mod SUPERSHIFT,7,movetoworkspace,7" "$mod SUPERSHIFT,7,movetoworkspace,7"
"$mod SUPERSHIFT,8,movetoworkspace,8" "$mod SUPERSHIFT,8,movetoworkspace,8"
"$mod SUPERSHIFT,9,movetoworkspace,9" "$mod SUPERSHIFT,9,movetoworkspace,9"
"$mod SUPERSHIFT,0,movetoworkspace,10" "$mod SUPERSHIFT,0,movetoworkspace,10"
# move to workspace silent # move to workspace silent
"$mod SUPERSHIFTALT,1,movetoworkspacesilent,1" "$mod SUPERSHIFTALT,1,movetoworkspacesilent,1"
"$mod SUPERSHIFTALT,2,movetoworkspacesilent,2" "$mod SUPERSHIFTALT,2,movetoworkspacesilent,2"
"$mod SUPERSHIFTALT,3,movetoworkspacesilent,3" "$mod SUPERSHIFTALT,3,movetoworkspacesilent,3"
"$mod SUPERSHIFTALT,4,movetoworkspacesilent,4" "$mod SUPERSHIFTALT,4,movetoworkspacesilent,4"
"$mod SUPERSHIFTALT,5,movetoworkspacesilent,5" "$mod SUPERSHIFTALT,5,movetoworkspacesilent,5"
"$mod SUPERSHIFTALT,6,movetoworkspacesilent,6" "$mod SUPERSHIFTALT,6,movetoworkspacesilent,6"
"$mod SUPERSHIFTALT,7,movetoworkspacesilent,7" "$mod SUPERSHIFTALT,7,movetoworkspacesilent,7"
"$mod SUPERSHIFTALT,8,movetoworkspacesilent,8" "$mod SUPERSHIFTALT,8,movetoworkspacesilent,8"
"$mod SUPERSHIFTALT,9,movetoworkspacesilent,9" "$mod SUPERSHIFTALT,9,movetoworkspacesilent,9"
"$mod SUPERSHIFTALT,0,movetoworkspacesilent,10" "$mod SUPERSHIFTALT,0,movetoworkspacesilent,10"
# preselection # preselection
"$mod SUPERALT,j,layoutmsg,preselect l" "$mod SUPERALT,j,layoutmsg,preselect l"
"$mod SUPERALT,k,layoutmsg,preselect d" "$mod SUPERALT,k,layoutmsg,preselect d"
"$mod SUPERALT,l,layoutmsg,preselect u" "$mod SUPERALT,l,layoutmsg,preselect u"
"$mod SUPERALT,semicolon,layoutmsg,preselect r" "$mod SUPERALT,semicolon,layoutmsg,preselect r"
"$mod SUPERALT,h,layoutmsg,preselect n" "$mod SUPERALT,h,layoutmsg,preselect n"
]; ];
binde = [ binde = [
# hyprland keybinds # hyprland keybinds
# focus # focus
"$mod SUPER,J,movefocus,l" "$mod SUPER,J,movefocus,l"
"$mod SUPER,semicolon,movefocus,r" "$mod SUPER,semicolon,movefocus,r"
"$mod SUPER,L,movefocus,u" "$mod SUPER,L,movefocus,u"
"$mod SUPER,K,movefocus,d" "$mod SUPER,K,movefocus,d"
# resize # resize
"$mod SUPER,U,resizeactive,-20 0" "$mod SUPER,U,resizeactive,-20 0"
"$mod SUPER,P,resizeactive,20 0" "$mod SUPER,P,resizeactive,20 0"
"$mod SUPER,O,resizeactive,0 -20" "$mod SUPER,O,resizeactive,0 -20"
"$mod SUPER,I,resizeactive,0 20" "$mod SUPER,I,resizeactive,0 20"
]; ];
general = { general = {
gaps_out = "3,5,5,5"; gaps_out = "3,5,5,5";
border_size = 3; border_size = 3;
"col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg"; "col.active_border" = lib.mkOverride 51 "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
# "col.inactive_border" = "0x66333333"; # "col.inactive_border" = "0x66333333";
allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true; allow_tearing = lib.mkIf config.mods.hyprland.noAtomic true;
}; };
decoration = { decoration = {
rounding = 4; rounding = 4;
}; };
animations = { animations = {
bezier = "penguin,0.05,0.9,0.1,1.0"; bezier = "penguin,0.05,0.9,0.1,1.0";
animation = [ animation = [
"windowsMove,1,4,default" "windowsMove,1,4,default"
"windows,1,7,default,popin 70%" "windows,1,7,default,popin 70%"
"windowsOut,1,7,default,popin 70%" "windowsOut,1,7,default,popin 70%"
"border,1,10,default" "border,1,10,default"
"fade,1,7,default" "fade,1,7,default"
"workspaces,1,6,default" "workspaces,1,6,default"
"layers,1,3,default,popin" "layers,1,3,default,popin"
]; ];
}; };
dwindle = { dwindle = {
preserve_split = true; preserve_split = true;
pseudotile = 0; pseudotile = 0;
permanent_direction_override = false; permanent_direction_override = false;
}; };
input = { input = {
kb_layout = "${config.mods.xkb.layout}"; kb_layout = "${config.mods.xkb.layout}";
kb_variant = "${config.mods.xkb.variant}"; kb_variant = "${config.mods.xkb.variant}";
repeat_delay = 200; repeat_delay = 200;
force_no_accel = true; force_no_accel = true;
touchpad = { touchpad = {
natural_scroll = true; natural_scroll = true;
tap-to-click = true; tap-to-click = true;
tap-and-drag = true; tap-and-drag = true;
}; };
}; };
misc = { misc = {
animate_manual_resizes = 1; animate_manual_resizes = 1;
enable_swallow = true; enable_swallow = true;
disable_splash_rendering = true; disable_splash_rendering = true;
disable_hyprland_logo = true; disable_hyprland_logo = true;
swallow_regex = "^(.*)(kitty)(.*)$"; swallow_regex = "^(.*)(kitty)(.*)$";
initial_workspace_tracking = 1; initial_workspace_tracking = 1;
# just doesn't work # just doesn't work
enable_anr_dialog = false; enable_anr_dialog = false;
}; };
cursor = { cursor = {
enable_hyprcursor = true; enable_hyprcursor = true;
no_hardware_cursors = mkDashDefault config.mods.gpu.nvidia.enable; no_hardware_cursors = mkDashDefault config.mods.gpu.nvidia.enable;
# done with nix, this would break the current setup otherwise # done with nix, this would break the current setup otherwise
sync_gsettings_theme = false; sync_gsettings_theme = false;
}; };
gestures = { gestures = {
workspace_swipe = true; workspace_swipe = true;
}; };
monitor = config.mods.hyprland.monitor; monitor = config.mods.hyprland.monitor;
workspace = config.mods.hyprland.workspace; workspace = config.mods.hyprland.workspace;
env = [ env = [
"GTK_CSD,0" "GTK_CSD,0"
''TERM,"kitty /bin/fish"'' ''TERM,"kitty /bin/fish"''
"XDG_CURRENT_DESKTOP=Hyprland" "XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland" "XDG_SESSION_TYPE=wayland"
"XDG_SESSION_DESKTOP=Hyprland" "XDG_SESSION_DESKTOP=Hyprland"
"HYPRCURSOR_THEME,${config.mods.stylix.cursor.name}" "HYPRCURSOR_THEME,${config.mods.stylix.cursor.name}"
"HYPRCURSOR_SIZE,${toString config.mods.stylix.cursor.size}" "HYPRCURSOR_SIZE,${toString config.mods.stylix.cursor.size}"
"XCURSOR_THEME,${config.mods.stylix.cursor.name}" "XCURSOR_THEME,${config.mods.stylix.cursor.name}"
"XCURSOR_SIZE,${toString config.mods.stylix.cursor.size}" "XCURSOR_SIZE,${toString config.mods.stylix.cursor.size}"
"QT_QPA_PLATFORM,wayland" "QT_QPA_PLATFORM,wayland"
"QT_QPA_PLATFORMTHEME,qt5ct" "QT_QPA_PLATFORMTHEME,qt5ct"
"QT_WAYLAND_FORCE_DPI,96" "QT_WAYLAND_FORCE_DPI,96"
"QT_AUTO_SCREEN_SCALE_FACTOR,0" "QT_AUTO_SCREEN_SCALE_FACTOR,0"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1" "QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_SCALE_FACTOR,1" "QT_SCALE_FACTOR,1"
''EDITOR,"neovide --novsync --nofork"'' ''EDITOR,"neovide --novsync --nofork"''
(lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1") (lib.mkIf config.mods.hyprland.noAtomic "WLR_DRM_NO_ATOMIC,1")
"GTK_USE_PORTAL, 1" "GTK_USE_PORTAL, 1"
(lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia") (lib.mkIf config.mods.gpu.nvidia.enable "LIBVA_DRIVER_NAME,nvidia")
(lib.mkIf config.mods.gpu.nvidia.enable "XDG_SESSION_TYPE,wayland") (lib.mkIf config.mods.gpu.nvidia.enable "XDG_SESSION_TYPE,wayland")
(lib.mkIf config.mods.gpu.nvidia.enable "GBM_BACKEND,nvidia-drm") (lib.mkIf config.mods.gpu.nvidia.enable "GBM_BACKEND,nvidia-drm")
(lib.mkIf config.mods.gpu.nvidia.enable "__GLX_VENDOR_LIBRARY_NAME,nvidia") (lib.mkIf config.mods.gpu.nvidia.enable "__GLX_VENDOR_LIBRARY_NAME,nvidia")
]; ];
layerrule = [ layerrule = [
# layer rules # layer rules
# mainly to disable animations within slurp and grim # mainly to disable animations within slurp and grim
"noanim, selection" "noanim, selection"
]; ];
windowrule = [ windowrule = [
# window rules # window rules
"float,class:^(.*)(OxiCalc)(.*)$" "float,class:^(.*)(OxiCalc)(.*)$"
"float,class:^(.*)(winecfg.exe)(.*)$" "float,class:^(.*)(winecfg.exe)(.*)$"
"float,class:^(.*)(copyq)(.*)$" "float,class:^(.*)(copyq)(.*)$"
"center,class:^(.*)(swappy)(.*)$" "center,class:^(.*)(swappy)(.*)$"
"float,title:^(.*)(reset)(.*)$" "float,title:^(.*)(reset)(.*)$"
"workspace 10 silent,class:^(.*)(steam)(.*)$" "workspace 10 silent,class:^(.*)(steam)(.*)$"
"workspace 9 silent,class:^(.*)(dota)(.*)$" "workspace 9 silent,class:^(.*)(dota)(.*)$"
"workspace 9 silent,class:^(.*)(battlebits)(.*)$" "workspace 9 silent,class:^(.*)(battlebits)(.*)$"
"workspace 9 silent,class:^(.*)(aoe)(.*)$" "workspace 9 silent,class:^(.*)(aoe)(.*)$"
"suppressevent fullscreen maximize,class:^(.*)(neovide)(.*)$" "suppressevent fullscreen maximize,class:^(.*)(neovide)(.*)$"
"immediate,class:^(.*)(Pal)$" "immediate,class:^(.*)(Pal)$"
"immediate,class:^(.*)(dota2)$" "immediate,class:^(.*)(dota2)$"
"immediate,class:^(.*)(needforspeedheat.exe)$" "immediate,class:^(.*)(needforspeedheat.exe)$"
]; ];
exec-once = exec-once =
[ [
# environment # environment
"systemctl --user import-environment" "systemctl --user import-environment"
"dbus-update-activation-environment --systemd --all" "dbus-update-activation-environment --systemd --all"
"hyprctl setcursor Bibata-Modern-Classic 24" "hyprctl setcursor Bibata-Modern-Classic 24"
# other programs # other programs
"hyprpaper" "hyprpaper"
"ironbar" "ironbar"
"${browserName}" "${browserName}"
"oxipaste_daemon" "oxipaste_daemon"
"oxinoti" "oxinoti"
] ]
++ config.mods.hyprland.extraAutostart; ++ config.mods.hyprland.extraAutostart;
plugin = plugin =
lib.mkMerge lib.mkMerge
[ [
{ {
hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable {
bind = [ bind = [
"SUPER, W, overview:toggle, toggle" "SUPER, W, overview:toggle, toggle"
]; ];
}; };
} }
config.mods.hyprland.pluginConfig config.mods.hyprland.pluginConfig
]; ];
} }
config.mods.hyprland.customConfig config.mods.hyprland.customConfig
] ]
else lib.mkForce config.mods.hyprland.customConfig; else lib.mkForce config.mods.hyprland.customConfig;
plugins = plugins =
[ [
(lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace) (lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace)
] ]
++ config.mods.hyprland.plugins; ++ config.mods.hyprland.plugins;
}; };
} }
); );
} }