chore: cleanup all files

This commit is contained in:
DashieTM 2025-05-11 13:57:38 +02:00
parent f4e47cbf97
commit 9cc9955425
43 changed files with 2893 additions and 2834 deletions

View file

@ -1,175 +1,175 @@
{ {
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://chaotic-nyx.cachix.org/" "https://chaotic-nyx.cachix.org/"
]; ];
trusted-substituters = [ trusted-substituters = [
"https://hyprland.cachix.org" "https://hyprland.cachix.org"
"https://anyrun.cachix.org" "https://anyrun.cachix.org"
"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"
]; ];
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="
"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;
}; };
}; };
} }

View file

@ -1,23 +1,23 @@
{ {
mkDashDefault, mkDashDefault,
pkgs, pkgs,
... ...
}: let }: let
layout = pkgs.writeText "enIntUmlaut" '' layout = pkgs.writeText "enIntUmlaut" ''
xkb_symbols "enIntUmlaut" xkb_symbols "enIntUmlaut"
{ {
include "us(basic)" include "us(basic)"
include "level3(ralt_switch)" include "level3(ralt_switch)"
key <AC01> { [ a, A, adiaeresis, Adiaeresis ] }; key <AC01> { [ a, A, adiaeresis, Adiaeresis ] };
key <AD09> { [ o, O, odiaeresis, Odiaeresis ] }; key <AD09> { [ o, O, odiaeresis, Odiaeresis ] };
key <AD07> { [ u, U, udiaeresis, Udiaeresis ] }; key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
}; };
''; '';
in { in {
environment.systemPackages = mkDashDefault [pkgs.xorg.xkbcomp]; environment.systemPackages = mkDashDefault [pkgs.xorg.xkbcomp];
services.xserver.xkb.extraLayouts.enIntUmlaut = { services.xserver.xkb.extraLayouts.enIntUmlaut = {
description = "US layout with 'umlaut'"; description = "US layout with 'umlaut'";
languages = ["eng"]; languages = ["eng"];
symbolsFile = "${layout}"; symbolsFile = "${layout}";
}; };
} }

View file

@ -1,4 +1,3 @@
<div align = center> <div align = center>
![Logo of DashNix](logo.svg) ![Logo of DashNix](logo.svg)
@ -7,7 +6,6 @@
An opinionated flake to bootstrap NixOS systems with default configurations for various programs and services from both NixOS and HomeManager which can be enabled, disabled, configured or replaced at will. An opinionated flake to bootstrap NixOS systems with default configurations for various programs and services from both NixOS and HomeManager which can be enabled, disabled, configured or replaced at will.
# Usage # Usage
This flake is intended to be used as an input to your own NixOS configuration: This flake is intended to be used as an input to your own NixOS configuration:
@ -57,26 +55,52 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
```nix ```nix
{config, ...}: { {config, ...}: {
# TODO denote important changes
# variables for system # variables for system
# TODO important changes
conf = { conf = {
# change this to your monitor and your pc name # TODO your username
# should be something like DP-1
defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# your username
username = "YOURNAME"; username = "YOURNAME";
# TODO only needed when you use intel -> amd is default # TODO only needed when you use intel -> amd is default
# cpu = "intel"; # cpu = "intel";
# TODO your xkb layout
locale = "something.UTF-8"; locale = "something.UTF-8";
# TODO your timezone
timezone = "CONTINENT/CITY"; timezone = "CONTINENT/CITY";
}; };
# modules # modules
mods = { mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different # default disk config has root home boot and swap partition, overwrite if you want something different
sops.enable = false;
nextcloud.enable = false;
hypr.hyprland = {
# TODO monitor configuration for hyprland (hyprland is default)
# should be something like DP-1
defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# additional configruation can be done as well
# customConfig = {
# monitor = [
# # default
# "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}"
# # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# }
};
gpu.nvidia.enable = true;
kdeConnect.enable = true;
# login manager:
# default is greetd
# greetd = { };
# sddm = { };
# gdm = { };
drives = { drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below # for an example without HOME see below
@ -99,29 +123,9 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang
# }; # };
# } # }
# ]; # ];
# You can also use disko to format your disks on installation. # You can also use disko to format your disks on installation.
# Please refer to the Documentation about the drives module for an example. # Please refer to the Documentation about the drives module for an example.
}; };
sops.enable = false;
nextcloud.enable = false;
# default hyprland monitor config -> uncomment when necessary
# TODO: Add more monitors when needed
# hyprland.monitor = [
# # default
# "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# or amd, whatever you have
gpu.nvidia.enable = true;
kdeConnect.enable = true;
# login manager:
# default is greetd
# greetd = { };
# sddm = { };
# gdm = { };
}; };
} }
``` ```
@ -186,7 +190,7 @@ This can be done with the overridePkgs flag for the lib function:
``` ```
You can now place your systems in the respective directories. You can now place your systems in the respective directories.
Keep in mind that the hosts directory will still need to exist in each variant. Keep in mind that the hosts directory will still need to exist in each variant.
E.g. stable/hosts/yourserver and unstable/hosts/yourdesktop E.g. stable/hosts/yourserver and unstable/hosts/yourdesktop
# Installation # Installation
@ -212,7 +216,7 @@ Installation via manual configuration:
```sh ```sh
sudo nixos-install --flake <flakelocation>#<hostname> --root <mountpoint> sudo nixos-install --flake <flakelocation>#<hostname> --root <mountpoint>
#example #example
#nixos-install --flake ~/config#globi --root /mnt #nixos-install --flake ~/config#globi --root /mnt
``` ```
Installation via disko: Installation via disko:

View file

@ -1,71 +1,43 @@
{config, ...}: { {config, ...}: {
# TODO denote important changes
# variables for system # variables for system
# TODO important changes
conf = { conf = {
# change this to your monitor and your pc name # TODO your username
# should be something like DP-1
defaultMonitor = "YOURMONITOR";
# width x height @ refreshrate
defaultMonitorMode = "1920x1080@60";
# scale for your main monitor
defaultMonitorScale = "1";
# your username
username = "YOURNAME"; username = "YOURNAME";
# TODO only needed when you use intel -> amd is default # TODO only needed when you use intel -> amd is default
# cpu = "intel"; # cpu = "intel";
# TODO your xkb layout
locale = "something.UTF-8"; locale = "something.UTF-8";
# TODO your timezone
timezone = "CONTINENT/CITY"; timezone = "CONTINENT/CITY";
}; };
# modules # modules
mods = { mods = {
# default disk config has root home boot and swap partition, overwrite if you want something different # default disk config has root home boot and swap partition, overwrite if you want something different
drives = {
# WARNING: Only do this when installing for the first time, as I am not sure if disko would format your disk
variant = "disko";
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below
#defaultDrives.enable = false;
#extraDrives = [
# {
# name = "boot";
# drive = {
# device = "/dev/disk/by-label/BOOT";
# fsType = "vfat";
# options = [
# "rw"
# "fmask=0022"
# "dmask=0022"
# "noatime"
# ];
# };
# }
# {
# name = "";
# drive = {
# device = "/dev/disk/by-label/ROOT";
# fsType = "ext4";
# options = [
# "noatime"
# "nodiratime"
# "discard"
# ];
# };
# }
#];
};
sops.enable = false; sops.enable = false;
nextcloud.enable = false; nextcloud.enable = false;
# default hyprland monitor config -> uncomment when necessary hypr.hyprland = {
# TODO: Add more monitors when needed # TODO monitor configuration for hyprland (hyprland is default)
# hyprland.monitor = [ # should be something like DP-1
# # default defaultMonitor = "YOURMONITOR";
# "${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}" # width x height @ refreshrate
# # second example monitor defaultMonitorMode = "1920x1080@60";
# "DP-2,3440x1440@180,auto,1" # scale for your main monitor
# # all others defaultMonitorScale = "1";
# ",highrr,auto,1" # additional configruation can be done as well
# ]; # customConfig = {
# or amd, whatever you have # monitor = [
# # default
# "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}"
# # second example monitor
# "DP-2,3440x1440@180,auto,1"
# # all others
# ",highrr,auto,1"
# ];
# }
};
gpu.nvidia.enable = true; gpu.nvidia.enable = true;
kdeConnect.enable = true; kdeConnect.enable = true;
# login manager: # login manager:
@ -73,5 +45,30 @@
# greetd = { }; # greetd = { };
# sddm = { }; # sddm = { };
# gdm = { }; # gdm = { };
drives = {
# default assumes ROOT, BOOT, HOME and SWAP labaled drives exist
# for an example without HOME see below
# defaultDrives.enable = false;
# extraDrives = [
# {
# name = "boot";
# drive = {
# device = "/dev/disk/by-label/BOOT";
# fsType = "vfat";
# options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ];
# };
# }
# {
# name = "";
# drive = {
# device = "/dev/disk/by-label/ROOT";
# fsType = "ext4";
# options = [ "noatime" "nodiratime" "discard" ];
# };
# }
# ];
# You can also use disko to format your disks on installation.
# Please refer to the Documentation about the drives module for an example.
};
}; };
} }

253
flake.nix
View file

