Format with nixfmt-rfc

This commit is contained in:
DashieTM 2024-08-25 19:10:41 +02:00
parent 8c9f699269
commit a90a9c3a8e
60 changed files with 1756 additions and 1039 deletions

View file

@ -1,10 +1,19 @@
{ pkgs, config, lib, modulesPath, ... }: {
let username = config.conf.username; pkgs,
in { config,
lib,
modulesPath,
...
}:
let
username = config.conf.username;
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# Bootloader. # Bootloader.
boot = { boot = {
consoleLogLevel = 0;
loader = { loader = {
systemd-boot = { systemd-boot = {
enable = true; enable = true;
@ -12,11 +21,26 @@ in {
}; };
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
plymouth = { enable = true; }; plymouth = {
enable = true;
};
kernelPackages = config.conf.kernel; kernelPackages = config.conf.kernel;
initrd.availableKernelModules = initrd = {
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; verbose = false;
kernelParams = [ ''resume="PARTLABEL=SWAP"'' ] ++ config.conf.boot_params; availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
};
kernelParams = [
''resume="PARTLABEL=SWAP"''
''quiet''
''udev.log_level=3''
] ++ config.conf.boot_params;
}; };
# Enable networking # Enable networking
@ -66,8 +90,7 @@ in {
# Enable sound with pipewire. # Enable sound with pipewire.
hardware = { hardware = {
pulseaudio.enable = false; pulseaudio.enable = false;
cpu.${config.conf.cpu}.updateMicrocode = cpu.${config.conf.cpu}.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
lib.mkDefault config.hardware.enableRedistributableFirmware;
}; };
security.rtkit.enable = true; security.rtkit.enable = true;
@ -92,7 +115,10 @@ in {
"video" "video"
"audio" "audio"
]; ];
packages = with pkgs; [ home-manager xdg-desktop-portal-gtk ]; packages = with pkgs; [
home-manager
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 = "firstlogin"; password = "firstlogin";

View file

@ -1 +1,7 @@
{ imports = [ ./env.nix ./xkb_layout.nix ./common_hardware.nix ]; } {
imports = [
./env.nix
./xkb_layout.nix
./common_hardware.nix
];
}

View file

@ -1,8 +1,8 @@
{ pkgs, config, ... }: { { pkgs, config, ... }:
{
environment = { environment = {
variables = { variables = {
GSETTINGS_SCHEMA_DIR = GSETTINGS_SCHEMA_DIR = "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
"${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
NEOVIDE_MAXIMIZED = "0"; NEOVIDE_MAXIMIZED = "0";
GPG_TTY = "$(tty)"; GPG_TTY = "$(tty)";
EDITOR = "neovide --no-fork"; EDITOR = "neovide --no-fork";

View file

@ -10,7 +10,8 @@ let
key <AD07> { [ u, U, udiaeresis, Udiaeresis ] }; key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
}; };
''; '';
in { in
{
environment.systemPackages = [ pkgs.xorg.xkbcomp ]; environment.systemPackages = [ pkgs.xorg.xkbcomp ];
services.xserver.xkb.extraLayouts.dashie = { services.xserver.xkb.extraLayouts.dashie = {
description = "US layout with 'umlaut'"; description = "US layout with 'umlaut'";

View file

@ -4,8 +4,7 @@
inputs = { inputs = {
dashvim.url = "github:DashieTM/DashVim"; dashvim.url = "github:DashieTM/DashVim";
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
ironbar.url = ironbar.url = "github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
"github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
anyrun.url = "github:Kirottu/anyrun"; anyrun.url = "github:Kirottu/anyrun";
nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
stable.url = "github:NixOs/nixpkgs/nixos-24.05"; stable.url = "github:NixOs/nixpkgs/nixos-24.05";
@ -22,10 +21,11 @@
}; };
}; };
outputs = { ... }@inputs: { outputs =
nixosConfigurations = { ... }@inputs:
(inputs.dashNix.dashNixLib.build_systems [ "example" ] ./.); {
}; nixosConfigurations = (inputs.dashNix.dashNixLib.build_systems [ "example" ] ./.);
};
nixConfig = { nixConfig = {
builders-use-substitutes = true; builders-use-substitutes = true;

View file

@ -24,7 +24,12 @@
drive = { drive = {
device = "/dev/disk/by-label/BOOT"; device = "/dev/disk/by-label/BOOT";
fsType = "vfat"; fsType = "vfat";
options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ]; options = [
"rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
}; };
} }
{ {
@ -32,7 +37,11 @@
drive = { drive = {
device = "/dev/disk/by-label/ROOT"; device = "/dev/disk/by-label/ROOT";
fsType = "ext4"; fsType = "ext4";
options = [ "noatime" "nodiratime" "discard" ]; options = [
"noatime"
"nodiratime"
"discard"
];
}; };
} }
]; ];
@ -50,6 +59,8 @@
kde_connect.enable = true; kde_connect.enable = true;
# TODO change this to your main resolution # TODO change this to your main resolution
# -> this will be your login manager # -> this will be your login manager
greetd = { resolution = "3440x1440@180"; }; greetd = {
resolution = "3440x1440@180";
};
}; };
} }

View file

@ -1 +1 @@
{} { }

View file

@ -1 +1 @@
{} { }

View file

@ -5,7 +5,9 @@
nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
stable.url = "github:NixOs/nixpkgs/nixos-24.05"; stable.url = "github:NixOs/nixpkgs/nixos-24.05";
nix-flatpak = { url = "github:gmodena/nix-flatpak"; }; nix-flatpak = {
url = "github:gmodena/nix-flatpak";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
@ -23,8 +25,7 @@
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
ironbar = { ironbar = {
url = url = "github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
"github:JakeStanger/ironbar?ref=3a1c60442382f970cdb7669814b6ef3594d9f048";
}; };
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
@ -47,11 +48,14 @@
}; };
}; };
outputs = { ... }@inputs: outputs =
{ ... }@inputs:
let let
stable = import inputs.stable { stable = import inputs.stable {
system = "x86_64-linux"; system = "x86_64-linux";
config = { allowUnfree = true; }; config = {
allowUnfree = true;
};
}; };
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
@ -61,7 +65,8 @@
allowUnfree = true; allowUnfree = true;
}; };
}; };
in { in
{
dashNixLib = import ./lib { inherit inputs pkgs; }; dashNixLib = import ./lib { inherit inputs pkgs; };
dashNixInputs = inputs; dashNixInputs = inputs;
stablePkgs = stable; stablePkgs = stable;

View file

@ -1,6 +1,13 @@
{ config, lib, options, ... }: {
let username = config.conf.username; config,
in { lib,
options,
...
}:
let
username = config.conf.username;
in
{
manual = { manual = {
html.enable = false; html.enable = false;
json.enable = false; json.enable = false;
@ -17,7 +24,9 @@ in {
sessionPath = [ "$HOME/.cargo/bin" ]; sessionPath = [ "$HOME/.cargo/bin" ];
sessionVariables = { GOROOT = "$HOME/.go"; }; sessionVariables = {
GOROOT = "$HOME/.go";
};
keyboard = null; keyboard = null;

View file

@ -1,4 +1,13 @@
{ inputs, pkgs, config, lib, mod, additionalHomeConfig, root, ... }: {
inputs,
pkgs,
config,
lib,
mod,
additionalHomeConfig,
root,
...
}:
let let
base_imports = [ base_imports = [
inputs.anyrun.homeManagerModules.default inputs.anyrun.homeManagerModules.default
@ -16,7 +25,8 @@ let
inputs.dashvim.homeManagerModules.dashvim inputs.dashvim.homeManagerModules.dashvim
../modules ../modules
]; ];
in { in
{
xdg = { xdg = {
portal.config.common.default = "*"; portal.config.common.default = "*";
portal = { portal = {
@ -27,13 +37,21 @@ in {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit inputs root; }; extraSpecialArgs = {
inherit inputs root;
};
users.${config.conf.username} = { users.${config.conf.username} = {
imports = [ ./common.nix ./xdg.nix ./themes ./sync.nix ] ++ base_imports imports =
[
./common.nix
./xdg.nix
./themes
./sync.nix
]
++ base_imports
++ lib.optional (builtins.pathExists mod) mod ++ lib.optional (builtins.pathExists mod) mod
++ lib.optional (builtins.pathExists additionalHomeConfig) ++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig;
additionalHomeConfig;
}; };
}; };
} }

View file

@ -1,43 +1,56 @@
# derived from NixOS wiki # derived from NixOS wiki
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
username = config.mods.nextcloud.username; username = config.mods.nextcloud.username;
password = if (config.sops.secrets ? nextcloud.path) then password =
config.sops.secrets.nextcloud.path if (config.sops.secrets ? nextcloud.path) then config.sops.secrets.nextcloud.path else "";
else
"";
url = config.mods.nextcloud.url; url = config.mods.nextcloud.url;
synclist = config.mods.nextcloud.synclist; synclist = config.mods.nextcloud.synclist;
in lib.mkIf config.mods.nextcloud.enable { in
lib.mkIf config.mods.nextcloud.enable {
systemd.user = { systemd.user = {
services = (builtins.listToAttrs (map (opts: { services = (
name = "${opts.name}"; builtins.listToAttrs (
value = { map (opts: {
Unit = { name = "${opts.name}";
Description = "Auto sync Nextcloud"; value = {
After = "network-online.target"; Unit = {
}; Description = "Auto sync Nextcloud";
Service = { After = "network-online.target";
Type = "simple"; };
ExecStart = Service = {
"${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'"; Type = "simple";
TimeoutStopSec = "180"; ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${opts.remote} ${opts.local} https://${username}:$(bat ${password})@${url}'";
KillMode = "process"; TimeoutStopSec = "180";
KillSignal = "SIGINT"; KillMode = "process";
}; KillSignal = "SIGINT";
Install.WantedBy = [ "multi-user.target" ]; };
}; Install.WantedBy = [ "multi-user.target" ];
}) synclist)); };
timers = (builtins.listToAttrs (map (opts: { }) synclist
name = "${opts.name}"; )
value = { );
Unit.Description = timers = (
"Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes"; builtins.listToAttrs (
Timer.OnBootSec = "1min"; map (opts: {
Timer.OnUnitActiveSec = "60min"; name = "${opts.name}";
Install.WantedBy = [ "multi-user.target" "timers.target" ]; value = {
}; Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes";
}) synclist)); Timer.OnBootSec = "1min";
Timer.OnUnitActiveSec = "60min";
Install.WantedBy = [
"multi-user.target"
"timers.target"
];
};
}) synclist
)
);
startServices = true; startServices = true;
}; };
} }

View file

@ -1,4 +1,9 @@
{ config, inputs, pkgs, ... }: {
config,
inputs,
pkgs,
...
}:
let let
username = config.conf.username; username = config.conf.username;
# at time of using this here, stylix might not be evaluated yet # at time of using this here, stylix might not be evaluated yet
@ -22,10 +27,17 @@ let
border: none; border: none;
} }
''; '';
in { in
xdg.configFile."qt5ct/colors/tokyonight.conf" = { text = "${color}"; }; {
xdg.configFile."qt6ct/colors/tokyonight.conf" = { text = "${color}"; }; xdg.configFile."qt5ct/colors/tokyonight.conf" = {
xdg.configFile."qt5ct/qss/tab.qss" = { text = "${qss}"; }; text = "${color}";
};
xdg.configFile."qt6ct/colors/tokyonight.conf" = {
text = "${color}";
};
xdg.configFile."qt5ct/qss/tab.qss" = {
text = "${qss}";
};
xdg.configFile."qt5ct/qt5ct.conf" = { xdg.configFile."qt5ct/qt5ct.conf" = {
text = '' text = ''
[Appearance] [Appearance]
@ -101,4 +113,3 @@ in {
''; '';
}; };
} }

View file

@ -7,39 +7,65 @@ let
videoPlayer = [ "mpv" ]; videoPlayer = [ "mpv" ];
audioPlayer = [ "io.bassi.Amberol" ]; audioPlayer = [ "io.bassi.Amberol" ];
xdgAssociations = type: program: list: xdgAssociations =
builtins.listToAttrs (map (e: { type: program: list:
name = "${type}/${e}"; builtins.listToAttrs (
value = program; map (e: {
}) list); name = "${type}/${e}";
value = program;
}) list
);
image = xdgAssociations "image" imageViewer [ "png" "svg" "jpeg" "gif" ]; image = xdgAssociations "image" imageViewer [
video = xdgAssociations "video" videoPlayer [ "mp4" "avi" "mkv" ]; "png"
audio = xdgAssociations "audio" audioPlayer [ "mp3" "flac" "wav" "aac" ]; "svg"
browserTypes = (xdgAssociations "application" browser [ "jpeg"
"json" "gif"
"x-extension-htm" ];
"x-extension-html" video = xdgAssociations "video" videoPlayer [
"x-extension-shtml" "mp4"
"x-extension-xht" "avi"
"x-extension-xhtml" "mkv"
]) // (xdgAssociations "x-scheme-handler" browser [ ];
"about" audio = xdgAssociations "audio" audioPlayer [
"ftp" "mp3"
"http" "flac"
"https" "wav"
"unknown" "aac"
]); ];
browserTypes =
(xdgAssociations "application" browser [
"json"
"x-extension-htm"
"x-extension-html"
"x-extension-shtml"
"x-extension-xht"
"x-extension-xhtml"
])
// (xdgAssociations "x-scheme-handler" browser [
"about"
"ftp"
"http"
"https"
"unknown"
]);
# XDG MIME types # XDG MIME types
associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) ({ associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) (
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ]; {
"text/html" = browser; "application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ];
"text/plain" = [ "neovide" ]; "text/html" = browser;
"x-scheme-handler/chrome" = [ "com.brave.browser" ]; "text/plain" = [ "neovide" ];
"inode/directory" = [ "yazi" ]; "x-scheme-handler/chrome" = [ "com.brave.browser" ];
} // image // video // audio // browserTypes); "inode/directory" = [ "yazi" ];
in { }
// image
// video
// audio
// browserTypes
);
in
{
xdg = { xdg = {
enable = true; enable = true;
cacheHome = config.home.homeDirectory + "/.local/cache"; cacheHome = config.home.homeDirectory + "/.local/cache";

View file

@ -1,6 +1,8 @@
{ inputs, pkgs, ... }: { inputs, pkgs, ... }:
{ {
/** /**
# build_systems
Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well. Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well.
A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration. A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration.

View file

@ -1,11 +1,23 @@
{ lib, config, pkgs, options, ... }: { {
lib,
config,
pkgs,
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; type =
(enum [ "x86_64-linux" "aarch64-linux" "aarch64-linux-android" ]); with lib.types;
(enum [
"x86_64-linux"
"aarch64-linux"
"aarch64-linux-android"
]);
example = "aarch64-linux"; example = "aarch64-linux";
description = '' description = ''
System architecture. System architecture.
@ -15,7 +27,12 @@
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 [ "amd" "intel" ]); type =
with lib.types;
(enum [
"amd"
"intel"
]);
example = "intel"; example = "intel";
description = '' description = ''
cpu microcode. cpu microcode.
@ -43,10 +60,12 @@
ironbar = { ironbar = {
modules = lib.mkOption { modules = lib.mkOption {
default = [ ]; default = [ ];
example = [{ example = [
type = "upower"; {
class = "memory-usage"; type = "upower";
}]; class = "memory-usage";
}
];
type = with lib.types; listOf attrs; type = with lib.types; listOf attrs;
description = '' description = ''
Adds modules to ironbar. Adds modules to ironbar.
@ -129,8 +148,16 @@
}; };
nvim-colorscheme = lib.mkOption { nvim-colorscheme = lib.mkOption {
default = { tokyonight = { enable = true; }; }; default = {
example = { catppuccin = { enable = true; }; }; tokyonight = {
enable = true;
};
};
example = {
catppuccin = {
enable = true;
};
};
type = lib.types.attrs; type = lib.types.attrs;
description = '' description = ''
nixvim colorscheme. nixvim colorscheme.
@ -167,10 +194,8 @@
}; };
config = { config = {
conf.kernel = conf.kernel = lib.mkIf (
lib.mkIf (config.mods.gaming.enable && config.mods.gaming.kernel) config.mods.gaming.enable && config.mods.gaming.kernel
pkgs.linuxPackages_xanmod_latest; ) pkgs.linuxPackages_xanmod_latest;
} // (lib.optionalAttrs (options ? system.stateVersion) { } // (lib.optionalAttrs (options ? system.stateVersion) { system.stateVersion = "unstable"; });
system.stateVersion = "unstable";
});
} }

View file

@ -1 +1,6 @@
{ imports = [ ./programs ./conf.nix ]; } {
imports = [
./programs
./conf.nix
];
}

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods = { options.mods = {
acpid.enable = lib.mkOption { acpid.enable = lib.mkOption {
@ -11,9 +17,7 @@
}; };
}; };
config = lib.mkIf config.mods.acpid.enable config = lib.mkIf config.mods.acpid.enable (
(lib.optionalAttrs (options ? virtualisation.virtualbox.host) { lib.optionalAttrs (options ? virtualisation.virtualbox.host) { services.acpid.enable = true; }
services.acpid.enable = true; );
});
} }

View file

@ -1,4 +1,12 @@
{ config, lib, options, pkgs, inputs, ... }: { {
config,
lib,
options,
pkgs,
inputs,
...
}:
{
options.mods = { options.mods = {
default_base_packages = { default_base_packages = {
enable = lib.mkOption { enable = lib.mkOption {
@ -21,83 +29,89 @@
}; };
}; };
config = (lib.optionalAttrs (options ? environment.systemPackages) { config = (
environment.systemPackages = lib.optionalAttrs (options ? environment.systemPackages) {
config.mods.default_base_packages.additional_packages; environment.systemPackages = config.mods.default_base_packages.additional_packages;
} // (lib.mkIf config.mods.default_base_packages.enable }
(lib.optionalAttrs (options ? environment.systemPackages) { // (lib.mkIf config.mods.default_base_packages.enable (
environment.systemPackages = with pkgs; [ lib.optionalAttrs (options ? environment.systemPackages) {
openssl environment.systemPackages = with pkgs; [
dbus openssl
glib dbus
gtk4 glib
gtk3 gtk4
libadwaita gtk3
gtk-layer-shell libadwaita
gtk4-layer-shell gtk-layer-shell
direnv gtk4-layer-shell
dconf direnv
gsettings-desktop-schemas dconf
gnome.nixos-gsettings-overrides gsettings-desktop-schemas
bibata-cursors gnome.nixos-gsettings-overrides
xorg.xkbutils bibata-cursors
libxkbcommon xorg.xkbutils
icon-library libxkbcommon
adwaita-icon-theme icon-library
hicolor-icon-theme adwaita-icon-theme
morewaita-icon-theme hicolor-icon-theme
kdePackages.breeze-icons morewaita-icon-theme
seahorse kdePackages.breeze-icons
upower seahorse
thunderbird upower
podman-tui thunderbird
podman-compose podman-tui
dive podman-compose
]; dive
];
gtk.iconCache.enable = false; gtk.iconCache.enable = false;
fonts.packages = with pkgs; [ cantarell-fonts ]; fonts.packages = with pkgs; [ cantarell-fonts ];
virtualisation = { virtualisation = {
containers.enable = true; containers.enable = true;
podman = { podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
};
services = {
upower.enable = true;
dbus = {
enable = true;
packages = with pkgs; [ gnome2.GConf ];
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
programs = {
nix-ld = {
enable = true;
libraries = with pkgs; [ jdk zlib ];
};
direnv = {
package = pkgs.direnv;
silent = false;
loadInNixShell = true;
direnvrcExtra = "";
nix-direnv = {
enable = true; enable = true;
package = pkgs.nix-direnv; dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
}; };
}; };
ssh.startAgent = true;
gnupg.agent.enable = true; services = {
}; upower.enable = true;
}))); dbus = {
enable = true;
packages = with pkgs; [ gnome2.GConf ];
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
programs = {
nix-ld = {
enable = true;
libraries = with pkgs; [
jdk
zlib
];
};
direnv = {
package = pkgs.direnv;
silent = false;
loadInNixShell = true;
direnvrcExtra = "";
nix-direnv = {
enable = true;
package = pkgs.nix-direnv;
};
};
ssh.startAgent = true;
gnupg.agent.enable = true;
};
}
))
);
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods = { options.mods = {
bluetooth.enable = lib.mkOption { bluetooth.enable = lib.mkOption {
default = false; default = false;
@ -10,12 +16,12 @@
}; };
}; };
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 = true;
powerOnBoot = true; powerOnBoot = true;
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, pkgs, options, ... }: { {
lib,
config,
pkgs,
options,
...
}:
{
options.mods = { options.mods = {
coding = { coding = {
enable = lib.mkOption { enable = lib.mkOption {
@ -28,8 +35,8 @@
}; };
}; };
config = lib.mkIf config.mods.coding.enable config = lib.mkIf config.mods.coding.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim { programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true; enable = true;
colorscheme = config.mods.stylix.colorscheme; colorscheme = config.mods.stylix.colorscheme;
@ -141,5 +148,6 @@
tmate tmate
]; ];
}); }
);
} }

View file

@ -1,4 +1,9 @@
{ lib, config, options, ... }: {
lib,
config,
options,
...
}:
let let
driveModule = lib.types.submodule { driveModule = lib.types.submodule {
@ -19,12 +24,17 @@ let
example = { example = {
device = "/dev/disk/by-label/DRIVE2"; device = "/dev/disk/by-label/DRIVE2";
fsType = "ext4"; fsType = "ext4";
options = [ "noatime" "nodiratime" "discard" ]; options = [
"noatime"
"nodiratime"
"discard"
];
}; };
}; };
}; };
}; };
in { in
{
options.mods = { options.mods = {
useSwap = { useSwap = {
enable = lib.mkOption { enable = lib.mkOption {
@ -50,14 +60,20 @@ in {
default = [ default = [
]; ];
example = [{ example = [
name = "drive2"; {
drive = { name = "drive2";
device = "/dev/disk/by-label/DRIVE2"; drive = {
fsType = "ext4"; device = "/dev/disk/by-label/DRIVE2";
options = [ "noatime" "nodiratime" "discard" ]; fsType = "ext4";
}; options = [
}]; "noatime"
"nodiratime"
"discard"
];
};
}
];
# TODO: how to make this work # TODO: how to make this work
# type = with lib.types; listOf (attrsOf driveModule); # type = with lib.types; listOf (attrsOf driveModule);
type = with lib.types; listOf (attrsOf anything); type = with lib.types; listOf (attrsOf anything);
@ -67,33 +83,52 @@ in {
}; };
}; };
config = (lib.optionalAttrs (options ? fileSystems) { config = (
fileSystems = builtins.listToAttrs (map ({ name, drive }: { lib.optionalAttrs (options ? fileSystems) {
name = "/" + name; fileSystems =
value = drive; builtins.listToAttrs (
}) config.mods.extraDrives) map (
// (lib.optionalAttrs config.mods.defaultDrives.enable) { { name, drive }:
"/" = { {
device = "/dev/disk/by-label/ROOT"; name = "/" + name;
fsType = "btrfs"; value = drive;
options = [ "noatime" "nodiratime" "discard" ]; }
}; ) config.mods.extraDrives
)
// (lib.optionalAttrs config.mods.defaultDrives.enable) {
"/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"noatime"
"nodiratime"
"discard"
];
};
"/boot" = { "/boot" = {
device = "/dev/disk/by-label/BOOT"; device = "/dev/disk/by-label/BOOT";
fsType = "vfat"; fsType = "vfat";
options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ]; options = [
}; "rw"
"fmask=0022"
"dmask=0022"
"noatime"
];
};
"/home" = { "/home" = {
device = "/dev/disk/by-label/HOME"; device = "/dev/disk/by-label/HOME";
fsType = "btrfs"; fsType = "btrfs";
options = [ "noatime" "nodiratime" "discard" ]; options = [
"noatime"
"nodiratime"
"discard"
];
};
}; };
}; # TODO make this convert to choice of drives -> thanks to funny types this doesn't work...
# TODO make this convert to choice of drives -> thanks to funny types this doesn't work... swapDevices = lib.mkIf config.mods.useSwap.enable [ { device = "/dev/disk/by-label/SWAP"; } ];
swapDevices = lib.mkIf config.mods.useSwap.enable [{ }
device = "/dev/disk/by-label/SWAP"; );
}];
});
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.firefox = { options.mods.firefox = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -56,8 +63,8 @@
description = "Firefox extensions (from nur)"; description = "Firefox extensions (from nur)";
}; };
}; };
config = lib.mkIf config.mods.firefox.enable config = lib.mkIf config.mods.firefox.enable (
(lib.optionalAttrs (options ? programs.firefox.profiles) { lib.optionalAttrs (options ? programs.firefox.profiles) {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
policies = config.mods.firefox.configuration; policies = config.mods.firefox.configuration;
@ -72,5 +79,6 @@
extensions = config.mods.firefox.extensions; extensions = config.mods.firefox.extensions;
}; };
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.fish = { options.mods.fish = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +14,8 @@
description = "Enables fish"; description = "Enables fish";
}; };
}; };
config = lib.mkIf config.mods.fish.enable config = lib.mkIf config.mods.fish.enable (
(lib.optionalAttrs (options ? programs.fish) { lib.optionalAttrs (options ? programs.fish) {
programs.fish = { programs.fish = {
enable = true; enable = true;
shellInit = '' shellInit = ''
@ -147,5 +154,6 @@
direnv hook fish | source direnv hook fish | source
''; '';
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.flatpak = { options.mods.flatpak = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -13,18 +20,22 @@
description = "Flatpak packages"; description = "Flatpak packages";
}; };
}; };
config = lib.mkIf config.mods.flatpak.enable config = lib.mkIf config.mods.flatpak.enable (
(lib.optionalAttrs (options ? services.flatpak.remote) { lib.optionalAttrs (options ? services.flatpak.remote) {
services.flatpak.remotes = lib.mkOptionDefault [{ services.flatpak.remotes = lib.mkOptionDefault [
name = "flathub-stable"; {
location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; name = "flathub-stable";
}]; location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
];
services.flatpak.uninstallUnmanaged = true; services.flatpak.uninstallUnmanaged = true;
} // lib.optionalAttrs (options ? services.flatpak.packages) { }
// lib.optionalAttrs (options ? services.flatpak.packages) {
services.flatpak.packages = [ services.flatpak.packages = [
# fallback if necessary, but generally avoided as nix is superior :) # fallback if necessary, but generally avoided as nix is superior :)
# default flatseal installation since flatpak permissions are totally not a broken idea # default flatseal installation since flatpak permissions are totally not a broken idea
"com.github.tchx84.Flatseal" "com.github.tchx84.Flatseal"
] ++ config.mods.flatpak.additional_packages; ] ++ config.mods.flatpak.additional_packages;
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.gaming = { options.mods.gaming = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
@ -7,7 +14,14 @@
description = "Enabled gaming related features."; description = "Enabled gaming related features.";
}; };
tools = lib.mkOption { tools = lib.mkOption {
default = with pkgs; [ gamemode steam lutris wine adwsteamgtk heroic ]; default = with pkgs; [
gamemode
steam
lutris
wine
adwsteamgtk
heroic
];
example = [ ]; example = [ ];
type = with lib.types; listOf package; type = with lib.types; listOf package;
description = "Install gaming related packages"; description = "Install gaming related packages";
@ -34,8 +48,7 @@
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = description = "Whether to use GPU performance setting. NOTE: this is at your own risk!";
"Whether to use GPU performance setting. NOTE: this is at your own risk!";
}; };
gpu_device = lib.mkOption { gpu_device = lib.mkOption {
default = 0; default = 0;
@ -44,8 +57,8 @@
description = "Your gpu device.(Physical id of lshw)"; description = "Your gpu device.(Physical id of lshw)";
}; };
}; };
config = lib.mkIf config.mods.gaming.enable config = lib.mkIf config.mods.gaming.enable (
(lib.optionalAttrs (options ? environment.systemPackages) { lib.optionalAttrs (options ? environment.systemPackages) {
environment.systemPackages = config.mods.gaming.tools; environment.systemPackages = config.mods.gaming.tools;
programs.steam.enable = config.mods.gaming.steam; programs.steam.enable = config.mods.gaming.steam;
@ -53,7 +66,9 @@
programs.gamemode = { programs.gamemode = {
enableRenice = true; enableRenice = true;
settings = { settings = {
general = { governor = "performance"; }; general = {
governor = "performance";
};
gpu = lib.mkIf config.mods.gaming.gpu_optimization { gpu = lib.mkIf config.mods.gaming.gpu_optimization {
apply_gpu_optimisations = "accept-responsibility"; apply_gpu_optimisations = "accept-responsibility";
gpu_device = config.mods.gaming.gpu_device; gpu_device = config.mods.gaming.gpu_device;
@ -66,5 +81,6 @@
}; };
}; };
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.git = { options.mods.git = {
username = lib.mkOption { username = lib.mkOption {
default = "DashieTM"; default = "DashieTM";
@ -15,19 +22,9 @@
ssh_config = lib.mkOption { ssh_config = lib.mkOption {
default = '' default = ''
Host github.com Host github.com
${ ${if (config.sops.secrets ? hub.path) then "IdentityFile ${config.sops.secrets.hub.path}" else ""}
if (config.sops.secrets ? hub.path) then
"IdentityFile ${config.sops.secrets.hub.path}"
else
""
}
Host gitlab.com Host gitlab.com
${ ${if (config.sops.secrets ? lab.path) then "IdentityFile ${config.sops.secrets.lab.path}" else ""}
if (config.sops.secrets ? lab.path) then
"IdentityFile ${config.sops.secrets.lab.path}"
else
""
}
Host dashie.org Host dashie.org
${ ${
if (config.sops.secrets ? dashie.path) then if (config.sops.secrets ? dashie.path) then
@ -41,16 +38,22 @@
description = "ssh configuration (keys for git)"; description = "ssh configuration (keys for git)";
}; };
}; };
config = (lib.optionalAttrs (options ? programs.git && options ? home.file) { config = (
programs.git = { lib.optionalAttrs (options ? programs.git && options ? home.file) {
enable = true; programs.git = {
userName = config.mods.git.username; enable = true;
userEmail = config.mods.git.email; userName = config.mods.git.username;
extraConfig = { userEmail = config.mods.git.email;
merge = { tool = "nvimdiff"; }; extraConfig = {
diff = { tool = "nvimdiff"; }; merge = {
tool = "nvimdiff";
};
diff = {
tool = "nvimdiff";
};
};
}; };
}; home.file.".ssh/config".text = config.mods.git.ssh_config;
home.file.".ssh/config".text = config.mods.git.ssh_config; }
}); );
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods = { options.mods = {
gnome_services.enable = lib.mkOption { gnome_services.enable = lib.mkOption {
default = true; default = true;
@ -11,17 +18,26 @@
}; };
}; };
config = lib.mkIf config.mods.gnome_services.enable config = lib.mkIf config.mods.gnome_services.enable (
(lib.optionalAttrs (options ? services.gnome.gnome-keyring) { lib.optionalAttrs (options ? services.gnome.gnome-keyring) {
programs.dconf.enable = true; programs.dconf.enable = true;
services = { services = {
# needed for GNOME services outside of GNOME Desktop # needed for GNOME services outside of GNOME Desktop
dbus.packages = with pkgs; [ gcr gnome.gnome-settings-daemon ]; dbus.packages = with pkgs; [
gcr
gnome.gnome-settings-daemon
];
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
gvfs.enable = true; gvfs.enable = true;
}; };
} // lib.optionalAttrs (options ? home.packages) { }
home.packages = with pkgs; [ nautilus sushi nautilus-python ]; // lib.optionalAttrs (options ? home.packages) {
}); home.packages = with pkgs; [
nautilus
sushi
nautilus-python
];
}
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods = { options.mods = {
nvidia.enable = lib.mkOption { nvidia.enable = lib.mkOption {
@ -37,8 +44,8 @@
}; };
}; };
config = lib.mkIf config.mods.vapi.enable config = lib.mkIf config.mods.vapi.enable (
(lib.optionalAttrs (options ? hardware.graphics) { lib.optionalAttrs (options ? hardware.graphics) {
boot = lib.mkIf config.mods.amdgpu.enable { boot = lib.mkIf config.mods.amdgpu.enable {
kernelModules = [ "kvm-amd" ]; kernelModules = [ "kvm-amd" ];
initrd.kernelModules = [ "amdgpu" ]; initrd.kernelModules = [ "amdgpu" ];
@ -46,20 +53,27 @@
}; };
hardware = { hardware = {
graphics = let graphics =
base_packages = let
[ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.mesa.drivers ]; base_packages = [
rocm_packages = pkgs.libvdpau-va-gl
[ pkgs.rocmPackages.clr.icd pkgs.rocm-opencl-runtime ]; pkgs.vaapiVdpau
in { pkgs.mesa.drivers
enable = true; ];
enable32Bit = lib.mkDefault true; rocm_packages = [
extraPackages = base_packages pkgs.rocmPackages.clr.icd
++ (lib.lists.optionals config.mods.vapi.rocm.enable rocm_packages); pkgs.rocm-opencl-runtime
}; ];
in
{
enable = true;
enable32Bit = lib.mkDefault true;
extraPackages = base_packages ++ (lib.lists.optionals config.mods.vapi.rocm.enable rocm_packages);
};
}; };
} // lib.optionalAttrs (options ? hardware.graphics) }
(lib.mkIf config.mods.nvidia.enable { // lib.optionalAttrs (options ? hardware.graphics) (
lib.mkIf config.mods.nvidia.enable {
hardware.nvidia = { hardware.nvidia = {
modesetting.enable = true; modesetting.enable = true;
# powerManagement.enable = false; # powerManagement.enable = false;
@ -69,5 +83,7 @@
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
}; };
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
})); }
)
);
} }

View file

@ -1,4 +1,12 @@
{ config, lib, inputs, pkgs, options, ... }: { {
config,
lib,
inputs,
pkgs,
options,
...
}:
{
options.mods = { options.mods = {
greetd = { greetd = {
enable = lib.mkOption { enable = lib.mkOption {
@ -38,60 +46,72 @@
}; };
}; };
config = let config =
username = config.conf.username; let
session = { username = config.conf.username;
command = "${ session = {
command = "${
lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland
} --config /etc/greetd/hyprgreet.conf"; } --config /etc/greetd/hyprgreet.conf";
user = username; user = username;
};
in lib.mkIf config.mods.greetd.enable
(lib.optionalAttrs (options ? environment) {
services.xserver.displayManager.session = [{
manage = "desktop";
name = "Hyprland";
start = ''
${lib.getExe pkgs.hyprland} & waitPID=$!
'';
}];
# greetd display manager
programs.hyprland.enable = true;
services.greetd = {
enable = true;
settings = {
terminal.vt = 1;
default_session = session;
}; };
}; in
lib.mkIf config.mods.greetd.enable (
lib.optionalAttrs (options ? environment) {
services.xserver.displayManager.session = [
{
manage = "desktop";
name = "Hyprland";
start = ''
${lib.getExe pkgs.hyprland} & waitPID=$!
'';
}
];
environment.etc."greetd/environments".text = '' # greetd display manager
Hyprland programs.hyprland.enable = true;
''; services.greetd = {
enable = true;
settings = {
terminal.vt = 1;
default_session = session;
};
};
# should technically be the same, but this is configured instead in order to provide a decent out of the box login experience. environment.etc."greetd/environments".text = ''
environment.etc."greetd/hyprgreet.conf".text = '' Hyprland
exec-once=gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' '';
monitor=${config.mods.greetd.monitor},${config.mods.greetd.resolution},0x0,${config.mods.greetd.scale} # should technically be the same, but this is configured instead in order to provide a decent out of the box login experience.
monitor=,disable environment.etc."greetd/hyprgreet.conf".text = ''
exec-once=gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
input { monitor=${config.mods.greetd.monitor},${config.mods.greetd.resolution},0x0,${config.mods.greetd.scale}
kb_layout = ${config.mods.xkb.layout} monitor=,disable
kb_variant = ${config.mods.xkb.variant}
force_no_accel = true input {
kb_layout = ${config.mods.xkb.layout}
kb_variant = ${config.mods.xkb.variant}
force_no_accel = true
}
cursor {
enable_hyprcursor = false
}
misc {
disable_splash_rendering = false
disable_hyprland_logo = false
}
env=XCURSOR_THEME,${config.mods.stylix.cursor.name}
env=XCURSOR_SIZE,${config.mods.stylix.cursor.size}
exec-once=regreet --style /home/${username}/.config/gtk-3.0/gtk.css; hyprctl dispatch exit
'';
# unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = true;
} }
);
misc {
disable_splash_rendering = false
disable_hyprland_logo = false
}
exec-once=regreet --style /home/${username}/.config/gtk-3.0/gtk.css; hyprctl dispatch exit
'';
# unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = true;
});
} }

View file

@ -1,4 +1,12 @@
{ lib, options, config, pkgs, inputs, ... }: { {
lib,
options,
config,
pkgs,
inputs,
...
}:
{
options.mods.home_packages = { options.mods.home_packages = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -16,71 +24,76 @@
''; '';
}; };
}; };
config = (lib.optionalAttrs (options ? home.packages) { config = (
home.packages = config.mods.home_packages.additional_packages; lib.optionalAttrs (options ? home.packages) {
} // (lib.mkIf config.mods.home_packages.enable home.packages = config.mods.home_packages.additional_packages;
(lib.optionalAttrs (options ? home.packages) { }
home.packages = with pkgs; [ // (lib.mkIf config.mods.home_packages.enable (
nheko lib.optionalAttrs (options ? home.packages) {
nextcloud-client home.packages = with pkgs; [
xournalpp nheko
vesktop nextcloud-client
kitty xournalpp
ripgrep vesktop
# TODO add fcp once fixed.... kitty
rm-improved ripgrep
bat # TODO add fcp once fixed....
fd rm-improved
lsd bat
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) fd
noto-fonts lsd
flatpak (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
networkmanager noto-fonts
zoxide flatpak
fastfetch networkmanager
gnome-keyring zoxide
dbus fastfetch
killall gnome-keyring
adw-gtk3 dbus
qt5ct killall
qt6ct adw-gtk3
gnutar qt5ct
nix-index qt6ct
libnotify gnutar
zenith nix-index
nh libnotify
amberol zenith
pulseaudio nh
playerctl amberol
ncspot pulseaudio
poppler_utils playerctl
brave ncspot
greetd.regreet poppler_utils
flake-checker brave
ffmpeg greetd.regreet
system-config-printer flake-checker
brightnessctl ffmpeg
]; system-config-printer
brightnessctl
xdg.configFile."direnv/direnv.toml".source =
(pkgs.formats.toml { }).generate "direnv" {
global = { warn_timeout = "-1s"; };
};
#my own programs
programs = {
hyprdock.enable = true;
oxicalc.enable = true;
ReSet.enable = true;
ReSet.config.plugins = [
inputs.reset-plugins.packages."x86_64-linux".monitor
inputs.reset-plugins.packages."x86_64-linux".keyboard
]; ];
ReSet.config.plugin_config = {
Keyboard = { xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml { }).generate "direnv" {
path = "/home/${config.conf.username}/.config/reset/keyboard.conf"; global = {
warn_timeout = "-1s";
}; };
}; };
};
}))); #my own programs
programs = {
hyprdock.enable = true;
oxicalc.enable = true;
ReSet.enable = true;
ReSet.config.plugins = [
inputs.reset-plugins.packages."x86_64-linux".monitor
inputs.reset-plugins.packages."x86_64-linux".keyboard
];
ReSet.config.plugin_config = {
Keyboard = {
path = "/home/${config.conf.username}/.config/reset/keyboard.conf";
};
};
};
}
))
);
} }

View file

@ -1,4 +1,12 @@
{ lib, config, pkgs, options, inputs, ... }: { {
lib,
config,
pkgs,
options,
inputs,
...
}:
{
options.mods = { options.mods = {
hyprland.anyrun = { hyprland.anyrun = {
enable = lib.mkOption { enable = lib.mkOption {
@ -10,8 +18,8 @@
}; };
}; };
config = lib.mkIf config.mods.hyprland.anyrun.enable config = lib.mkIf config.mods.hyprland.anyrun.enable (
(lib.optionalAttrs (options ? programs.anyrun) { lib.optionalAttrs (options ? programs.anyrun) {
programs.anyrun = { programs.anyrun = {
enable = true; enable = true;
config = { config = {
@ -23,8 +31,12 @@
]; ];
#position = "center"; #position = "center";
hideIcons = false; hideIcons = false;
width = { fraction = 0.3; }; width = {
y = { fraction = 0.5; }; fraction = 0.3;
};
y = {
fraction = 0.5;
};
layer = "overlay"; layer = "overlay";
hidePluginInfo = true; hidePluginInfo = true;
closeOnClick = true; closeOnClick = true;
@ -79,5 +91,6 @@
} }
''; '';
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ config, lib, options, pkgs, ... }: { {
config,
lib,
options,
pkgs,
...
}:
{
options.mods = { options.mods = {
hyprland = { hyprland = {
enable = lib.mkOption { enable = lib.mkOption {
@ -61,8 +68,8 @@
}; };
}; };
config = lib.mkIf config.mods.hyprland.enable config = lib.mkIf config.mods.hyprland.enable (
(lib.optionalAttrs (options ? wayland.windowManager.hyprland) { lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# install Hyprland related packages # install Hyprland related packages
home.packages = with pkgs; [ home.packages = with pkgs; [
xorg.xprop xorg.xprop
@ -82,15 +89,16 @@
lib.mkIf config.mods.hyprland.use_default_config { lib.mkIf config.mods.hyprland.use_default_config {
"$mod" = "SUPER"; "$mod" = "SUPER";
bindm = bindm = [
[ "$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow" ]; "$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
bind = [ bind = [
# screenshots # screenshots
''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy'' ''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy''
''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -'' ''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -''
'' ''$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
$mod SUPERSHIFTALT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
# regular programs # regular programs
"$mod SUPER,F,exec,firefox" "$mod SUPER,F,exec,firefox"
@ -108,19 +116,14 @@
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
# media keys # media keys
(lib.mkIf config.mods.scripts.audio-control (lib.mkIf config.mods.scripts.audio-control ",XF86AudioMute,exec, audio-control mute")
",XF86AudioMute,exec, audio-control mute") (lib.mkIf config.mods.scripts.audio-control ",XF86AudioLowerVolume,exec, audio-control sink -5%")
(lib.mkIf config.mods.scripts.audio-control (lib.mkIf config.mods.scripts.audio-control ",XF86AudioRaiseVolume,exec, audio-control sink +5%")
",XF86AudioLowerVolume,exec, audio-control sink -5%")
(lib.mkIf config.mods.scripts.audio-control
",XF86AudioRaiseVolume,exec, audio-control sink +5%")
",XF86AudioPlay,exec, playerctl play-pause" ",XF86AudioPlay,exec, playerctl play-pause"
",XF86AudioNext,exec, playerctl next" ",XF86AudioNext,exec, playerctl next"
",XF86AudioPrev,exec, playerctl previous" ",XF86AudioPrev,exec, playerctl previous"
(lib.mkIf config.mods.scripts.change-brightness (lib.mkIf config.mods.scripts.change-brightness ",XF86MonBrightnessDown,exec, change-brightness brightness 10%-")
",XF86MonBrightnessDown,exec, change-brightness brightness 10%-") (lib.mkIf config.mods.scripts.change-brightness ",XF86MonBrightnessUp,exec, change-brightness brightness +10%")
(lib.mkIf config.mods.scripts.change-brightness
",XF86MonBrightnessUp,exec, change-brightness brightness +10%")
# hyprland keybinds # hyprland keybinds
# misc # misc
@ -199,13 +202,14 @@
general = { general = {
gaps_out = "3,5,5,5"; gaps_out = "3,5,5,5";
border_size = 3; border_size = 3;
"col.active_border" = "col.active_border" = lib.mkForce "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
lib.mkForce "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
# "col.inactive_border" = "0x66333333"; # "col.inactive_border" = "0x66333333";
allow_tearing = lib.mkIf config.mods.hyprland.no_atomic true; allow_tearing = lib.mkIf config.mods.hyprland.no_atomic true;
}; };
decoration = { rounding = 4; }; decoration = {
rounding = 4;
};
animations = { animations = {
bezier = "penguin,0.05,0.9,0.1,1.0"; bezier = "penguin,0.05,0.9,0.1,1.0";
@ -254,7 +258,9 @@
# no_break_fs_vrr = true; # no_break_fs_vrr = true;
}; };
gestures = { workspace_swipe = true; }; gestures = {
workspace_swipe = true;
};
monitor = config.mods.hyprland.monitor; monitor = config.mods.hyprland.monitor;
workspace = config.mods.hyprland.workspace; workspace = config.mods.hyprland.workspace;
@ -265,10 +271,10 @@
"XDG_CURRENT_DESKTOP=Hyprland" "XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland" "XDG_SESSION_TYPE=wayland"
"XDG_SESSION_DESKTOP=Hyprland" "XDG_SESSION_DESKTOP=Hyprland"
"HYPRCURSOR_THEME,Bibata-Modern-Classic" "HYPRCURSOR_THEME,${config.mods.stylix.cursor.name}"
"HYPRCURSOR_SIZE,24" "HYPRCURSOR_SIZE,${config.mods.stylix.cursor.size}"
"XCURSOR_THEME,Bibata-Modern-Classic" "XCURSOR_THEME,${config.mods.stylix.cursor.name}"
"XCURSOR_SIZE,24" "XCURSOR_SIZE,${config.mods.stylix.cursor.size}"
"QT_QPA_PLATFORM,wayland" "QT_QPA_PLATFORM,wayland"
"QT_QPA_PLATFORMTHEME,qt5ct" "QT_QPA_PLATFORMTHEME,qt5ct"
"QT_WAYLAND_FORCE_DPI,96" "QT_WAYLAND_FORCE_DPI,96"
@ -282,8 +288,7 @@
(lib.mkIf config.mods.nvidia.enable "LIBVA_DRIVER_NAME,nvidia") (lib.mkIf config.mods.nvidia.enable "LIBVA_DRIVER_NAME,nvidia")
(lib.mkIf config.mods.nvidia.enable "XDG_SESSION_TYPE,wayland") (lib.mkIf config.mods.nvidia.enable "XDG_SESSION_TYPE,wayland")
(lib.mkIf config.mods.nvidia.enable "GBM_BACKEND,nvidia-drm") (lib.mkIf config.mods.nvidia.enable "GBM_BACKEND,nvidia-drm")
(lib.mkIf config.mods.nvidia.enable (lib.mkIf config.mods.nvidia.enable "__GLX_VENDOR_LIBRARY_NAME,nvidia")
"__GLX_VENDOR_LIBRARY_NAME,nvidia")
]; ];
layerrule = [ layerrule = [
@ -338,9 +343,11 @@
# ]; # ];
# }; # };
# }; # };
} // config.mods.hyprland.custom_config; }
// config.mods.hyprland.custom_config;
# wayland.windowManager.hyprland.plugins = [ # wayland.windowManager.hyprland.plugins = [
# inputs.Hyprspace.packages.${pkgs.system}.Hyprspace # inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
# ]; # ];
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ config, lib, options, pkgs, ... }: { {
config,
lib,
options,
pkgs,
...
}:
{
options.mods = { options.mods = {
hyprland.hyprlock = { hyprland.hyprlock = {
enable = lib.mkOption { enable = lib.mkOption {
@ -10,33 +17,40 @@
}; };
}; };
config = lib.mkIf config.mods.hyprland.hyprlock.enable config = lib.mkIf config.mods.hyprland.hyprlock.enable (
(lib.optionalAttrs (options ? xdg.configFile) { lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [ hyprlock ]; home.packages = with pkgs; [ hyprlock ];
programs.hyprlock = lib.mkIf config.mods.hyprland.hyprlock.enable { programs.hyprlock = lib.mkIf config.mods.hyprland.hyprlock.enable {
enable = true; enable = true;
settings = { settings = {
background = [{ background = [
monitor = ""; {
path = ""; monitor = "";
color = "rgba(26, 27, 38, 1.0)"; path = "";
}]; color = "rgba(26, 27, 38, 1.0)";
}
];
input-field = [{ input-field = [
monitor = "${config.conf.monitor}"; {
monitor = "${config.conf.monitor}";
placeholder_text = "password or something"; placeholder_text = "password or something";
}]; }
];
label = [{ label = [
monitor = "${config.conf.monitor}"; {
text = "$TIME"; monitor = "${config.conf.monitor}";
font_size = 50; text = "$TIME";
position = "0, 200"; font_size = 50;
valign = "center"; position = "0, 200";
halign = "center"; valign = "center";
}]; halign = "center";
}
];
}; };
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ config, lib, options, pkgs, ... }: { {
config,
lib,
options,
pkgs,
...
}:
{
options.mods = { options.mods = {
hyprland.hyprpaper = { hyprland.hyprpaper = {
enable = lib.mkOption { enable = lib.mkOption {
@ -20,12 +27,12 @@
}; };
}; };
config = lib.mkIf config.mods.hyprland.hyprpaper.enable config = lib.mkIf config.mods.hyprland.hyprpaper.enable (
(lib.optionalAttrs (options ? xdg.configFile) { lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [ hyprpaper ]; home.packages = with pkgs; [ hyprpaper ];
xdg.configFile."hypr/hyprpaper.conf" = xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hyprland.hyprpaper.enable {
lib.mkIf config.mods.hyprland.hyprpaper.enable { text = config.mods.hyprland.hyprpaper.config;
text = config.mods.hyprland.hyprpaper.config; };
}; }
}); );
} }

View file

@ -1,6 +1,14 @@
{ lib, config, pkgs, options, ... }: {
let username = config.conf.username; lib,
in { config,
pkgs,
options,
...
}:
let
username = config.conf.username;
in
{
options.mods = { options.mods = {
hyprland.ironbar = { hyprland.ironbar = {
enable = lib.mkOption { enable = lib.mkOption {
@ -11,8 +19,8 @@ in {
}; };
}; };
}; };
config = lib.mkIf config.mods.hyprland.ironbar.enable config = lib.mkIf config.mods.hyprland.ironbar.enable (
(lib.optionalAttrs (options ? programs.ironbar) { lib.optionalAttrs (options ? programs.ironbar) {
programs.ironbar = { programs.ironbar = {
enable = true; enable = true;
@ -164,78 +172,78 @@ in {
} }
{ {
type = "custom"; type = "custom";
bar = [{ bar = [
type = "button"; {
class = "popup-button"; type = "button";
label = ""; class = "popup-button";
on_click = "popup:toggle"; label = "";
}]; on_click = "popup:toggle";
}
];
class = "popup-button-box"; class = "popup-button-box";
popup = [{ popup = [
type = "box"; {
orientation = "vertical"; type = "box";
class = "audio-box"; orientation = "vertical";
widgets = [ class = "audio-box";
{ widgets = [
type = "box"; {
orientation = "horizontal"; type = "box";
widgets = [ orientation = "horizontal";
{ widgets = [
type = "button"; {
class = "audio-button"; type = "button";
label = ""; class = "audio-button";
on_click = label = "";
"!/home/${username}/.config/eww/scripts/audio_control.sh bluetooth"; on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh bluetooth";
} }
{ {
type = "button"; type = "button";
class = "audio-button"; class = "audio-button";
label = "󰋋"; label = "󰋋";
on_click = on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh internal";
"!/home/${username}/.config/eww/scripts/audio_control.sh internal"; }
} ];
]; class = "audio-button-box";
class = "audio-button-box"; }
} {
{ type = "label";
type = "label"; label = "Output";
label = "Output"; }
} {
{ type = "slider";
type = "slider"; class = "audio-slider";
class = "audio-slider"; step = 1.0;
step = 1.0; length = 200;
length = 200; value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
value = on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
"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 = "label"; }
label = "Input"; {
} type = "slider";
{ class = "audio-slider";
type = "slider"; step = 1.0;
class = "audio-slider"; length = 200;
step = 1.0; value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
length = 200; on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
value = }
"pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'"; ];
on_change = }
"!pactl set-source-volume @DEFAULT_SOURCE@ $0%"; ];
}
];
}];
} }
{ {
type = "custom"; type = "custom";
bar = [{ bar = [
type = "button"; {
class = "popup-button"; type = "button";
label = ""; class = "popup-button";
on_click = label = "";
"!oxidash --css /home/${username}/gits/oxidash/style.css"; on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
}]; }
];
class = "popup-button-box"; class = "popup-button-box";
} }
{ {
@ -249,19 +257,24 @@ in {
position = "top"; position = "top";
height = 10; height = 10;
anchor_to_edges = true; anchor_to_edges = true;
start = [{ start = [
type = "workspaces"; {
all_monitors = true; type = "workspaces";
}]; all_monitors = true;
center = [{ }
type = "focused"; ];
show_icon = true; center = [
show_title = true; {
icon_size = 20; type = "focused";
truncate = "end"; show_icon = true;
}]; show_title = true;
icon_size = 20;
truncate = "end";
}
];
}; };
}; };
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods = { options.mods = {
kde_connect.enable = lib.mkOption { kde_connect.enable = lib.mkOption {
@ -11,21 +18,25 @@
}; };
}; };
config = lib.mkIf config.mods.kde_connect.enable config = lib.mkIf config.mods.kde_connect.enable (
(lib.optionalAttrs (options ? networking.firewall) { lib.optionalAttrs (options ? networking.firewall) {
networking.firewall = { networking.firewall = {
allowedTCPPortRanges = [{ allowedTCPPortRanges = [
from = 1714; {
to = 1764; from = 1714;
} # KDE Connect to = 1764;
]; }
allowedUDPPortRanges = [{ # KDE Connect
from = 1714; ];
to = 1764; allowedUDPPortRanges = [
} # KDE Connect {
]; from = 1714;
to = 1764;
}
# KDE Connect
];
}; };
} // lib.optionalAttrs (options ? home.packages) { }
home.packages = with pkgs; [ kdeconnect ]; // lib.optionalAttrs (options ? home.packages) { home.packages = with pkgs; [ kdeconnect ]; }
}); );
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.keepassxc = { options.mods.keepassxc = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -10,8 +17,7 @@
default = true; default = true;
example = false; example = false;
type = lib.types.bool; type = lib.types.bool;
description = description = "Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
"Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
}; };
cache_config = lib.mkOption { cache_config = lib.mkOption {
default = '' default = ''
@ -26,8 +32,8 @@
description = "Cache config to be used."; 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" = {
text = '' text = ''
@ -53,9 +59,9 @@
''; '';
}; };
home.file.".cache/keepassxc/keepassxc.ini" = home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.use_cache_config {
lib.mkIf config.mods.keepassxc.use_cache_config { text = config.mods.keepassxc.cache_config;
text = config.mods.keepassxc.cache_config; };
}; }
}); );
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, inputs, ... }: {
lib,
config,
options,
pkgs,
inputs,
...
}:
let let
base16 = pkgs.callPackage inputs.base16.lib { }; base16 = pkgs.callPackage inputs.base16.lib { };
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
@ -20,12 +27,14 @@ let
"e" = "d"; "e" = "d";
"f" = "e"; "f" = "e";
}; };
base = "#" + lib.strings.concatStrings base =
((lib.lists.take 5 (lib.strings.stringToCharacters scheme.base00)) ++ [ "#"
hexTable."${(lib.lists.last + lib.strings.concatStrings (
(lib.strings.stringToCharacters scheme.base00))}" (lib.lists.take 5 (lib.strings.stringToCharacters scheme.base00))
]); ++ [ hexTable."${(lib.lists.last (lib.strings.stringToCharacters scheme.base00))}" ]
in { );
in
{
options.mods.kitty = { options.mods.kitty = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -34,9 +43,11 @@ in {
description = "Enables kitty"; description = "Enables kitty";
}; };
}; };
config = lib.mkIf config.mods.kitty.enable config = lib.mkIf config.mods.kitty.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
stylix.targets.kitty = { enable = false; }; stylix.targets.kitty = {
enable = false;
};
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings = { settings = {
@ -89,6 +100,6 @@ in {
}; };
}; };
}); }
);
} }

View file

@ -1,4 +1,10 @@
{ lib, options, config, ... }: { {
lib,
options,
config,
...
}:
{
options.mods.xkb = { options.mods.xkb = {
layout = lib.mkOption { layout = lib.mkOption {
default = "dashie"; default = "dashie";
@ -13,11 +19,13 @@
description = "Your variant"; description = "Your variant";
}; };
}; };
config = (lib.optionalAttrs (options ? services.xserver) { config = (
# Configure keymap in X11 lib.optionalAttrs (options ? services.xserver) {
services.xserver = { # Configure keymap in X11
xkb.layout = "${config.mods.xkb.layout}"; services.xserver = {
xkb.variant = "${config.mods.xkb.variant}"; xkb.layout = "${config.mods.xkb.layout}";
}; xkb.variant = "${config.mods.xkb.variant}";
}); };
}
);
} }

View file

@ -1,4 +1,11 @@
{ lib, options, config, pkgs, ... }: { {
lib,
options,
config,
pkgs,
...
}:
{
options.mods.media_packages = { options.mods.media_packages = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -16,38 +23,42 @@
''; '';
}; };
}; };
config = (lib.optionalAttrs (options ? home.packages) { config = (
home.packages = config.mods.media_packages.additional_packages; lib.optionalAttrs (options ? home.packages) {
} // (lib.mkIf config.mods.media_packages.enable home.packages = config.mods.media_packages.additional_packages;
(lib.optionalAttrs (options ? home.packages) { }
home.packages = with pkgs; [ // (lib.mkIf config.mods.media_packages.enable (
# base audio lib.optionalAttrs (options ? home.packages) {
pipewire home.packages = with pkgs; [
wireplumber # base audio
# audio control pipewire
playerctl wireplumber
# images # audio control
imv playerctl
# videos # images
mpv imv
# pdf # videos
zathura mpv
evince # pdf
libreoffice-fresh zathura
onlyoffice-bin evince
pdftk libreoffice-fresh
pdfpc onlyoffice-bin
polylux2pdfpc pdftk
# spotify pdfpc
# video editing polylux2pdfpc
kdenlive # spotify
# image creation # video editing
inkscape kdenlive
gimp # image creation
krita inkscape
yt-dlp gimp
]; krita
programs.obs-studio.enable = true; yt-dlp
programs.obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ]; ];
}))); programs.obs-studio.enable = true;
programs.obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ];
}
))
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.ncspot = { options.mods.ncspot = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
@ -7,45 +14,45 @@
description = "Enables ncspot with a config"; description = "Enables ncspot with a config";
}; };
}; };
config = lib.mkIf config.mods.ncspot.enable config = lib.mkIf config.mods.ncspot.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ ncspot ]; home.packages = with pkgs; [ ncspot ];
xdg.configFile."ncspot/config.toml".source = xdg.configFile."ncspot/config.toml".source = (pkgs.formats.toml { }).generate "ncspot" {
(pkgs.formats.toml { }).generate "ncspot" { notify = true;
notify = true; shuffle = true;
shuffle = true; cover_max_scale = 2;
cover_max_scale = 2; initial_screen = "library";
initial_screen = "library"; library_tabs = [ "playlists" ];
library_tabs = [ "playlists" ]; theme = {
theme = { background = "#1a1b26";
background = "#1a1b26"; primary = "#9aa5ce";
primary = "#9aa5ce"; secondary = "#414868";
secondary = "#414868"; title = "#9ece6a";
title = "#9ece6a"; playing = "#7aa2f7";
playing = "#7aa2f7"; playing_selected = "#bb9af7";
playing_selected = "#bb9af7"; playing_bg = "#24283b";
playing_bg = "#24283b"; highlight = "#c0caf5";
highlight = "#c0caf5"; highlight_bg = "#24283b";
highlight_bg = "#24283b"; error = "#414868";
error = "#414868"; error_bg = "#f7768e";
error_bg = "#f7768e"; statusbar = "#ff9e64";
statusbar = "#ff9e64"; statusbar_progress = "#7aa2f7";
statusbar_progress = "#7aa2f7"; statusbar_bg = "#1a1b26";
statusbar_bg = "#1a1b26"; cmdline = "#c0caf5";
cmdline = "#c0caf5"; cmdline_bg = "#24283b";
cmdline_bg = "#24283b"; search_match = "#f7768e";
search_match = "#f7768e";
};
keybindings = {
"j" = "move left 1";
"k" = "move down 1";
"l" = "move up 1";
";" = "move right 1";
};
notification_format = {
title = "%artists";
body = "%title";
};
}; };
}); keybindings = {
"j" = "move left 1";
"k" = "move down 1";
"l" = "move up 1";
";" = "move right 1";
};
notification_format = {
title = "%artists";
body = "%title";
};
};
}
);
} }

View file

@ -1,4 +1,5 @@
{ lib, ... }: { { lib, ... }:
{
options.mods = { options.mods = {
nextcloud = { nextcloud = {
enable = lib.mkOption { enable = lib.mkOption {
@ -21,11 +22,13 @@
}; };
synclist = lib.mkOption { synclist = lib.mkOption {
default = [ ]; default = [ ];
example = [{ example = [
name = "sync globi folder"; {
remote = "globi"; name = "sync globi folder";
local = "/home/globi"; remote = "globi";
}]; local = "/home/globi";
}
];
description = '' description = ''
A list of folders to synchronize. A list of folders to synchronize.
This has to be an attribute list with the name, remote and local field (all strings). This has to be an attribute list with the name, remote and local field (all strings).

View file

@ -1,5 +1,17 @@
{ lib, config, options, inputs, ... }: { {
imports = [ ./oxidash.nix ./oxinoti.nix ./oxishut.nix ./oxipaste.nix ]; lib,
config,
options,
inputs,
...
}:
{
imports = [
./oxidash.nix
./oxinoti.nix
./oxishut.nix
./oxipaste.nix
];
options.mods.oxi = { options.mods.oxi = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -32,8 +44,8 @@
}; };
}; };
}; };
config = lib.mkIf config.mods.oxi.enable config = lib.mkIf config.mods.oxi.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
programs = { programs = {
hyprdock.enable = lib.mkIf config.mods.oxi.hyprdock.enable true; hyprdock.enable = lib.mkIf config.mods.oxi.hyprdock.enable true;
oxicalc.enable = lib.mkIf config.mods.oxi.oxicalc.enable true; oxicalc.enable = lib.mkIf config.mods.oxi.oxicalc.enable true;
@ -46,12 +58,12 @@
]; ];
plugin_config = { plugin_config = {
Keyboard = { Keyboard = {
path = path = "/home/${config.conf.username}/.config/reset/keyboard.conf";
"/home/${config.conf.username}/.config/reset/keyboard.conf";
}; };
}; };
}; };
}; };
}; };
}); }
);
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods.oxi.oxidash = { options.mods.oxi.oxidash = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +13,8 @@
description = "Enables and configures oxidash"; description = "Enables and configures oxidash";
}; };
}; };
config = lib.mkIf (config.mods.oxi.oxidash.enable && config.mods.oxi.enable) config = lib.mkIf (config.mods.oxi.oxidash.enable && config.mods.oxi.enable) (
(lib.optionalAttrs (options ? xdg.configFile) { lib.optionalAttrs (options ? xdg.configFile) {
programs.oxidash.enable = true; programs.oxidash.enable = true;
xdg.configFile."oxidash/style.css" = { xdg.configFile."oxidash/style.css" = {
text = '' text = ''
@ -60,5 +66,6 @@
} }
''; '';
}; };
}); }
);
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods.oxi.oxinoti = { options.mods.oxi.oxinoti = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +13,8 @@
description = "Enables and configures oxinoti"; description = "Enables and configures oxinoti";
}; };
}; };
config = lib.mkIf (config.mods.oxi.oxinoti.enable && config.mods.oxi.enable) config = lib.mkIf (config.mods.oxi.oxinoti.enable && config.mods.oxi.enable) (
(lib.optionalAttrs (options ? xdg.configFile) { lib.optionalAttrs (options ? xdg.configFile) {
programs.oxinoti.enable = true; programs.oxinoti.enable = true;
xdg.configFile."oxinoti/style.css" = { xdg.configFile."oxinoti/style.css" = {
text = # css text = # css
@ -100,5 +106,6 @@
dnd_override = 2 dnd_override = 2
''; '';
}; };
}); }
);
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods.oxi.oxipaste = { options.mods.oxi.oxipaste = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +13,8 @@
description = "Enables and configures oxipaste"; description = "Enables and configures oxipaste";
}; };
}; };
config = lib.mkIf (config.mods.oxi.oxipaste.enable && config.mods.oxi.enable) config = lib.mkIf (config.mods.oxi.oxipaste.enable && config.mods.oxi.enable) (
(lib.optionalAttrs (options ? xdg.configFile) { lib.optionalAttrs (options ? xdg.configFile) {
programs.oxipaste.enable = true; programs.oxipaste.enable = true;
xdg.configFile."oxipaste/style.css" = { xdg.configFile."oxipaste/style.css" = {
text = '' text = ''
@ -38,5 +44,6 @@
} }
''; '';
}; };
}); }
);
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods.oxi.oxishut = { options.mods.oxi.oxishut = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +13,8 @@
description = "Enables and configures oxishut"; description = "Enables and configures oxishut";
}; };
}; };
config = lib.mkIf (config.mods.oxi.oxishut.enable && config.mods.oxi.enable) config = lib.mkIf (config.mods.oxi.oxishut.enable && config.mods.oxi.enable) (
(lib.optionalAttrs (options ? xdg.configFile) { lib.optionalAttrs (options ? xdg.configFile) {
programs.oxishut.enable = true; programs.oxishut.enable = true;
xdg.configFile."oxishut/style.css" = { xdg.configFile."oxishut/style.css" = {
text = '' text = ''
@ -32,5 +38,6 @@
} }
''; '';
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.piper = { options.mods.piper = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
@ -7,10 +14,8 @@
description = "Enables the piper program and its daemon"; description = "Enables the piper program and its daemon";
}; };
}; };
config = lib.mkIf config.mods.piper.enable config = lib.mkIf config.mods.piper.enable (
(lib.optionalAttrs (options ? services.ratbagd) { lib.optionalAttrs (options ? services.ratbagd) { services.ratbagd.enable = true; }
services.ratbagd.enable = true; // lib.optionalAttrs (options ? home.packages) { home.packages = with pkgs; [ piper ]; }
} // lib.optionalAttrs (options ? home.packages) { );
home.packages = with pkgs; [ piper ];
});
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.printing = { options.mods.printing = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +14,8 @@
description = "Enables the piper program and its daemon"; description = "Enables the piper program and its daemon";
}; };
}; };
config = lib.mkIf config.mods.printing.enable config = lib.mkIf config.mods.printing.enable (
(lib.optionalAttrs (options ? services.printing) { lib.optionalAttrs (options ? services.printing) {
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
services.printing.browsing = true; services.printing.browsing = true;
@ -19,5 +26,6 @@
nssmdns4 = true; nssmdns4 = true;
openFirewall = true; openFirewall = true;
}; };
}); }
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.scripts = { options.mods.scripts = {
change-brightness = lib.mkOption { change-brightness = lib.mkOption {
default = true; default = true;
@ -15,106 +22,109 @@
scripts = lib.mkOption { scripts = lib.mkOption {
default = [ ]; default = [ ];
example = [ ]; example = [ ];
description = description = "More scripts to be passed. (check existing ones for types and examples)";
"More scripts to be passed. (check existing ones for types and examples)";
}; };
}; };
config = (lib.optionalAttrs (options ? home.packages) { config = (
home.packages = [ lib.optionalAttrs (options ? home.packages) {
(lib.mkIf config.mods.scripts.change-brightness home.packages = [
(pkgs.writeShellScriptBin "change-brightness" '' (lib.mkIf config.mods.scripts.change-brightness (
set_brightness() { pkgs.writeShellScriptBin "change-brightness" ''
brightnessctl set "$1" set_brightness() {
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}') brightnessctl set "$1"
dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%" CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
} dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ''${CURRENT}%"
}
if [ "$1" == "brightness" ]; then if [ "$1" == "brightness" ]; then
set_brightness "$2" set_brightness "$2"
fi fi
'')) ''
(lib.mkIf config.mods.scripts.audio-control ))
(pkgs.writeShellScriptBin "audio-control" '' (lib.mkIf config.mods.scripts.audio-control (
ncspot() { pkgs.writeShellScriptBin "audio-control" ''
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n') ncspot() {
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1" CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') pactl set-sink-input-volume "$CHANGE" "$1"
notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%" VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
} notify-send -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ''${VOLUME}%"
}
firefox() { firefox() {
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n') STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
# NUMS=',' read -r -a array <<< "$STRING" # NUMS=',' read -r -a array <<< "$STRING"
readarray -td, NUMS <<<"$STRING" readarray -td, NUMS <<<"$STRING"
declare -p NUMS declare -p NUMS
for index in "''${!NUMS[@]}"; do #"''${!array[@]}" for index in "''${!NUMS[@]}"; do #"''${!array[@]}"
NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n') NUM=$(echo "''${NUMS[index]}" | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n') CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1" pactl set-sink-input-volume "$CHANGE" "$1"
done done
VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%') VOLUME=$(pactl list sink-inputs | rg "''${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%" notify-send -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ''${VOLUME}%"
} }
internal() { internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }') SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER" pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" " notify-send "changed audio to "$DEVICE" "
else else
notify-send "failed, not available!" notify-send "failed, not available!"
fi fi
} }
set_volume_sink() { set_volume_sink() {
pactl set-sink-volume @DEFAULT_SINK@ "$1" pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %') CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%" notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ''${CURRENT}%"
} }
set_volume_source() { set_volume_source() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1" pactl set-source-volume @DEFAULT_SOURCE@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %') CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%" notify-send -a "System Volume" -r 1001 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ''${CURRENT}%"
} }
bluetooth() { bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }') SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER" pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ') DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" " notify-send "changed audio to "$DEVICE" "
else else
notify-send "failed, not available!" notify-send "failed, not available!"
fi fi
} }
mute() { mute() {
pactl set-sink-mute @DEFAULT_SINK@ toggle pactl set-sink-mute @DEFAULT_SINK@ toggle
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@) MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE" notify-send -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
} }
if [ "$1" == "internal" ]; then if [ "$1" == "internal" ]; then
internal internal
elif [ "$1" == "bluetooth" ]; then elif [ "$1" == "bluetooth" ]; then
bluetooth bluetooth
elif [ "$1" == "firefox" ]; then elif [ "$1" == "firefox" ]; then
firefox "$2" firefox "$2"
elif [ "$1" == "ncspot" ]; then elif [ "$1" == "ncspot" ]; then
ncspot "$2" ncspot "$2"
elif [ "$1" == "mute" ]; then elif [ "$1" == "mute" ]; then
mute mute
elif [ "$1" == "sink" ]; then elif [ "$1" == "sink" ]; then
set_volume_sink "$2" set_volume_sink "$2"
elif [ "$1" == "source" ]; then elif [ "$1" == "source" ]; then
set_volume_source "$2" set_volume_source "$2"
fi fi
'')) ''
] ++ config.mods.scripts.scripts; ))
}); ] ++ config.mods.scripts.scripts;
}
);
} }

View file

@ -1,4 +1,12 @@
{ lib, pkgs, config, options, root, ... }: { {
lib,
pkgs,
config,
options,
root,
...
}:
{
options.mods.sops = { options.mods.sops = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -19,8 +27,8 @@
description = "secrets for sops"; description = "secrets for sops";
}; };
}; };
config = lib.mkIf config.mods.sops.enable config = lib.mkIf config.mods.sops.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ sops ]; home.packages = with pkgs; [ sops ];
sops = { sops = {
gnupg = { gnupg = {
@ -32,5 +40,6 @@
}; };
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ]; systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
}); }
);
} }

View file

@ -1,4 +1,12 @@
{ lib, config, options, pkgs, inputs, ... }: { {
lib,
config,
options,
pkgs,
inputs,
...
}:
{
options.mods = { options.mods = {
starship = { starship = {
enable = lib.mkOption { enable = lib.mkOption {
@ -30,99 +38,140 @@
}; };
# environment.systemPackages needed in order to configure systemwide # environment.systemPackages needed in order to configure systemwide
config = lib.mkIf config.mods.starship.enable config = lib.mkIf config.mods.starship.enable (
(lib.optionalAttrs (options ? environment.systemPackages) { lib.optionalAttrs (options ? environment.systemPackages) {
programs.starship = let programs.starship =
base16 = pkgs.callPackage inputs.base16.lib { }; let
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); base16 = pkgs.callPackage inputs.base16.lib { };
code_format = scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
"[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)"; code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)";
in { in
enable = true; {
interactiveOnly = true; enable = true;
presets = lib.mkIf config.mods.starship.use_default_prompt interactiveOnly = true;
[ "pastel-powerline" ]; presets = lib.mkIf config.mods.starship.use_default_prompt [ "pastel-powerline" ];
settings = lib.mkIf config.mods.starship.use_default_prompt { settings =
# derived from https://starship.rs/presets/pastel-powerline lib.mkIf config.mods.starship.use_default_prompt {
format = # derived from https://starship.rs/presets/pastel-powerline
"$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)"; format = "$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)";
right_format = right_format = "$c$elixir$elm$golang$gradle$haskell$java$julia$nodejs$nim$rust$scala$python$ocaml$opa$perl$zig$dart$dotnet$nix_shell$shell$solidity[](bg:prev_bg fg:#3465A4)$time$os";
"$c$elixir$elm$golang$gradle$haskell$java$julia$nodejs$nim$rust$scala$python$ocaml$opa$perl$zig$dart$dotnet$nix_shell$shell$solidity[](bg:prev_bg fg:#3465A4)$time$os"; username = {
username = { show_always = false;
show_always = false; style_user = "bg:#5277C3 fg:#${scheme.base05}";
style_user = "bg:#5277C3 fg:#${scheme.base05}"; style_root = "bg:#5277C3 fg:#${scheme.base05}";
style_root = "bg:#5277C3 fg:#${scheme.base05}"; format = "[ $user ]($style)[](bg:#3465A4 fg:#5277C3)";
format = "[ $user ]($style)[](bg:#3465A4 fg:#5277C3)"; disabled = false;
disabled = false; };
}; os = {
os = { symbols = {
symbols = { NixOS = " "; }; NixOS = " ";
style = "bg:#3465A4 fg:#${scheme.base05}"; };
disabled = false; style = "bg:#3465A4 fg:#${scheme.base05}";
}; disabled = false;
directory = { };
style = "bg:#3465A4 fg:#${scheme.base05}"; directory = {
format = "[ $path ]($style)"; style = "bg:#3465A4 fg:#${scheme.base05}";
truncation_length = 3; format = "[ $path ]($style)";
truncation_symbol = "/"; truncation_length = 3;
}; truncation_symbol = "/";
git_branch = { };
always_show_remote = true; git_branch = {
symbol = ""; always_show_remote = true;
style = "bg:#5256c3 fg:#${scheme.base05}"; symbol = "";
format = style = "bg:#5256c3 fg:#${scheme.base05}";
"[ ](bg:#5256c3 fg:prev_bg)[$symbol ($remote_name )$branch ]($style)"; format = "[ ](bg:#5256c3 fg:prev_bg)[$symbol ($remote_name )$branch ]($style)";
}; };
git_status = { git_status = {
staged = "+\${count} (fg:#C4A000)"; staged = "+\${count} (fg:#C4A000)";
ahead = "\${count} (fg:#C4A000)"; ahead = "\${count} (fg:#C4A000)";
diverged = "\${count} (fg:#C4A000)"; diverged = "\${count} (fg:#C4A000)";
behind = "\${count} (fg:#C4A000)"; behind = "\${count} (fg:#C4A000)";
stashed = " "; stashed = " ";
untracked = "?\${count} (fg:#C4A000)"; untracked = "?\${count} (fg:#C4A000)";
modified = "!\${count} (fg:#C4A000)"; modified = "!\${count} (fg:#C4A000)";
deleted = "\${count} (fg:#C4A000)"; deleted = "\${count} (fg:#C4A000)";
conflicted = "=\${count} (fg:#C4A000)"; conflicted = "=\${count} (fg:#C4A000)";
renamed = "»\${count} (fg:#C4A000)"; renamed = "»\${count} (fg:#C4A000)";
style = "bg:#5256c3 fg:fg:#C4A000"; style = "bg:#5256c3 fg:fg:#C4A000";
format = "[$all_status$ahead_behind]($style)"; format = "[$all_status$ahead_behind]($style)";
}; };
git_metrics = { git_metrics = {
disabled = false; disabled = false;
format = format = "([| ](bg:#5256c3)[+$added]($added_style bg:#5256c3)[ -$deleted]($deleted_style bg:#5256c3))";
"([| ](bg:#5256c3)[+$added]($added_style bg:#5256c3)[ -$deleted]($deleted_style bg:#5256c3))"; };
}; c = {
c = { format = code_format; }; format = code_format;
elixir = { format = code_format; }; };
elm = { format = code_format; }; elixir = {
golang = { format = code_format; }; format = code_format;
gradle = { format = code_format; }; };
haskell = { format = code_format; }; elm = {
java = { format = code_format; }; format = code_format;
julia = { format = code_format; }; };
nodejs = { format = code_format; }; golang = {
nim = { format = code_format; }; format = code_format;
nix_shell = { };
symbol = ""; gradle = {
format = code_format; format = code_format;
}; };
rust = { format = code_format; }; haskell = {
scala = { format = code_format; }; format = code_format;
typst = { format = code_format; }; };
python = { format = code_format; }; java = {
ocaml = { format = code_format; }; format = code_format;
opa = { format = code_format; }; };
perl = { format = code_format; }; julia = {
zig = { format = code_format; }; format = code_format;
dart = { format = code_format; }; };
dotnet = { format = code_format; }; nodejs = {
time = { format = code_format;
disabled = false; };
time_format = "%R"; # Hour:Minute Format nim = {
style = "bg:#3465A4 fg:#${scheme.base05}"; format = code_format;
format = "[ $time ]($style)"; };
}; nix_shell = {
} // config.mods.starship.custom_prompt; symbol = "";
}; format = code_format;
}); };
rust = {
format = code_format;
};
scala = {
format = code_format;
};
typst = {
format = code_format;
};
python = {
format = code_format;
};
ocaml = {
format = code_format;
};
opa = {
format = code_format;
};
perl = {
format = code_format;
};
zig = {
format = code_format;
};
dart = {
format = code_format;
};
dotnet = {
format = code_format;
};
time = {
disabled = false;
time_format = "%R"; # Hour:Minute Format
style = "bg:#3465A4 fg:#${scheme.base05}";
format = "[ $time ]($style)";
};
}
// config.mods.starship.custom_prompt;
};
}
);
} }

View file

@ -1,4 +1,11 @@
{ lib, config, options, pkgs, ... }: { {
lib,
config,
options,
pkgs,
...
}:
{
options.mods.stylix = { options.mods.stylix = {
colorscheme = lib.mkOption { colorscheme = lib.mkOption {
default = { default = {
@ -27,7 +34,13 @@
base0F = "F7768E"; base0F = "F7768E";
}; };
example = "catppuccin-mocha"; example = "catppuccin-mocha";
type = with lib.types; oneOf [ str attrs path ]; type =
with lib.types;
oneOf [
str
attrs
path
];
description = '' description = ''
Base16 colorscheme. Base16 colorscheme.
Can be an attribute set with base00 to base0F, Can be an attribute set with base00 to base0F,
@ -35,18 +48,18 @@
or a path to a custom yaml file. or a path to a custom yaml file.
''; '';
}; };
}; cursor = lib.mkOption {
config = (lib.optionalAttrs (options ? stylix) { default = {
stylix = { package = pkgs.bibata-cursors;
enable = true; name = "Bibata-Modern-Classic";
image = ../../base/black.jpg; size = 24;
polarity = "dark";
targets = {
nixvim.enable = false;
fish.enable = false;
}; };
example = { };
fonts = { type = with lib.types; attrsOf anything;
description = "Xcursor config";
};
fonts = lib.mkOption {
default = {
serif = { serif = {
package = pkgs.cantarell-fonts; package = pkgs.cantarell-fonts;
name = "Cantarell"; name = "Cantarell";
@ -59,7 +72,6 @@
monospace = { monospace = {
package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }); package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; });
# name = "JetBrains Mono Nerd";
name = "JetBrainsMono Nerd Font Mono"; name = "JetBrainsMono Nerd Font Mono";
}; };
@ -68,17 +80,30 @@
name = "Noto Color Emoji"; name = "Noto Color Emoji";
}; };
}; };
example = { };
cursor = { type = with lib.types; attrsOf anything;
package = pkgs.bibata-cursors; description = "font config";
name = "Bibata-Modern-Classic";
size = 24;
};
base16Scheme = (if builtins.isAttrs config.mods.stylix.colorscheme then
config.mods.stylix.colorscheme
else
"${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml");
}; };
}); };
config = (
lib.optionalAttrs (options ? stylix) {
stylix = {
enable = true;
image = ../../base/black.jpg;
polarity = "dark";
targets = {
nixvim.enable = false;
fish.enable = false;
};
fonts = config.mods.stylix.fonts;
cursor = config.mods.stylix.cursor;
base16Scheme = (
if builtins.isAttrs config.mods.stylix.colorscheme then
config.mods.stylix.colorscheme
else
"${pkgs.base16-schemes}/share/themes/${config.mods.stylix.colorscheme}.yaml"
);
};
}
);
} }

View file

@ -1,13 +1,20 @@
{ lib, config, options, pkgs, ... }: {
let callPackage = lib.callPackageWith pkgs; lib,
in { config,
options,
pkgs,
...
}:
let
callPackage = lib.callPackageWith pkgs;
in
{
options.mods.teams = { options.mods.teams = {
enable = lib.mkOption { enable = lib.mkOption {
default = false; default = false;
example = true; example = true;
type = lib.types.bool; type = lib.types.bool;
description = description = "Enables teams via a chromium pwa (for the poor souls that have to use this for work)";
"Enables teams via a chromium pwa (for the poor souls that have to use this for work)";
}; };
loopback = lib.mkOption { loopback = lib.mkOption {
default = true; default = true;
@ -16,17 +23,18 @@ in {
description = "Enables loopback for screensharing -> teams sucks :)"; description = "Enables loopback for screensharing -> teams sucks :)";
}; };
}; };
config = lib.mkIf config.mods.teams.enable config = lib.mkIf config.mods.teams.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) {
home.packages = [ (callPackage ../../override/teams.nix { }) ]; home.packages = [ (callPackage ../../override/teams.nix { }) ];
} // (lib.optionalAttrs (options ? boot.kernelModules) { }
// (lib.optionalAttrs (options ? boot.kernelModules) {
boot = { boot = {
extraModulePackages = extraModulePackages = [ pkgs.linuxKernel.packages.linux_xanmod_latest.v4l2loopback ];
[ pkgs.linuxKernel.packages.linux_xanmod_latest.v4l2loopback ];
kernelModules = [ "v4l2loopback" ]; kernelModules = [ "v4l2loopback" ];
extraModprobeConfig = '' extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera" options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
''; '';
}; };
})); })
);
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods = { options.mods = {
virtualbox.enable = lib.mkOption { virtualbox.enable = lib.mkOption {
@ -12,7 +18,6 @@
}; };
config = lib.optionalAttrs (options ? virtualisation.virtualbox.host) { config = lib.optionalAttrs (options ? virtualisation.virtualbox.host) {
virtualisation.virtualbox.host.enable = virtualisation.virtualbox.host.enable = lib.mkIf config.mods.virtualbox.enable true;
lib.mkIf config.mods.virtualbox.enable true;
}; };
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods = { options.mods = {
xone.enable = lib.mkOption { xone.enable = lib.mkOption {
@ -11,6 +17,5 @@
}; };
}; };
config = config = lib.optionalAttrs (options ? hardware) { hardware.xone.enable = true; };
lib.optionalAttrs (options ? hardware) { hardware.xone.enable = true; };
} }

View file

@ -1,4 +1,10 @@
{ lib, config, options, ... }: { {
lib,
config,
options,
...
}:
{
options.mods.yazi = { options.mods.yazi = {
enable = lib.mkOption { enable = lib.mkOption {
default = true; default = true;
@ -7,8 +13,7 @@
description = "Enables yazi"; description = "Enables yazi";
}; };
}; };
config = lib.mkIf config.mods.yazi.enable config = lib.mkIf config.mods.yazi.enable (
(lib.optionalAttrs (options ? home.packages) { lib.optionalAttrs (options ? home.packages) { programs.yazi = import ./yazi.nix; }
programs.yazi = import ./yazi.nix; );
});
} }

View file

@ -2,7 +2,9 @@
# don't ask.... # don't ask....
enable = true; enable = true;
settings = { settings = {
log = { enabled = false; }; log = {
enabled = false;
};
opener = { opener = {
folder = [ folder = [
@ -16,14 +18,18 @@
orphan = true; orphan = true;
} }
]; ];
archive = [{ archive = [
run = ''unar "$1"''; {
display_name = "Extract here"; run = ''unar "$1"'';
}]; display_name = "Extract here";
text = [{ }
run = ''$EDITOR "$@"''; ];
orphan = true; text = [
}]; {
run = ''$EDITOR "$@"'';
orphan = true;
}
];
image = [ image = [
{ {
run = ''imv "$@"''; run = ''imv "$@"'';
@ -36,11 +42,13 @@
display_name = "Show EXIF"; display_name = "Show EXIF";
} }
]; ];
pdf = [{ pdf = [
run = ''zathura "$@"''; {
orphan = true; run = ''zathura "$@"'';
display_name = "Open"; orphan = true;
}]; display_name = "Open";
}
];
video = [ video = [
{ {
run = ''mpv "$@"''; run = ''mpv "$@"'';
@ -216,7 +224,10 @@
} }
{ {
on = [ "g" "g" ]; on = [
"g"
"g"
];
run = "arrow -99999999"; run = "arrow -99999999";
desc = "Move cursor to the top"; desc = "Move cursor to the top";
} }
@ -335,12 +346,20 @@
desc = "Toggle the visibility of hidden files"; desc = "Toggle the visibility of hidden files";
} }
{ {
on = [ "<Space>" "f" "g>" ]; on = [
"<Space>"
"f"
"g>"
];
run = "search fd"; run = "search fd";
desc = "Search files by name using fd"; desc = "Search files by name using fd";
} }
{ {
on = [ "<Space>" "f" "G>" ]; on = [
"<Space>"
"f"
"G>"
];
run = "search rg"; run = "search rg";
desc = "Search files by content using ripgrep"; desc = "Search files by content using ripgrep";
} }
@ -362,22 +381,34 @@
# Copy # Copy
{ {
on = [ "c" "c" ]; on = [
"c"
"c"
];
run = "copy path"; run = "copy path";
desc = "Copy the absolute path"; desc = "Copy the absolute path";
} }
{ {
on = [ "c" "d" ]; on = [
"c"
"d"
];
run = "copy dirname"; run = "copy dirname";
desc = "Copy the path of the parent directory"; desc = "Copy the path of the parent directory";
} }
{ {
on = [ "c" "f" ]; on = [
"c"
"f"
];
run = "copy filename"; run = "copy filename";
desc = "Copy the name of the file"; desc = "Copy the name of the file";
} }
{ {
on = [ "c" "n" ]; on = [
"c"
"n"
];
run = "copy name_without_ext"; run = "copy name_without_ext";
desc = "Copy the name of the file without the extension"; desc = "Copy the name of the file without the extension";
} }
@ -402,52 +433,82 @@
# Sorting # Sorting
{ {
on = [ "," "a" ]; on = [
","
"a"
];
run = "sort alphabetical --dir_first"; run = "sort alphabetical --dir_first";
desc = "Sort alphabetically"; desc = "Sort alphabetically";
} }
{ {
on = [ "," "A" ]; on = [
","
"A"
];
run = "sort alphabetical --reverse --dir_first"; run = "sort alphabetical --reverse --dir_first";
desc = "Sort alphabetically (reverse)"; desc = "Sort alphabetically (reverse)";
} }
{ {
on = [ "," "c" ]; on = [
","
"c"
];
run = "sort created --dir_first"; run = "sort created --dir_first";
desc = "Sort by creation time"; desc = "Sort by creation time";
} }
{ {
on = [ "," "C" ]; on = [
","
"C"
];
run = "sort created --reverse --dir_first"; run = "sort created --reverse --dir_first";
desc = "Sort by creation time (reverse)"; desc = "Sort by creation time (reverse)";
} }
{ {
on = [ "," "m" ]; on = [
","
"m"
];
run = "sort modified --dir_first"; run = "sort modified --dir_first";
desc = "Sort by modified time"; desc = "Sort by modified time";
} }
{ {
on = [ "," "M" ]; on = [
","
"M"
];
run = "sort modified --reverse --dir_first"; run = "sort modified --reverse --dir_first";
desc = "Sort by modified time (reverse)"; desc = "Sort by modified time (reverse)";
} }
{ {
on = [ "," "n" ]; on = [
","
"n"
];
run = "sort natural --dir_first"; run = "sort natural --dir_first";
desc = "Sort naturally"; desc = "Sort naturally";
} }
{ {
on = [ "," "N" ]; on = [
","
"N"
];
run = "sort natural --reverse --dir_first"; run = "sort natural --reverse --dir_first";
desc = "Sort naturally (reverse)"; desc = "Sort naturally (reverse)";
} }
{ {
on = [ "," "s" ]; on = [
","
"s"
];
run = "sort size --dir_first"; run = "sort size --dir_first";
desc = "Sort by size"; desc = "Sort by size";
} }
{ {
on = [ "," "S" ]; on = [
","
"S"
];
run = "sort size --reverse --dir_first"; run = "sort size --reverse --dir_first";
desc = "Sort by size (reverse)"; desc = "Sort by size (reverse)";
} }
@ -536,27 +597,42 @@
# Goto # Goto
{ {
on = [ "g" "h" ]; on = [
"g"
"h"
];
run = "cd ~"; run = "cd ~";
desc = "Go to the home directory"; desc = "Go to the home directory";
} }
{ {
on = [ "g" "c" ]; on = [
"g"
"c"
];
run = "cd ~/.config"; run = "cd ~/.config";
desc = "Go to the config directory"; desc = "Go to the config directory";
} }
{ {
on = [ "g" "d" ]; on = [
"g"
"d"
];
run = "cd ~/Downloads"; run = "cd ~/Downloads";
desc = "Go to the downloads directory"; desc = "Go to the downloads directory";
} }
{ {
on = [ "g" "t" ]; on = [
"g"
"t"
];
run = "cd /tmp"; run = "cd /tmp";
desc = "Go to the temporary directory"; desc = "Go to the temporary directory";
} }
{ {
on = [ "g" "<Space>" ]; on = [
"g"
"<Space>"
];
run = "cd --interactive"; run = "cd --interactive";
desc = "Go to a directory interactively"; desc = "Go to a directory interactively";
} }
@ -718,7 +794,11 @@
} }
{ {
on = [ "V" ]; on = [ "V" ];
run = [ "move -999" "visual" "move 999" ]; run = [
"move -999"
"visual"
"move 999"
];
desc = "Enter visual mode and select all"; desc = "Enter visual mode and select all";
} }
@ -746,12 +826,18 @@
} }
{ {
on = [ "I" ]; on = [ "I" ];
run = [ "move -999" "insert" ]; run = [
"move -999"
"insert"
];
desc = "Move to the BOL and enter insert mode"; desc = "Move to the BOL and enter insert mode";
} }
{ {
on = [ "A" ]; on = [ "A" ];
run = [ "move 999" "insert --append" ]; run = [
"move 999"
"insert --append"
];
desc = "Move to the EOL and enter append mode"; desc = "Move to the EOL and enter append mode";
} }
@ -790,7 +876,10 @@
} }
{ {
on = [ "D" ]; on = [ "D" ];
run = [ "delete --cut" "move 999" ]; run = [
"delete --cut"
"move 999"
];
desc = "Cut until the EOL"; desc = "Cut until the EOL";
} }
{ {
@ -800,12 +889,18 @@
} }
{ {
on = [ "C" ]; on = [ "C" ];
run = [ "delete --cut --insert" "move 999" ]; run = [
"delete --cut --insert"
"move 999"
];
desc = "Cut until the EOL and enter insert mode"; desc = "Cut until the EOL and enter insert mode";
} }
{ {
on = [ "x" ]; on = [ "x" ];
run = [ "delete --cut" "move 1 --in-operating" ]; run = [
"delete --cut"
"move 1 --in-operating"
];
desc = "Cut the current character"; desc = "Cut the current character";
} }
@ -1136,4 +1231,3 @@
# }; # };
# }; # };
} }

View file

@ -1,4 +1,11 @@
{ stdenv, lib, copyDesktopItems, makeDesktopItem, chromium, ... }: {
stdenv,
lib,
copyDesktopItems,
makeDesktopItem,
chromium,
...
}:
stdenv.mkDerivation (final: { stdenv.mkDerivation (final: {
pname = "teams-pwa"; pname = "teams-pwa";
name = final.pname; name = final.pname;
@ -10,8 +17,8 @@ stdenv.mkDerivation (final: {
name = final.pname; name = final.pname;
icon = final.pname; icon = final.pname;
exec = "${chromium}/bin/${ exec = "${chromium}/bin/${
chromium.meta.mainProgram or chromium.pname chromium.meta.mainProgram or chromium.pname
} --app=https://teams.microsoft.com"; } --app=https://teams.microsoft.com";
desktopName = "Microsoft Teams PWA"; desktopName = "Microsoft Teams PWA";
genericName = "Progressive Web App for Microsoft Teams"; genericName = "Progressive Web App for Microsoft Teams";
categories = [ "Network" ]; categories = [ "Network" ];