@ -1,130 +1,123 @@
{ {
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 = { # Darkreader requires es20, hence a stable pin
url = "github:nix-community/home-manager"; pkgsDarkreader.url = "github:NixOs/nixpkgs/nixos-24.11";
inputs.nixpkgs.follows = "unstable";
}; home-manager = {
url = "github:nix-community/home-manager";
sops-nix.url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "unstable";
};
Hyprspace = {
url = "github:KZDKM/Hyprspace"; sops-nix.url = "github:Mic92/sops-nix";
inputs.hyprland.follows = "hyprland";
}; Hyprspace = {
url = "github:KZDKM/Hyprspace";
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; inputs.hyprland.follows = "hyprland";
};
ironbar = {
url = "github:JakeStanger/ironbar"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
inputs.nixpkgs.follows = "unstable";
}; ironbar = {
url = "github:JakeStanger/ironbar";
zen-browser.url = "github:youwen5/zen-browser-flake"; inputs.nixpkgs.follows = "unstable";
};
# TODO move to upstream repository after merged nix flake pr
fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake"; zen-browser.url = "github:youwen5/zen-browser-flake";
stylix.url = "github:danth/stylix"; # TODO move to upstream repository after merged nix flake pr
base16.url = "github:SenchoPens/base16.nix"; fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake";
disko.url = "github:nix-community/disko/latest";
stylix.url = "github:danth/stylix";
anyrun.url = "github:Kirottu/anyrun"; base16.url = "github:SenchoPens/base16.nix";
oxicalc.url = "github:Xetibo/OxiCalc"; disko.url = "github:nix-community/disko/latest";
oxishut.url = "github:Xetibo/OxiShut";
oxinoti.url = "github:Xetibo/OxiNoti"; anyrun.url = "github:Kirottu/anyrun";
oxidash.url = "github:Xetibo/OxiDash"; oxicalc.url = "github:Xetibo/OxiCalc";
oxipaste.url = "github:Xetibo/OxiPaste"; oxishut.url = "github:Xetibo/OxiShut";
oxirun.url = "github:Xetibo/OxiRun"; oxinoti.url = "github:Xetibo/OxiNoti";
hyprdock.url = "github:Xetibo/hyprdock"; oxidash.url = "github:Xetibo/OxiDash";
reset.url = "github:Xetibo/ReSet"; oxipaste.url = "github:Xetibo/OxiPaste";
reset-plugins.url = "github:Xetibo/ReSet-Plugins"; oxirun.url = "github:Xetibo/OxiRun";
hyprdock.url = "github:Xetibo/hyprdock";
# absolute insanity reset.url = "github:Xetibo/ReSet";
chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; reset-plugins.url = "github:Xetibo/ReSet-Plugins";
dashvim = { # absolute insanity
url = "github:Xetibo/DashVim"; chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
};
}; dashvim = {
url = "github:Xetibo/DashVim";
outputs = {self, ...} @ inputs: let };
currentSystem = "x86_64-linux"; };
permittedPackages = [
"olm-3.2.16" outputs = {self, ...} @ inputs: let
# well done dotnet... currentSystem = "x86_64-linux";
# this is just for omnisharp permittedPackages = [
"dotnet-core-combined" "olm-3.2.16"
"dotnet-wrapped-combined" # well done dotnet...
"dotnet-combined" # this is just for omnisharp
"dotnet-sdk-6.0.428" "dotnet-core-combined"
"dotnet-sdk-wrapped-6.0.428" "dotnet-wrapped-combined"
"dotnet-sdk-6.0.136" "dotnet-combined"
"dotnet-sdk-wrapped-6.0.136" "dotnet-sdk-6.0.428"
"dotnet-sdk-7.0.120" "dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-wrapped-7.0.120" "dotnet-sdk-6.0.136"
"dotnet-sdk-7.0.410" "dotnet-sdk-wrapped-6.0.136"
"dotnet-sdk-wrapped-7.0.410" "dotnet-sdk-7.0.120"
"jitsi-meet-1.0.8043" "dotnet-sdk-wrapped-7.0.120"
"nextcloud-27.1.11" "dotnet-sdk-7.0.410"
]; "dotnet-sdk-wrapped-7.0.410"
stable = import inputs.stable { "jitsi-meet-1.0.8043"
system = currentSystem; "nextcloud-27.1.11"
config = { ];
allowUnfree = true; stable = import ./lib/importPkgs.nix {
permittedInsecurePackages = permittedPackages; inherit inputs permittedPackages currentSystem;
}; pkgs = inputs.stable;
overlays = [ };
inputs.nur.overlays.default unstable = import ./lib/importPkgs.nix {
inputs.chaoticNyx.overlays.default inherit inputs permittedPackages currentSystem;
]; pkgs = inputs.unstable;
}; };
unstable = import inputs.unstable { pkgsDarkreader = import ./lib/importPkgs.nix {
system = currentSystem; inherit inputs permittedPackages currentSystem;
config = { pkgs = inputs.pkgsDarkreader;
allowUnsupportedSystem = true; };
permittedInsecurePackages = permittedPackages; in rec {
# Often happens with neovim, this should not block everything. dashNixLib = import ./lib {
allowBroken = true; inherit
allowUnfree = true; self
}; inputs
overlays = [ unstable
inputs.nur.overlays.default stable
inputs.chaoticNyx.overlays.default ;
]; dashNixAdditionalProps = {
}; inherit pkgsDarkreader;
in rec { };
dashNixLib = import ./lib { system = currentSystem;
inherit lib = inputs.unstable.lib;
self };
inputs docs = import ./docs {
unstable inherit inputs;
stable pkgs = unstable;
; system = currentSystem;
system = currentSystem; lib = inputs.unstable.lib;
lib = inputs.unstable.lib; buildSystems = dashNixLib.buildSystems;
}; };
docs = import ./docs { dashNixInputs = inputs;
inherit inputs; stablePkgs = stable;
pkgs = unstable; unstablePkgs = unstable;
system = currentSystem; modules = ./modules;
lib = inputs.unstable.lib; iso = dashNixLib.buildIso.config.system.build.isoImage;
buildSystems = dashNixLib.buildSystems; };
}; }
dashNixInputs = inputs;
stablePkgs = stable;
unstablePkgs = unstable;
modules = ./modules;
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,59 @@
{ {
mkDashDefault, mkDashDefault,
additionalHomeConfig, additionalHomeConfig,
additionalHomeMods, additionalHomeMods,
additionalInputs, additionalInputs,
config, dashNixAdditionalProps,
homeMods, config,
inputs, homeMods,
lib, inputs,
mod, lib,
pkgs, mod,
root, pkgs,
alternativePkgs, root,
system, alternativePkgs,
stable, system,
unstable, stable,
... unstable,
}: { ...
xdg = { }: {
portal.config.common.default = mkDashDefault "*"; xdg = {
portal = { portal.config.common.default = mkDashDefault "*";
enable = mkDashDefault true; portal = {
extraPortals = [pkgs.xdg-desktop-portal-gtk]; enable = mkDashDefault true;
}; extraPortals = [pkgs.xdg-desktop-portal-gtk];
}; };
home-manager = { };
useGlobalPkgs = mkDashDefault true; home-manager = {
useUserPackages = mkDashDefault true; useGlobalPkgs = mkDashDefault true;
extraSpecialArgs = { useUserPackages = mkDashDefault true;
inherit inputs root additionalInputs alternativePkgs system stable unstable; extraSpecialArgs = {
mkDashDefault = import ../lib/override.nix {inherit lib;}; inherit
}; inputs
root
users.${config.conf.username} = { additionalInputs
disabledModules = ["programs/anyrun.nix"]; alternativePkgs
imports = system
[ stable
./common.nix unstable
./themes dashNixAdditionalProps
./sync.nix ;
../lib/foxwrappers.nix mkDashDefault = import ../lib/override.nix {inherit lib;};
] };
++ homeMods
++ additionalHomeMods users.${config.conf.username} = {
++ lib.optional (builtins.pathExists mod) mod disabledModules = ["programs/anyrun.nix"];
++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig; imports =
}; [
}; ./common.nix
} ./themes
./sync.nix
../lib/foxwrappers.nix
]
++ homeMods
++ additionalHomeMods
++ lib.optional (builtins.pathExists mod) mod
++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig;
};
};
}

View file

@ -289,37 +289,41 @@
} }
''; '';
browsername = config.mods.homePackages.browser; browsername = config.mods.homePackages.browser;
profiles = profiles =
if config.mods.homePackages.browser == "firefox" then if config.mods.homePackages.browser == "firefox"
config.mods.browser.firefox.profiles then config.mods.browser.firefox.profiles
else if config.mods.homePackages.browser == "zen" then else if config.mods.homePackages.browser == "zen"
config.mods.browser.zen.profiles then config.mods.browser.zen.profiles
else if config.mods.homePackages.browser == "librewolf" then else if config.mods.homePackages.browser == "librewolf"
[{name = "default"; value = {};}] then [
else {
[]; name = "default";
value = {};
}
]
else [];
profileNamesFn = profileNamesFn =
builtins.catAttrs "name"; builtins.catAttrs "name";
chromesFn = builtins.map ( chromesFn = builtins.map (
name: name:
if (builtins.isString browsername) if (builtins.isString browsername)
then { then {
".${browsername}/${name}/chrome/userContent.css" = { ".${browsername}/${name}/chrome/userContent.css" = {
text = userChrome; text = userChrome;
}; };
".${browsername}/${name}/chrome/userChrome.css" = { ".${browsername}/${name}/chrome/userChrome.css" = {
text = userContent; text = userContent;
}; };
} }
else {} else {}
); );
moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {}; moduleFn = lib.lists.foldr (attr1: attr2: attr1 // attr2) {};
mkFirefoxTheme = (profiles: mkFirefoxTheme = (
profiles profiles:
|> profileNamesFn profiles
|> chromesFn |> profileNamesFn
|> moduleFn |> chromesFn
); |> moduleFn
in );
{home.file = mkFirefoxTheme profiles;} in {home.file = mkFirefoxTheme profiles;}

View file

@ -1,144 +1,146 @@
{ {
inputs, inputs,
lib, lib,
unstable, unstable,
self, self,
stable, stable,
system, system,
... dashNixAdditionalProps ? {},
}: { ...
/* }: {
* /*
# buildSystems *
# buildSystems
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} # Example usage
```nix :::{.example}
nixosConfigurations = buildSystems { root = ./.; }; ```nix
``` nixosConfigurations = buildSystems { root = ./.; };
::: ```
*/ :::
# let */
# paths = builtins.readDir ; # let
# names = lib.lists.remove "default" ( # paths = builtins.readDir ;
# map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths) # names = lib.lists.remove "default" (
# ); # map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
# );
# in
buildSystems = { # in
root, buildSystems = {
additionalMods ? { root,
nixos = []; additionalMods ? {
home = []; nixos = [];
}, home = [];
mods ? { },
nixos = [ mods ? {
inputs.lanzaboote.nixosModules.lanzaboote nixos = [
inputs.nixos-wsl.nixosModules.default inputs.lanzaboote.nixosModules.lanzaboote
inputs.home-manager.nixosModules.home-manager inputs.nixos-wsl.nixosModules.default
inputs.stylix.nixosModules.stylix inputs.home-manager.nixosModules.home-manager
inputs.disko.nixosModules.disko inputs.stylix.nixosModules.stylix
../base inputs.disko.nixosModules.disko
../home ../base
../modules ../home
]; ../modules
home = [ ];
inputs.anyrun.homeManagerModules.default home = [
inputs.ironbar.homeManagerModules.default inputs.anyrun.homeManagerModules.default
inputs.oxicalc.homeManagerModules.default inputs.ironbar.homeManagerModules.default
inputs.oxishut.homeManagerModules.default inputs.oxicalc.homeManagerModules.default
inputs.oxinoti.homeManagerModules.default inputs.oxishut.homeManagerModules.default
inputs.oxidash.homeManagerModules.default inputs.oxinoti.homeManagerModules.default
inputs.oxipaste.homeManagerModules.default inputs.oxidash.homeManagerModules.default
inputs.oxirun.homeManagerModules.default inputs.oxipaste.homeManagerModules.default
inputs.hyprdock.homeManagerModules.default inputs.oxirun.homeManagerModules.default
inputs.hyprland.homeManagerModules.default inputs.hyprdock.homeManagerModules.default
inputs.reset.homeManagerModules.default inputs.hyprland.homeManagerModules.default
inputs.sops-nix.homeManagerModules.sops inputs.reset.homeManagerModules.default
inputs.dashvim.homeManagerModules.dashvim inputs.sops-nix.homeManagerModules.sops
inputs.fancontrol.homeManagerModules.default inputs.dashvim.homeManagerModules.dashvim
../modules inputs.fancontrol.homeManagerModules.default
]; ../modules
}, ];
additionalInputs ? {}, },
overridePkgs ? false, additionalInputs ? {},
... overridePkgs ? false,
}: ...
builtins.listToAttrs ( }:
map builtins.listToAttrs (
(name: { map
name = name; (name: {
value = let name = name;
mod = root + /hosts/${name}/configuration.nix; value = let
additionalNixosConfig = root + /hosts/${name}/hardware.nix; mod = root + /hosts/${name}/configuration.nix;
additionalHomeConfig = root + /hosts/${name}/home.nix; additionalNixosConfig = root + /hosts/${name}/hardware.nix;
args = { additionalHomeConfig = root + /hosts/${name}/home.nix;
inherit args = {
self inherit
inputs self
mod inputs
additionalHomeConfig mod
system additionalHomeConfig
root system
stable root
unstable stable
; unstable
pkgs = lib.mkForce ( additionalInputs
if overridePkgs dashNixAdditionalProps
then stable ;
else unstable pkgs = lib.mkForce (
); if overridePkgs
alternativePkgs = then stable
if overridePkgs else unstable
then unstable );
else stable; alternativePkgs =
hostName = name; if overridePkgs
homeMods = mods.home; then unstable
additionalHomeMods = additionalMods.home; else stable;
additionalInputs = additionalInputs; hostName = name;
mkDashDefault = import ./override.nix {inherit lib;}; homeMods = mods.home;
}; additionalHomeMods = additionalMods.home;
in mkDashDefault = import ./override.nix {inherit lib;};
inputs.unstable.lib.nixosSystem { };
modules = in
[ inputs.unstable.lib.nixosSystem {
{_module.args = args;} modules =
mod [
] {_module.args = args;}
++ mods.nixos mod
++ additionalMods.nixos ]
++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig ++ mods.nixos
++ inputs.unstable.lib.optional (builtins.pathExists mod) mod; ++ additionalMods.nixos
}; ++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
}) ++ inputs.unstable.lib.optional (builtins.pathExists mod) mod;
( };
lib.lists.remove "" ( })
lib.attrsets.mapAttrsToList (name: fType: (
if fType == "directory" lib.lists.remove "" (
then name lib.attrsets.mapAttrsToList (name: fType:
else "") ( if fType == "directory"
builtins.readDir (root + /hosts) then name
) else "") (
) builtins.readDir (root + /hosts)
) )
); )
)
buildIso = inputs.unstable.lib.nixosSystem { );
specialArgs = {
inherit self inputs unstable; buildIso = inputs.unstable.lib.nixosSystem {
}; specialArgs = {
modules = [ inherit self inputs unstable;
../iso/configuration.nix };
]; modules = [
}; ../iso/configuration.nix
} ];
};
}

View file

@ -1,6 +1,6 @@
{ {
lib, lib,
stable, dashNixAdditionalProps,
pkgs, pkgs,
name, name,
... ...
@ -24,9 +24,16 @@ in {
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi") (mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi") (mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi") (mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib stable;}}/latest.xpi") (mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi")
];
example = [
{
"78272b6fa58f4a1abaac99321d503a20@proton.me" = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/proton-pass/latest.xpi";
installation_mode = "normal_installed";
};
}
]; ];
example = [];
type = with lib.types; listOf anything; type = with lib.types; listOf anything;
description = '' description = ''
List of extensions via attrsets: List of extensions via attrsets:

17
lib/importPkgs.nix Normal file
View file

@ -0,0 +1,17 @@
{
inputs,
currentSystem,
permittedPackages,
pkgs,
}:
import pkgs {
system = currentSystem;
config = {
allowUnfree = true;
permittedInsecurePackages = permittedPackages;
};
overlays = [
inputs.nur.overlays.default
inputs.chaoticNyx.overlays.default
];
}

View file

@ -1,199 +1,173 @@
{ {
lib, lib,
config, config,
options, options,
... ...
}: { }: {
options.conf = { options.conf = {
system = lib.mkOption { system = lib.mkOption {
default = "x86_64-linux"; default = "x86_64-linux";
# no fisherprice unix support # no fisherprice unix support
type = with lib.types; (enum [ type = with lib.types; (enum [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
"aarch64-linux-android" "aarch64-linux-android"
]); ]);
example = "aarch64-linux"; example = "aarch64-linux";
description = '' description = ''
System architecture. System architecture.
''; '';
}; };
systemLocalTime = lib.mkOption { systemLocalTime = lib.mkOption {
default = false; default = false;
example = true; example = true;
description = '' description = ''
System time for dualbooting System time for dualbooting
''; '';
}; };
wsl = lib.mkOption { wsl = lib.mkOption {
default = false; default = false;
example = true; example = true;
description = '' description = ''
Runs Nix in wsl Runs Nix in wsl
''; '';
}; };
secureBoot = lib.mkOption { secureBoot = lib.mkOption {
default = false; default = false;
example = true; example = true;
description = '' description = ''
enables secure boot. enables secure boot.
Note: Secure boot is NOT reproducible Note: Secure boot is NOT reproducible
Here are the necessary steps: Here are the necessary steps:
+ create your keys with sbctl -> sudo sbctl create-keys + create your keys with sbctl -> sudo sbctl create-keys
+ build with systemd once -> set this to false and build once + build with systemd once -> set this to false and build once
+ build with secureBoot true + build with secureBoot true
+ verify that your keys are signed (note, only systemd and your generations should now be signed): sudo sbtcl verify + verify that your keys are signed (note, only systemd and your generations should now be signed): sudo sbtcl verify
+ enroll your keys (microsoft is necessary for windows dualboot support, leave it there): sudo sbctl enroll-keys --microsoft + enroll your keys (microsoft is necessary for windows dualboot support, leave it there): sudo sbctl enroll-keys --microsoft
+ reboot with secureboot enabled + reboot with secureboot enabled
Note: Some motherboards have vendor specific keys for secure boot, this may not necessarily work with our self signed keys Note: Some motherboards have vendor specific keys for secure boot, this may not necessarily work with our self signed keys
You likely have to disable these vendor specific keys (example HP: sure boot) You likely have to disable these vendor specific keys (example HP: sure boot)
''; '';
}; };
useSystemdBootloader = lib.mkOption { useSystemdBootloader = lib.mkOption {
default = true; default = true;
example = false; example = false;
description = '' description = ''
use systemd bootloader. use systemd bootloader.
''; '';
}; };
cpu = lib.mkOption { cpu = lib.mkOption {
# TODO: how to enable arm? # TODO: how to enable arm?
default = "amd"; default = "amd";
type = with lib.types; (enum [ type = with lib.types; (enum [
"amd" "amd"
"intel" "intel"
]); ]);
example = "intel"; example = "intel";
description = '' description = ''
cpu microcode. cpu microcode.
''; '';
}; };
additionalBootKernalParams = lib.mkOption { additionalBootKernalParams = lib.mkOption {
default = [ default = [
"video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}" # TODO test if needed
]; #"video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}"
example = []; ];
type = with lib.types; listOf str; example = [];
description = '' type = with lib.types; listOf str;
additional kernelParams passed to bootloader description = ''
''; additional kernelParams passed to bootloader
}; '';
};
defaultMonitor = lib.mkOption {
default = ""; bootParams = lib.mkOption {
example = "eDP-1"; default = [];
type = lib.types.str; example = ["resume=something"];
description = '' type = with lib.types; listOf str;
main monitor description = ''
''; Boot params
}; '';
};
defaultMonitorMode = lib.mkOption {
default = ""; kernelOverride = lib.mkOption {
example = "3440x1440@180"; default = null;
type = lib.types.str; type = with lib.types; nullOr package;
description = '' description = ''
main monitor mode: width x height @ refreshrate kernel to be used
''; Has no examples as doc complains...
}; #example = pkgs.linuxPackages_xanmod_latest;
'';
defaultMonitorScale = lib.mkOption { };
default = "1";
example = "1.5"; username = lib.mkOption {
type = lib.types.str; default = "DashNix";
description = '' example = "pingpang";
main monitor scaling type = lib.types.str;
''; description = ''
}; The username.
'';
bootParams = lib.mkOption { };
default = [];
example = ["resume=something"]; timezone = lib.mkOption {
type = with lib.types; listOf str; default = "Europe/Zurich";
description = '' example = "Europe/Berlin";
Boot params type = lib.types.str;
''; description = ''
}; The timezone.
'';
kernelOverride = lib.mkOption { };
default = null;
type = with lib.types; nullOr package; locale = lib.mkOption {
description = '' default = "en_US.UTF-8";
kernel to be used example = "de_DE.UTF-8";
Has no examples as doc complains... type = lib.types.str;
#example = pkgs.linuxPackages_xanmod_latest; description = ''
''; The locale.
}; '';
};
username = lib.mkOption {
default = "DashNix"; nixosConfigPath = lib.mkOption {
example = "pingpang"; default = "/home/${config.conf.username}/gits/nixos/.";
type = lib.types.str; example = "yourpath/.";
description = '' type = lib.types.str;
The username. description = ''
''; The path for your build command, you can then simply type rebuild to switch to a new configuration.
}; '';
};
timezone = lib.mkOption {
default = "Europe/Zurich"; systemStateVersion = lib.mkOption {
example = "Europe/Berlin"; example = "24.11";
type = lib.types.str; default = "23.05";
description = '' type = lib.types.str;
The timezone. description = ''
''; System state version
}; '';
};
locale = lib.mkOption { homeStateVersion = lib.mkOption {
default = "en_US.UTF-8"; default = "24.11";
example = "de_DE.UTF-8"; example = "23.05";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
The locale. Home state version
''; '';
}; };
};
nixosConfigPath = lib.mkOption {
default = "/home/${config.conf.username}/gits/nixos/."; config =
example = "yourpath/."; (lib.optionalAttrs (options ? system.stateVersion) {
type = lib.types.str; boot = {
description = '' kernelPackages = lib.mkIf (config.conf.kernelOverride != null) config.conf.kernel;
The path for your build command, you can then simply type rebuild to switch to a new configuration. kernelParams = config.conf.additionalBootKernalParams;
''; };
}; system.stateVersion = config.conf.systemStateVersion;
})
systemStateVersion = lib.mkOption { // (lib.optionalAttrs (options ? home.stateVersion) {
example = "24.11"; home.stateVersion = config.conf.homeStateVersion;
default = "23.05"; });
type = lib.types.str; }
description = ''
System state version
'';
};
homeStateVersion = lib.mkOption {
default = "24.11";
example = "23.05";
type = lib.types.str;
description = ''
Home state version
'';
};
};
config =
(lib.optionalAttrs (options ? system.stateVersion) {
boot = {
kernelPackages = lib.mkIf (config.conf.kernelOverride != null) config.conf.kernel;
kernelParams = config.conf.additionalBootKernalParams;
};
system.stateVersion = config.conf.systemStateVersion;
})
// (lib.optionalAttrs (options ? home.stateVersion) {
home.stateVersion = config.conf.homeStateVersion;
});
}

144
modules/programs/anyrun.nix Normal file
View file

@ -0,0 +1,144 @@
{
mkDashDefault,
lib,
config,
pkgs,
options,
inputs,
...
}: {
options.mods.anyrun = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables anyrun";
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom anyrun configuration.
Will be merged with default configuration if enabled.
'';
};
useDefaultCss = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun css.
'';
};
customCss = lib.mkOption {
default = '''';
example = ''
#window {
border-radius: none;
}
'';
type = lib.types.lines;
description = ''
Custom anyrun css.
Will be merged with default css if enabled.
'';
};
};
config = lib.mkIf config.mods.anyrun.enable (
lib.optionalAttrs (options ? home.packages) {
programs.anyrun = lib.mkForce {
enable = true;
config =
if config.mods.anyrun.useDefaultConfig
then
lib.mkMerge
[
{
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
inputs.anyrun.packages.${pkgs.system}.rink
inputs.anyrun.packages.${pkgs.system}.translate
inputs.anyrun.packages.${pkgs.system}.websearch
];
hideIcons = mkDashDefault false;
width = {
fraction = mkDashDefault 0.3;
};
y = {
fraction = mkDashDefault 0.5;
};
layer = mkDashDefault "overlay";
hidePluginInfo = mkDashDefault true;
closeOnClick = mkDashDefault true;
}
config.mods.anyrun.customConfig
]
else config.mods.anyrun.customConfig;
extraCss =
if config.mods.anyrun.useDefaultCss
then
''
#window {
border-radius: 10px;
background-color: transparent;
}
box#main {
border-radius: 10px;
}
list#main {
border-radius: 10px;
margin: 0px 10px 10px 10px;
}
list#plugin {
border-radius: 10px;
}
list#match {
border-radius: 10px;
}
entry#entry {
border: 0;
border-radius: 10px;
margin: 10px 10px 0px 10px;
}
label#match-desc {
font-size: 12px;
border-radius: 10px;
}
label#match-title {
font-size: 12px;
border-radius: 10px;
}
label#plugin {
font-size: 16px;
border-radius: 10px;
}
* {
border-radius: 10px;
}
''
+ config.mods.anyrun.customCss
else config.mods.anyrun.customCss;
};
}
);
}

View file

@ -1,128 +1,131 @@
{ {
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 = mkDashDefault 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
{ lib.mkMerge
nix-ld = { [
enable = mkDashDefault true; {
libraries = with pkgs; [ nix-ld = {
jdk enable = mkDashDefault true;
zlib libraries = with pkgs; [
]; jdk
}; zlib
direnv = { ];
package = mkDashDefault pkgs.direnv; };
silent = mkDashDefault false; direnv = {
loadInNixShell = mkDashDefault true; package = mkDashDefault pkgs.direnv;
direnvrcExtra = mkDashDefault ""; silent = mkDashDefault false;
nix-direnv = { loadInNixShell = mkDashDefault true;
enable = mkDashDefault true; direnvrcExtra = mkDashDefault "";
package = mkDashDefault pkgs.nix-direnv; nix-direnv = {
}; enable = mkDashDefault true;
}; package = mkDashDefault pkgs.nix-direnv;
gnupg.agent.enable = mkDashDefault true; };
} };
// config.mods.basePackages.specialPrograms gnupg.agent.enable = mkDashDefault true;
else config.mods.basePackages.specialPrograms; }
}; config.mods.basePackages.specialPrograms
} ]
else config.mods.basePackages.specialPrograms;
};
}

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -18,8 +19,8 @@
config = lib.mkIf config.mods.bluetooth.enable ( config = lib.mkIf config.mods.bluetooth.enable (
lib.optionalAttrs (options ? hardware.bluetooth) { lib.optionalAttrs (options ? hardware.bluetooth) {
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = mkDashDefault true;
powerOnBoot = true; powerOnBoot = mkDashDefault true;
}; };
} }
); );

View file

@ -1,16 +1,16 @@
{ {
lib, lib,
dashNixAdditionalProps,
config, config,
options, options,
pkgs, pkgs,
stable,
... ...
}: let }: let
name = "firefox"; name = "firefox";
in { in {
imports = [ imports = [
(import ./ffextensions.nix (import ../../../lib/foxextensions.nix
{inherit lib stable pkgs name;}) {inherit lib dashNixAdditionalProps pkgs name;})
]; ];
options.mods.browser.${name} = { options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {

View file

@ -1,16 +1,16 @@
{ {
lib, lib,
dashNixAdditionalProps,
config, config,
options, options,
pkgs, pkgs,
stable,
... ...
}: let }: let
name = "librewolf"; name = "librewolf";
in { in {
imports = [ imports = [
(import ./ffextensions.nix (import ../../../lib/foxextensions.nix
{inherit lib stable pkgs name;}) {inherit lib dashNixAdditionalProps pkgs name;})
]; ];
options.mods.browser.${name} = { options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {

View file

@ -1,140 +1,140 @@
# credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix # credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix
{ {
lib, lib,
config, dashNixAdditionalProps,
options, config,
inputs, options,
stable, inputs,
system, system,
pkgs, pkgs,
... ...
}: let }: let
# at time of using this here, stylix might not be evaluated yet # at time of using this here, stylix might not be evaluated yet
# hence ensure it is by using base16 mkSchemeAttrs # hence ensure it is by using base16 mkSchemeAttrs
base16 = pkgs.callPackage inputs.base16.lib {}; base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
name = "zen"; name = "zen";
in { in {
imports = [ imports = [
(import ./ffextensions.nix (import ../../../lib/foxextensions.nix
{inherit lib stable pkgs name;}) {inherit lib dashNixAdditionalProps pkgs name;})
]; ];
options.mods.browser.${name} = { options.mods.browser.${name} = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
example = true; example = true;
type = lib.types.bool; type = lib.types.bool;
description = "Enables the zen browser"; description = "Enables the zen browser";
}; };
configuration = lib.mkOption { configuration = lib.mkOption {
default = { default = {
EnableTrackingProtection = { EnableTrackingProtection = {
Value = true; Value = true;
Locked = true; Locked = true;
Cryptomining = true; Cryptomining = true;
Fingerprinting = true; Fingerprinting = true;
}; };
DisablePocket = true; DisablePocket = true;
CaptivePortal = false; CaptivePortal = false;
DisableFirefoxStudies = true; DisableFirefoxStudies = true;
DisableTelemetry = true; DisableTelemetry = true;
NoDefaultBookmarks = true; NoDefaultBookmarks = true;
PasswordManagerEnabled = false; PasswordManagerEnabled = false;
FirefoxHome = { FirefoxHome = {
Search = true; Search = true;
Pocket = false; Pocket = false;
Snippets = false; Snippets = false;
TopSites = true; TopSites = true;
Highlights = false; Highlights = false;
}; };
UserMessaging = { UserMessaging = {
ExtensionRecommendations = false; ExtensionRecommendations = false;
SkipOnboarding = true; SkipOnboarding = true;
}; };
"3rdparty".Extensions = { "3rdparty".Extensions = {
"addon@darkreader.org" = { "addon@darkreader.org" = {
theme = { theme = {
darkSchemeBackgroundColor = "#${scheme.base00}"; darkSchemeBackgroundColor = "#${scheme.base00}";
darkSchemeTextColor = "#${scheme.base05}"; darkSchemeTextColor = "#${scheme.base05}";
}; };
previewNewDesign = true; previewNewDesign = true;
}; };
}; };
}; };
example = {}; example = {};
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = "Zen policy configuration. See https://mozilla.github.io/policy-templates for more information."; description = "Zen policy configuration. See https://mozilla.github.io/policy-templates for more information.";
}; };
profiles = lib.mkOption { profiles = lib.mkOption {
default = [ default = [
{ {
name = "${config.conf.username}"; name = "${config.conf.username}";
value = { value = {
settings = { settings = {
"zen.view.compact.hide-tabbar" = false; "zen.view.compact.hide-tabbar" = false;
"zen.view.compact.hide-toolbar" = true; "zen.view.compact.hide-toolbar" = true;
"zen.view.sidebar-expanded" = false; "zen.view.sidebar-expanded" = false;
"zen.view.use-single-toolbar" = false; "zen.view.use-single-toolbar" = false;
"zen.view.welcome-screen.seen" = true; "zen.view.welcome-screen.seen" = true;
"zen.theme.accent-color" = "#b4bbff"; "zen.theme.accent-color" = "#b4bbff";
"extensions.autoDisableScopes" = 0; "extensions.autoDisableScopes" = 0;
"cookiebanners.service.mode" = 2; "cookiebanners.service.mode" = 2;
}; };
isDefault = true; isDefault = true;
id = 0; id = 0;
}; };
} }
{ {
name = "special"; name = "special";
value = { value = {
settings = { settings = {
"zen.view.compact.hide-tabbar" = false; "zen.view.compact.hide-tabbar" = false;
"zen.view.compact.hide-toolbar" = true; "zen.view.compact.hide-toolbar" = true;
"zen.view.sidebar-expanded" = false; "zen.view.sidebar-expanded" = false;
"zen.view.use-single-toolbar" = false; "zen.view.use-single-toolbar" = false;
"zen.view.welcome-screen.seen" = true; "zen.view.welcome-screen.seen" = true;
"zen.theme.accent-color" = "#b4bbff"; "zen.theme.accent-color" = "#b4bbff";
"extensions.autoDisableScopes" = 0; "extensions.autoDisableScopes" = 0;
}; };
isDefault = false; isDefault = false;
id = 1; id = 1;
}; };
} }
]; ];
example = [ example = [
{ {
name = "custom"; name = "custom";
value = { value = {
settings = { settings = {
extensions.autoDisableScopes = 0; extensions.autoDisableScopes = 0;
}; };
extensions.packages = [pkgs.nur.repos.rycee.firefox-addons.darkreader]; extensions.packages = [pkgs.nur.repos.rycee.firefox-addons.darkreader];
isDefault = true; isDefault = true;
id = 0; id = 0;
}; };
} }
]; ];
type = with lib.types; listOf (attrsOf anything); type = with lib.types; listOf (attrsOf anything);
description = "Zen profiles"; description = "Zen profiles";
}; };
}; };
config = lib.mkIf (config.mods.browser.zen.enable || config.mods.homePackages.browser == "zen") ( config = lib.mkIf (config.mods.browser.zen.enable || config.mods.homePackages.browser == "zen") (
lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.zen-browser = { programs.zen-browser = {
enable = true; enable = true;
package = package =
pkgs.wrapFirefox pkgs.wrapFirefox
inputs.zen-browser.packages.${system}.zen-browser-unwrapped inputs.zen-browser.packages.${system}.zen-browser-unwrapped
{ {
pname = "zen-browser"; pname = "zen-browser";
extraPolicies = extraPolicies =
config.mods.browser.zen.configuration config.mods.browser.zen.configuration
// { // {
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} config.mods.browser.zen.extensions; ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} config.mods.browser.zen.extensions;
}; };
}; };
profiles = builtins.listToAttrs config.mods.browser.zen.profiles; profiles = builtins.listToAttrs config.mods.browser.zen.profiles;
}; };
} }
); );
} }

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -63,8 +64,8 @@
containers.enable = true; containers.enable = true;
podman = { podman = {
enable = true; enable = true;
dockerCompat = true; dockerCompat = mkDashDefault true;
defaultNetwork.settings.dns_enabled = true; defaultNetwork.settings.dns_enabled = mkDashDefault true;
}; };
} }
else if (config.mods.containers.variant == "docker") else if (config.mods.containers.variant == "docker")

View file

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

@ -1,66 +1,73 @@
{ {
mkDashDefault,
pkgs, pkgs,
lib, lib,
options, options,
config, config,
... ...
}: { }: {
options.mods = { options.mods.dashfetch = {
dashfetch = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "A custom configuration for fastfetch"; description = "A custom configuration for fastfetch";
}; };
modules = lib.mkOption {
default = [
"title"
"separator"
{
type = "os";
key = "OS";
format = "DashNix ({name} {version})";
}
"host"
"kernel"
"uptime"
"packages"
"shell"
"display"
"de"
"wm"
"wmtheme"
"theme"
"icons"
"font"
"cursor"
"terminal"
"terminalfont"
"cpu"
"gpu"
"memory"
"swap"
"disk"
"localip"
"battery"
"poweradapter"
"locale"
"break"
"colors"
];
example = [];
type = with lib.types; listOf anything;
description = "modules for fastfetch";
};
}; };
config = lib.optionalAttrs (options ? home.packages) { config = lib.optionalAttrs (options ? home.packages) {
xdg.configFile."fastfetch/config.jsonc" = lib.mkIf (config.mods.dashfetch) { xdg.configFile."fastfetch/config.jsonc" = lib.mkIf (config.mods.dashfetch.enable) {
source = (pkgs.formats.json {}).generate "config.jsonc" { source = (pkgs.formats.json {}).generate "config.jsonc" {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"; "$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
logo = { logo = {
type = "kitty"; type = mkDashDefault "kitty";
source = ../../assets/logo2.png; source = mkDashDefault ../../assets/logo2.png;
width = 35; width = mkDashDefault 35;
padding = { padding = mkDashDefault {
top = 1; top = mkDashDefault 1;
}; };
}; };
modules = [ modules = config.mods.dashfetch.modules;
"title"
"separator"
{
type = "os";
key = "OS";
format = "DashNix ({name} {version})";
}
"host"
"kernel"
"uptime"
"packages"
"shell"
"display"
"de"
"wm"
"wmtheme"
"theme"
"icons"
"font"
"cursor"
"terminal"
"terminalfont"
"cpu"
"gpu"
"memory"
"swap"
"disk"
"localip"
"battery"
"poweradapter"
"locale"
"break"
"colors"
];
}; };
}; };
}; };

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -76,27 +77,27 @@
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos; boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
programs = { programs = {
steam.enable = config.mods.gaming.steam; steam.enable = mkDashDefault config.mods.gaming.steam;
gamemode.enable = true; gamemode.enable = true;
gamemode = { gamemode = {
enableRenice = true; enableRenice = mkDashDefault true;
settings = { settings = {
general = { general = {
desiredgov = "performance"; desiredgov = mkDashDefault "performance";
}; };
cpu = { cpu = {
pin_cores = config.mods.gaming.pinCores; pin_cores = mkDashDefault config.mods.gaming.pinCores;
park_cores = config.mods.gaming.parkCores; park_cores = mkDashDefault config.mods.gaming.parkCores;
}; };
gpu = lib.mkIf config.mods.gaming.gpuOptimization { gpu = lib.mkIf config.mods.gaming.gpuOptimization {
apply_gpu_optimisations = "accept-responsibility"; apply_gpu_optimisations = mkDashDefault "accept-responsibility";
gpu_device = config.mods.gaming.gpuDevice; gpu_device = mkDashDefault config.mods.gaming.gpuDevice;
amd_performance_level = "high"; amd_performance_level = mkDashDefault "high";
nv_powermizer_mode = 1; nv_powermizer_mode = mkDashDefault 1;
}; };
custom = { custom = {
start = "notify-send -a 'Gamemode' 'Optimizations activated'"; start = mkDashDefault "notify-send -a 'Gamemode' 'Optimizations activated'";
end = "notify-send -a 'Gamemode' 'Optimizations deactivated'"; end = mkDashDefault "notify-send -a 'Gamemode' 'Optimizations deactivated'";
}; };
}; };
}; };

View file

@ -67,16 +67,16 @@
environment.variables = environment.variables =
if (config.mods.gpu.amdgpu.enable && config.mods.gpu.vapi.rocm.enable) if (config.mods.gpu.amdgpu.enable && config.mods.gpu.vapi.rocm.enable)
then { then {
RUSTICL_ENABLE = "radeonsi"; RUSTICL_ENABLE = mkDashDefault "radeonsi";
} }
else {}; else {};
hardware = { hardware = {
nvidia = lib.mkIf config.mods.gpu.nvidia.enable { nvidia = lib.mkIf config.mods.gpu.nvidia.enable {
modesetting.enable = true; modesetting.enable = mkDashDefault true;
open = true; open = mkDashDefault true;
nvidiaSettings = true; nvidiaSettings = mkDashDefault true;
package = config.boot.kernelPackages.nvidiaPackages.beta; package = mkDashDefault config.boot.kernelPackages.nvidiaPackages.beta;
}; };
graphics = let graphics = let
amdPackages = [ amdPackages = [

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
config, config,
lib, lib,
inputs, inputs,
@ -17,7 +18,7 @@
''; '';
}; };
monitor = lib.mkOption { monitor = lib.mkOption {
default = "${config.conf.defaultMonitor}"; default = "${config.mods.hypr.hyprland.defaultMonitor}";
example = "eDP-1"; example = "eDP-1";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -26,7 +27,7 @@
''; '';
}; };
scale = lib.mkOption { scale = lib.mkOption {
default = "${config.conf.defaultMonitorScale}"; default = "${config.mods.hypr.hyprland.defaultMonitorScale}";
example = "1.5"; example = "1.5";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -45,7 +46,7 @@
description = "The compositor/greeter command to run"; description = "The compositor/greeter command to run";
}; };
resolution = lib.mkOption { resolution = lib.mkOption {
default = "${config.conf.defaultMonitorMode}"; default = "${config.mods.hypr.hyprland.defaultMonitorMode}";
example = "3440x1440@180"; example = "3440x1440@180";
type = lib.types.str; type = lib.types.str;
description = '' description = ''
@ -86,16 +87,16 @@
lib.mkIf config.mods.greetd.enable ( lib.mkIf config.mods.greetd.enable (
lib.optionalAttrs (options ? environment) { lib.optionalAttrs (options ? environment) {
# greetd display manager # greetd display manager
programs.hyprland.enable = true; programs.hyprland.enable = mkDashDefault true;
services = { services = {
displayManager.sessionPackages = config.mods.greetd.environments; displayManager.sessionPackages = config.mods.greetd.environments;
greetd = { greetd = {
enable = true; enable = true;
settings = { settings = {
terminal.vt = 1; terminal.vt = mkDashDefault 1;
default_session = { default_session = {
command = config.mods.greetd.greeterCommand; command = mkDashDefault config.mods.greetd.greeterCommand;
user = username; user = mkDashDefault username;
}; };
}; };
}; };
@ -129,9 +130,9 @@
''; '';
# unlock GPG keyring on login # unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = true; security.pam.services.greetd.enableGnomeKeyring = mkDashDefault true;
security.pam.services.greetd.sshAgentAuth = true; security.pam.services.greetd.sshAgentAuth = mkDashDefault true;
security.pam.sshAgentAuth.enable = true; security.pam.sshAgentAuth.enable = mkDashDefault true;
} }
// lib.optionalAttrs (options ? home) { // lib.optionalAttrs (options ? home) {
xdg.configFile."regreet/regreet.toml".source = xdg.configFile."regreet/regreet.toml".source =

View file

@ -1,8 +1,6 @@
{ {
imports = [ imports = [
./hyprland.nix ./hyprland.nix
./anyrun.nix
./ironbar.nix
./hyprlock.nix ./hyprlock.nix
./hyprpaper.nix ./hyprpaper.nix
]; ];

View file

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

View file

@ -0,0 +1,61 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods.hypr.hyprlock = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprlock";
};
config = lib.mkOption {
default = {
background = [
{
monitor = "";
path = "";
color = "rgba(26, 27, 38, 1.0)";
}
];
input-field = [
{
monitor = "${config.mods.hypr.hyprland.defaultMonitor}";
placeholder_text = "password or something";
}
];
label = [
{
monitor = "${config.mods.hypr.hyprland.defaultMonitor}";
text = "$TIME";
font_size = 50;
position = "0, 200";
valign = "center";
halign = "center";
}
];
};
example = {};
type = with lib.types; attrsOf anything;
description = "config";
};
};
config = lib.mkIf config.mods.hypr.hyprlock.enable (
lib.optionalAttrs (options ? xdg.configFile) {
stylix.targets.hyprlock = {
enable = false;
};
home.packages = with pkgs; [hyprlock];
programs.hyprlock = lib.mkIf config.mods.hypr.hyprlock.enable {
enable = true;
settings = config.mods.hypr.hyprlock.config;
};
}
);
}

View file

@ -0,0 +1,36 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods.hypr.hyprpaper = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprpaper";
};
config = lib.mkOption {
default = "";
example = ''
preload = path/to/wallpaper
wallpaper = YOURMONITOR,path/to/wallpaper
'';
type = lib.types.lines;
description = ''
Hyprpaper config
'';
};
};
config = lib.mkIf config.mods.hypr.hyprpaper.enable (
lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [hyprpaper];
xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hypr.hyprpaper.enable {
text = config.mods.hypr.hyprpaper.config;
};
}
);
}

View file

@ -1,144 +0,0 @@
{
lib,
config,
pkgs,
options,
inputs,
...
}: {
options.mods = {
hyprland = {
anyrun = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables anyrun";
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom anyrun configuration.
Will be merged with default configuration if enabled.
'';
};
useDefaultCss = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured anyrun css.
'';
};
customCss = lib.mkOption {
default = '''';
example = ''
#window {
border-radius: none;
}
'';
type = lib.types.lines;
description = ''
Custom anyrun css.
Will be merged with default css if enabled.
'';
};
};
};
};
config = lib.mkIf config.mods.hyprland.anyrun.enable (
lib.optionalAttrs (options ? home.packages) {
programs.anyrun = lib.mkForce {
enable = true;
config =
if config.mods.hyprland.anyrun.useDefaultConfig
then
{
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
inputs.anyrun.packages.${pkgs.system}.rink
inputs.anyrun.packages.${pkgs.system}.translate
inputs.anyrun.packages.${pkgs.system}.websearch
];
hideIcons = false;
width = {
fraction = 0.3;
};
y = {
fraction = 0.5;
};
layer = "overlay";
hidePluginInfo = true;
closeOnClick = true;
}
// config.mods.hyprland.anyrun.customConfig
else config.mods.hyprland.anyrun.customConfig;
extraCss =
if config.mods.hyprland.anyrun.useDefaultCss
then
''
#window {
border-radius: 10px;
background-color: transparent;
}
box#main {
border-radius: 10px;
}
list#main {
border-radius: 10px;
margin: 0px 10px 10px 10px;
}
list#plugin {
border-radius: 10px;
}
list#match {
border-radius: 10px;
}
entry#entry {
border: 0;
border-radius: 10px;
margin: 10px 10px 0px 10px;
}
label#match-desc {
font-size: 12px;
border-radius: 10px;
}
label#match-title {
font-size: 12px;
border-radius: 10px;
}
label#plugin {
font-size: 16px;
border-radius: 10px;
}
* {
border-radius: 10px;
}
''
+ config.mods.hyprland.anyrun.customCss
else config.mods.hyprland.anyrun.customCss;
};
}
);
}

View file

@ -1,58 +0,0 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods = {
hyprland.hyprlock = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprlock";
};
};
};
config = lib.mkIf config.mods.hyprland.hyprlock.enable (
lib.optionalAttrs (options ? xdg.configFile) {
stylix.targets.hyprlock = {
enable = false;
};
home.packages = with pkgs; [hyprlock];
programs.hyprlock = lib.mkIf config.mods.hyprland.hyprlock.enable {
enable = true;
settings = {
background = [
{
monitor = "";
path = "";
color = "rgba(26, 27, 38, 1.0)";
}
];
input-field = [
{
monitor = "${config.conf.defaultMonitor}";
placeholder_text = "password or something";
}
];
label = [
{
monitor = "${config.conf.defaultMonitor}";
text = "$TIME";
font_size = 50;
position = "0, 200";
valign = "center";
halign = "center";
}
];
};
};
}
);
}

View file

@ -1,38 +0,0 @@
{
config,
lib,
options,
pkgs,
...
}: {
options.mods = {
hyprland.hyprpaper = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables Hyprpaper";
};
config = lib.mkOption {
default = "";
example = ''
preload = path/to/wallpaper
wallpaper = YOURMONITOR,path/to/wallpaper
'';
type = lib.types.lines;
description = ''
Hyprpaper config
'';
};
};
};
config = lib.mkIf config.mods.hyprland.hyprpaper.enable (
lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [hyprpaper];
xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hyprland.hyprpaper.enable {
text = config.mods.hyprland.hyprpaper.config;
};
}
);
}

View file

@ -9,12 +9,127 @@
username = config.conf.username; username = config.conf.username;
base16 = pkgs.callPackage inputs.base16.lib {}; base16 = pkgs.callPackage inputs.base16.lib {};
scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; scheme = base16.mkSchemeAttrs config.stylix.base16Scheme;
ironbarDefaultConfig = {
end = [
{
type = "sys_info";
format = [" {memory_percent}"];
interval.memory = 30;
class = "memory-usage";
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "popup:toggle";
}
];
class = "popup-button-box";
popup = [
{
type = "box";
orientation = "vertical";
class = "audio-box";
widgets = [
{
type = "box";
orientation = "horizontal";
widgets = [
{
type = "button";
class = "audio-button";
label = "";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth";
}
{
type = "button";
class = "audio-button";
label = "󰋋";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl internal";
}
];
class = "audio-button-box";
}
{
type = "label";
label = "Output";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
}
{
type = "label";
label = "Input";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
}
];
}
];
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
}
];
class = "popup-button-box";
}
{
type = "clock";
format = "%I:%M";
format_popup = "%I:%M:%S";
locale = "en_US";
}
{type = "tray";}
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [
{
type = "workspaces";
all_monitors = true;
}
];
center = [
{
type = "focused";
show_icon = true;
show_title = true;
icon_size = 20;
truncate = "end";
}
];
};
monitorConfig =
if config.mods.hypr.hyprland.enable
then {monitors.${config.mods.hypr.hyprland.defaultMonitor} = ironbarDefaultConfig;}
else ironbarDefaultConfig;
in { in {
options.mods = { options.mods = {
hyprland.ironbar = { ironbar = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = false;
example = false; example = true;
type = lib.types.bool; type = lib.types.bool;
description = "Enables ironbar"; description = "Enables ironbar";
}; };
@ -26,19 +141,6 @@ in {
Use preconfigured ironbar config. Use preconfigured ironbar config.
''; '';
}; };
modules = lib.mkOption {
default = [];
example = [
{
type = "upower";
class = "memory-usage";
}
];
type = with lib.types; listOf attrs;
description = ''
Adds modules to ironbar. See https://github.com/JakeStanger/ironbar/wiki/ for more information.
'';
};
customConfig = lib.mkOption { customConfig = lib.mkOption {
default = {}; default = {};
example = {}; example = {};
@ -71,12 +173,12 @@ in {
}; };
}; };
}; };
config = lib.mkIf config.mods.hyprland.ironbar.enable ( config = lib.mkIf (config.mods.ironbar.enable || config.mods.hypr.hyprland.useIronbar) (
lib.optionalAttrs (options ? programs.ironbar) { lib.optionalAttrs (options ? programs.ironbar) {
programs.ironbar = { programs.ironbar = {
enable = true; enable = true;
style = style =
if config.mods.hyprland.ironbar.useDefaultCss if config.mods.ironbar.useDefaultCss
then then
/* /*
css css
@ -212,131 +314,20 @@ in {
background-color: #${scheme.base02}; background-color: #${scheme.base02};
} }
'' ''
+ config.mods.hyprland.ironbar.customCss + config.mods.ironbar.customCss
else config.mods.hyprland.ironbar.customCss; else config.mods.ironbar.customCss;
features = [ features = [
#"another_feature" #"another_feature"
]; ];
config = { config =
monitors."${config.conf.defaultMonitor}" = if config.mods.ironbar.useDefaultConfig
if config.mods.hyprland.ironbar.useDefaultConfig then
then lib.mkMerge
{ [
end = monitorConfig
config.mods.hyprland.ironbar.modules config.mods.ironbar.customConfig
++ [ ]
{ else config.mods.ironbar.customConfig;
type = "sys_info";
format = [" {memory_percent}"];
interval.memory = 30;
class = "memory-usage";
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "popup:toggle";
}
];
class = "popup-button-box";
popup = [
{
type = "box";
orientation = "vertical";
class = "audio-box";
widgets = [
{
type = "box";
orientation = "horizontal";
widgets = [
{
type = "button";
class = "audio-button";
label = "";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl bluetooth";
}
{
type = "button";
class = "audio-button";
label = "󰋋";
on_click = lib.mkIf config.mods.scripts.audioControl "!audioControl internal";
}
];
class = "audio-button-box";
}
{
type = "label";
label = "Output";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
}
{
type = "label";
label = "Input";
}
{
type = "slider";
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
}
];
}
];
}
{
type = "custom";
bar = [
{
type = "button";
class = "popup-button";
label = "";
on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
}
];
class = "popup-button-box";
}
{
type = "clock";
format = "%I:%M";
format_popup = "%I:%M:%S";
locale = "en_US";
}
{type = "tray";}
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [
{
type = "workspaces";
all_monitors = true;
}
];
center = [
{
type = "focused";
show_icon = true;
show_title = true;
icon_size = 20;
truncate = "end";
}
];
}
// config.mods.hyprland.ironbar.customConfig
else config.mods.hyprland.ironbar.customConfig;
};
}; };
} }
); );

View file

@ -12,54 +12,63 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables the piper program and its daemon"; description = "Enables the piper program and its daemon";
}; };
use_cache_config = lib.mkOption { useConfig = lib.mkOption {
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = "Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!"; description = "Whether to overwrite the config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
}; };
cache_config = lib.mkOption { config = lib.mkOption {
default = '' default = ''
[General] [General]
LastDatabases=/home/${config.conf.username}/pws/Passwords.kdbx ConfigVersion=2
LastActiveDatabase=/home/${config.conf.username}/pws/Passwords.kdbx
LastOpenedDatabases=/home/${config.conf.username}/pws/Passwords.kdbx [Browser]
LastKeyFiles=@Variant(\0\0\0\x1c\0\0\0\x1\0\0\0>\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0p\0w\0s\0/\0P\0\x61\0s\0s\0w\0o\0r\0\x64\0s\0.\0k\0\x64\0\x62\0x\0\0\0\n\0\0\0>\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0p\0w\0s\0/\0l\0o\0g\0i\0n\0_\0k\0\x65\0y\0.\0k\0\x65\0y\0x) Enabled=true
[GUI]
ApplicationTheme=classic
HidePasswords=true
MinimizeOnClose=true
MinimizeToTray=true
ShowTrayIcon=true
TrayIconAppearance=monochrome-light
[PasswordGenerator]
Length=30
[Security]
EnableCopyOnDoubleClick=true
''; '';
example = ""; example = "";
type = lib.types.lines; type = lib.types.lines;
description = "Cache config to be used."; description = "Cache config to be used.";
}; };
useCacheConfig = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
};
cacheConfig = lib.mkOption {
default = '''';
example = ''
[General]
LastDatabases=/path/to/database
'';
type = lib.types.lines;
description = "Cache config to be used.";
};
}; };
config = lib.mkIf config.mods.keepassxc.enable ( config = lib.mkIf config.mods.keepassxc.enable (
lib.optionalAttrs (options ? home.file) { lib.optionalAttrs (options ? home.file) {
home.packages = [pkgs.keepassxc]; home.packages = [pkgs.keepassxc];
xdg.configFile."keepassxc/keepassxc.ini" = { xdg.configFile."keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.useConfig {
text = '' text = config.mods.keepassxc.config;
[General]
ConfigVersion=2
[Browser]
Enabled=true
[GUI]
ApplicationTheme=classic
HidePasswords=true
MinimizeOnClose=true
MinimizeToTray=true
ShowTrayIcon=true
TrayIconAppearance=monochrome-light
[PasswordGenerator]
Length=30
[Security]
EnableCopyOnDoubleClick=true
'';
}; };
home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.use_cache_config { home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.useCacheConfig {
text = config.mods.keepassxc.cache_config; text = config.mods.keepassxc.cacheConfig;
}; };
} }
); );

View file

@ -41,6 +41,12 @@ in {
type = lib.types.bool; type = lib.types.bool;
description = "Enables kitty"; description = "Enables kitty";
}; };
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enable default config for kitty";
};
additionalConfig = lib.mkOption { additionalConfig = lib.mkOption {
default = {}; default = {};
example = { example = {
@ -48,7 +54,7 @@ in {
enable_audio_bell = "yes"; enable_audio_bell = "yes";
}; };
type = with lib.types; attrsOf anything; type = with lib.types; attrsOf anything;
description = "Additional kitty configuration"; description = "Additional kitty configuration. Will be the only configuration if useDefaultConfig is disabled.";
}; };
}; };
config = lib.mkIf config.mods.kitty.enable ( config = lib.mkIf config.mods.kitty.enable (
@ -59,80 +65,64 @@ in {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings = settings =
{ if config.mods.kitty.useDefaultConfig
enable_audio_bell = "no"; then
window_alert_on_bell = "no"; {
cursor_blink_interval = "0"; enable_audio_bell = "no";
window_padding_width = "1"; window_alert_on_bell = "no";
shell_integration = "yes"; cursor_blink_interval = "0";
sync_with_monitor = "no"; window_padding_width = "1";
background_opacity = "0.8"; shell_integration = "yes";
sync_with_monitor = "no";
background_opacity = "0.8";
font_family = "${config.mods.stylix.fonts.monospace.name}"; font_family = "${config.mods.stylix.fonts.monospace.name}";
bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold"; bold_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold";
italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic"; italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Italic";
bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic"; bold_italic_font = "${config.mods.stylix.fonts.monospace.name} Extra Bold Italic";
background = base; background = base;
foreground = "#" + scheme.base05; foreground = "#" + scheme.base05;
selection_foreground = "#" + scheme.base05; selection_foreground = "#" + scheme.base05;
selection_background = base; selection_background = base;
url_color = "#" + scheme.base04; url_color = "#" + scheme.base04;
cursor = "#" + scheme.base05; cursor = "#" + scheme.base05;
active_border_color = "#" + scheme.base03; active_border_color = "#" + scheme.base03;
inactive_border_color = "#" + scheme.base01; inactive_border_color = "#" + scheme.base01;
active_tab_background = base; active_tab_background = base;
active_tab_foreground = "#" + scheme.base05; active_tab_foreground = "#" + scheme.base05;
inactive_tab_background = "#" + scheme.base01; inactive_tab_background = "#" + scheme.base01;
inactive_tab_foreground = "#" + scheme.base04; inactive_tab_foreground = "#" + scheme.base04;
tab_bar_background = "#" + scheme.base01; tab_bar_background = "#" + scheme.base01;
mark1_foreground = "#" + scheme.base00; mark1_foreground = "#" + scheme.base00;
mark1_background = "#" + scheme.base07; mark1_background = "#" + scheme.base07;
mark2_foreground = "#" + scheme.base00; mark2_foreground = "#" + scheme.base00;
mark2_background = "#" + scheme.base0E; mark2_background = "#" + scheme.base0E;
mark3_foreground = "#" + scheme.base00; mark3_foreground = "#" + scheme.base00;
mark3_background = "#" + scheme.base08; mark3_background = "#" + scheme.base08;
color0 = "#" + scheme.base03; color0 = "#" + scheme.base03;
color1 = "#" + scheme.base08; color1 = "#" + scheme.base08;
color2 = "#" + scheme.base0B; color2 = "#" + scheme.base0B;
color3 = "#" + scheme.base0A; color3 = "#" + scheme.base0A;
color4 = "#" + scheme.base0D; color4 = "#" + scheme.base0D;
color5 = "#" + scheme.base06; color5 = "#" + scheme.base06;
color6 = "#" + scheme.base0C; color6 = "#" + scheme.base0C;
color7 = "#" + scheme.base07; color7 = "#" + scheme.base07;
color8 = "#" + scheme.base04; color8 = "#" + scheme.base04;
color9 = "#" + scheme.base08; color9 = "#" + scheme.base08;
color10 = "#" + scheme.base0B; color10 = "#" + scheme.base0B;
color11 = "#" + scheme.base0A; color11 = "#" + scheme.base0A;
color12 = "#" + scheme.base0D; color12 = "#" + scheme.base0D;
color13 = "#" + scheme.base06; color13 = "#" + scheme.base06;
color14 = "#" + scheme.base0C; color14 = "#" + scheme.base0C;
color15 = "#" + scheme.base0B; color15 = "#" + scheme.base0B;
shell = lib.mkIf config.mods.fish.enable "fish";
# color0 = base; }
# color1 = "#" + scheme.base08; // config.mods.kitty.additionalConfig
# color2 = "#" + scheme.base0B; else config.mods.kitty.additionalConfig;
# color3 = "#" + scheme.base0A;
# color4 = "#" + scheme.base0D;
# color5 = "#" + scheme.base0E;
# color6 = "#" + scheme.base0C;
# color7 = "#" + scheme.base05;
#
# color8 = "#" + scheme.base03;
# color9 = "#" + scheme.base08;
# color10 = "#" + scheme.base0B;
# color11 = "#" + scheme.base0A;
# color12 = "#" + scheme.base0D;
# color13 = "#" + scheme.base0E;
# color14 = "#" + scheme.base0C;
# color15 = "#" + scheme.base07;
shell = lib.mkIf config.mods.fish.enable "fish";
}
// config.mods.kitty.additionalConfig;
}; };
} }
); );

View file

@ -1,6 +1,7 @@
# Copyright (c) 2020-2021 Mihai Fufezan # Copyright (c) 2020-2021 Mihai Fufezan
# credits to fufexan https://github.com/fufexan/dotfiles/blob/main/home/terminal/programs/xdg.nix # credits to fufexan https://github.com/fufexan/dotfiles/blob/main/home/terminal/programs/xdg.nix
{ {
mkDashDefault,
config, config,
lib, lib,
options, options,
@ -148,11 +149,11 @@ in {
}; };
userDirs = { userDirs = {
enable = true; enable = mkDashDefault true;
createDirectories = true; createDirectories = mkDashDefault true;
extraConfig = { extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; XDG_SCREENSHOTS_DIR = mkDashDefault "${config.xdg.userDirs.pictures}/Screenshots";
pws = "${config.home.homeDirectory}/pws"; pws = mkDashDefault "${config.home.homeDirectory}/pws";
}; };
}; };
}; };

View file

@ -12,11 +12,8 @@
type = lib.types.bool; type = lib.types.bool;
description = "Enables ncspot with a config"; description = "Enables ncspot with a config";
}; };
}; config = lib.mkOption {
config = lib.mkIf config.mods.ncspot.enable ( default = {
lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ncspot];
xdg.configFile."ncspot/config.toml".source = (pkgs.formats.toml {}).generate "ncspot" {
notify = true; notify = true;
shuffle = true; shuffle = true;
cover_max_scale = 2; cover_max_scale = 2;
@ -52,6 +49,16 @@
body = "%title"; body = "%title";
}; };
}; };
example = {};
type = with lib.types; attrsOf anything;
description = "config";
};
};
config = lib.mkIf config.mods.ncspot.enable (
lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ncspot];
xdg.configFile."ncspot/config.toml".source =
lib.mkIf config.mods.ncspot.useConfig (pkgs.formats.toml {}).generate "ncspot" config.mods.ncspot.config;
} }
); );
} }

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -45,7 +46,7 @@
code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)"; code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)";
in { in {
enable = true; enable = true;
interactiveOnly = true; interactiveOnly = mkDashDefault true;
presets = lib.mkIf config.mods.starship.useDefaultPrompt ["pastel-powerline"]; presets = lib.mkIf config.mods.starship.useDefaultPrompt ["pastel-powerline"];
settings = settings =
lib.mkIf config.mods.starship.useDefaultPrompt { lib.mkIf config.mods.starship.useDefaultPrompt {

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -88,11 +89,11 @@
(lib.optionalAttrs (options ? stylix) { (lib.optionalAttrs (options ? stylix) {
stylix = { stylix = {
enable = true; enable = true;
image = ../../base/black.jpg; image = mkDashDefault ../../base/black.jpg;
polarity = "dark"; polarity = mkDashDefault "dark";
targets = { targets = {
nixvim.enable = false; nixvim.enable = mkDashDefault false;
fish.enable = false; fish.enable = mkDashDefault false;
}; };
fonts = config.mods.stylix.fonts; fonts = config.mods.stylix.fonts;
cursor = config.mods.stylix.cursor; cursor = config.mods.stylix.cursor;

View file

@ -1,4 +1,5 @@
{ {
mkDashDefault,
lib, lib,
config, config,
options, options,
@ -41,15 +42,15 @@ in {
libvirtd = { libvirtd = {
enable = true; enable = true;
qemu = { qemu = {
package = pkgs.qemu_kvm; package = mkDashDefault pkgs.qemu_kvm;
swtpm.enable = true; swtpm.enable = mkDashDefault true;
ovmf.enable = true; ovmf.enable = mkDashDefault true;
ovmf.packages = [pkgs.OVMFFull.fd]; ovmf.packages = [pkgs.OVMFFull.fd];
}; };
}; };
spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = mkDashDefault true;
}; };
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = mkDashDefault true;
users.users.${config.conf.username}.extraGroups = [ users.users.${config.conf.username}.extraGroups = [
"libvirtd" "libvirtd"

View file

@ -1,23 +1,25 @@
# credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix # credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix
{ {
lib, lib,
stable, dashNixAdditionalProps,
... ...
}: }: let
stable.buildNpmPackage rec { stable = dashNixAdditionalProps.pkgsDarkreader;
version = "4.9.99"; in
pname = "dark-reader"; stable.buildNpmPackage rec {
npmDepsHash = "sha256-m41HkwgbeRRmxJALQFJl/grYjjIqFOc47ltaesob1FA="; version = "4.9.99";
env.ESBUILD_BINARY_PATH = lib.getExe stable.esbuild; pname = "dark-reader";
patches = [./darkeader.patch]; npmDepsHash = "sha256-m41HkwgbeRRmxJALQFJl/grYjjIqFOc47ltaesob1FA=";
src = stable.fetchFromGitHub { env.ESBUILD_BINARY_PATH = lib.getExe stable.esbuild;
hash = "sha256-K375/4qOyE1Tp/T5V5uCGcNd1IVVbT1Pjdnq/8oRHj0="; patches = [./darkeader.patch];
owner = "darkreader"; src = stable.fetchFromGitHub {
repo = "darkreader"; hash = "sha256-K375/4qOyE1Tp/T5V5uCGcNd1IVVbT1Pjdnq/8oRHj0=";
rev = "v${version}"; owner = "darkreader";
}; repo = "darkreader";
installPhase = '' rev = "v${version}";
mkdir -p $out };
cp build/release/darkreader-firefox.xpi $out/latest.xpi installPhase = ''
''; mkdir -p $out
} cp build/release/darkreader-firefox.xpi $out/latest.xpi
'';
}