Modularize teams sops yazi

This commit is contained in:
DashieTM 2024-08-24 13:25:08 +02:00
parent 7730cbef59
commit c73cb37278
75 changed files with 3023 additions and 3573 deletions

View file

@ -4,7 +4,8 @@
system = lib.mkOption {
default = "x86_64-linux";
# no fisherprice unix support
type = with lib.types; (enum [ "x86_64-linux" "aarch64-linux" "aarch64-linux-android" ]);
type = with lib.types;
(enum [ "x86_64-linux" "aarch64-linux" "aarch64-linux-android" ]);
example = "aarch64-linux";
description = ''
System architecture.
@ -42,9 +43,10 @@
ironbar = {
modules = lib.mkOption {
default = [ ];
example = [
{ type = "upower"; class = "memory-usage"; }
];
example = [{
type = "upower";
class = "memory-usage";
}];
type = with lib.types; listOf attrs;
description = ''
Adds modules to ironbar.
@ -138,10 +140,10 @@
};
config = {
conf.kernel = lib.mkIf (config.mods.gaming.enable && config.mods.gaming.kernel) pkgs.linuxPackages_xanmod_latest;
} // (lib.optionalAttrs (options?system.stateVersion)
{
system.stateVersion = "unstable";
}
);
conf.kernel =
lib.mkIf (config.mods.gaming.enable && config.mods.gaming.kernel)
pkgs.linuxPackages_xanmod_latest;
} // (lib.optionalAttrs (options ? system.stateVersion) {
system.stateVersion = "unstable";
});
}

View file

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

View file

@ -11,8 +11,9 @@
};
};
config = lib.mkIf config.mods.acpid.enable (lib.optionalAttrs (options?virtualisation.virtualbox.host) {
services.acpid.enable = true;
});
config = lib.mkIf config.mods.acpid.enable
(lib.optionalAttrs (options ? virtualisation.virtualbox.host) {
services.acpid.enable = true;
});
}

View file

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

View file

@ -10,11 +10,12 @@
};
};
config = lib.mkIf config.mods.bluetooth.enable (lib.optionalAttrs (options?hardware.bluetooth) {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
});
config = lib.mkIf config.mods.bluetooth.enable
(lib.optionalAttrs (options ? hardware.bluetooth) {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
});
}

View file

@ -28,116 +28,118 @@
};
};
config = lib.mkIf config.mods.coding.enable (lib.optionalAttrs (options?home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true;
colorscheme = config.mods.stylix.colorscheme;
};
home.packages = with pkgs; [
(lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox)
#basics
gitui
gcc
meson
ninja
tree-sitter
unzip
pkg-config
sqlite
plantuml
d-spy
config = lib.mkIf config.mods.coding.enable
(lib.optionalAttrs (options ? home.packages) {
programs.dashvim = lib.mkIf config.mods.coding.dashvim {
enable = true;
colorscheme = config.mods.stylix.colorscheme;
};
home.packages = with pkgs; [
(lib.mkIf config.mods.coding.jetbrains jetbrains-toolbox)
#basics
gitui
gcc
meson
ninja
tree-sitter
unzip
pkg-config
sqlite
plantuml
d-spy
# cpp
bear
clang-tools
# cpp
bear
clang-tools
#sql
nodePackages.sql-formatter
sqls
#sql
nodePackages.sql-formatter
sqls
#assembly
asm-lsp
#assembly
asm-lsp
#yaml
yamlfmt
yamllint
yaml-language-server
#yaml
yamlfmt
yamllint
yaml-language-server
#markdown
marksman
mdformat
#markdown
marksman
mdformat
#bash
bash-language-server
shfmt
#bash
bash-language-server
shfmt
#fsharp
fsharp
fsautocomplete
#fsharp
fsharp
fsautocomplete
#haskell
haskellPackages.cabal-install
ghc
haskellPackages.haskell-language-server
#haskell
haskellPackages.cabal-install
ghc
haskellPackages.haskell-language-server
#html
html-tidy
#html
# html-tidy
#json
jq
nodePackages.vscode-json-languageserver
#json
jq
#css
tailwindcss
tailwindcss-language-server
vscode-langservers-extracted
#css
tailwindcss
tailwindcss-language-server
#editors
neovide
##fallback
vscodium
#editors
neovide
##fallback
vscodium
#rust
rustup
#rust
rustup
#python
python3
python312Packages.python-lsp-server
python312Packages.python-lsp-ruff
python312Packages.python-lsp-black
#python
python3
python312Packages.python-lsp-server
python312Packages.python-lsp-ruff
python312Packages.python-lsp-black
#ts/js
nodejs_20
deno
typescript
nodePackages.typescript-language-server
nodePackages.prettier
#ts/js
nodejs_20
deno
typescript
nodePackages.typescript-language-server
nodePackages.prettier
#go
go
gopls
#go
go
gopls
#typst
typst
tinymist
ltex-ls
#typst
typst
tinymist
ltex-ls
#java
gradle
maven
jdt-language-server
temurin-jre-bin
#java
gradle
maven
jdt-language-server
temurin-jre-bin
#.!
dotnet-sdk_8
omnisharp-roslyn
csharpier
netcoredbg
#.!
dotnet-sdk_8
omnisharp-roslyn
csharpier
netcoredbg
#zig
zig
zls
];
#zig
zig
zls
});
tmux
tmate
];
});
}

View file

@ -1,29 +1,32 @@
{
imports = [
./virtualbox.nix
./kde_connect.nix
./gpu.nix
./xone.nix
./drives.nix
./bluetooth.nix
./acpid.nix
./piper.nix
./greetd.nix
./gnome_services.nix
./printing.nix
./layout.nix
./base_packages.nix
./home_packages.nix
./media.nix
./bluetooth.nix
./coding.nix
./flatpak.nix
./nextcloud.nix
./starship.nix
./git.nix
./keepassxc.nix
./gaming.nix
./stylix.nix
./drives.nix
./firefox.nix
./flatpak.nix
./gaming.nix
./git.nix
./gnome_services.nix
./gpu.nix
./greetd.nix
./home_packages.nix
./hyprland
./kde_connect.nix
./keepassxc.nix
./layout.nix
./media.nix
./nextcloud.nix
./piper.nix
./printing.nix
./sops.nix
./starship.nix
./stylix.nix
./teams.nix
./virtualbox.nix
./yazi
./xone.nix
];
}

View file

@ -19,51 +19,36 @@ let
example = {
device = "/dev/disk/by-label/DRIVE2";
fsType = "ext4";
options = [
"noatime"
"nodiratime"
"discard"
];
options = [ "noatime" "nodiratime" "discard" ];
};
};
};
};
in
{
in {
options.mods = {
extraDrives =
lib.mkOption {
default = [ ];
example = [
{
name = "drive2";
drive = {
device = "/dev/disk/by-label/DRIVE2";
fsType = "ext4";
options = [
"noatime"
"nodiratime"
"discard"
];
};
}
];
# TODO: how to make this work
# type = with lib.types; listOf (attrsOf driveModule);
type = with lib.types; listOf (attrsOf anything);
description = ''
Extra drives to add.
'';
};
extraDrives = lib.mkOption {
default = [ ];
example = [{
name = "drive2";
drive = {
device = "/dev/disk/by-label/DRIVE2";
fsType = "ext4";
options = [ "noatime" "nodiratime" "discard" ];
};
}];
# TODO: how to make this work
# type = with lib.types; listOf (attrsOf driveModule);
type = with lib.types; listOf (attrsOf anything);
description = ''
Extra drives to add.
'';
};
};
config = (lib.optionalAttrs (options?fileSystems) {
fileSystems = builtins.listToAttrs
(map
({ name, drive }: {
name = "/" + name;
value = drive;
})
config.mods.extraDrives);
config = (lib.optionalAttrs (options ? fileSystems) {
fileSystems = builtins.listToAttrs (map ({ name, drive }: {
name = "/" + name;
value = drive;
}) config.mods.extraDrives);
});
}

View file

@ -42,7 +42,7 @@
description = "Firefox policy configuration";
};
extensions = lib.mkOption {
default = with pkgs.nur.repos.rycee.firefox-addons;[
default = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
darkreader
privacy-badger
@ -57,11 +57,18 @@
};
};
config = lib.mkIf config.mods.firefox.enable
(lib.optionalAttrs (options?programs.firefox.profiles) {
(lib.optionalAttrs (options ? programs.firefox.profiles) {
programs.firefox = {
enable = true;
policies = config.mods.firefox.configuration;
profiles.${config.conf.username} = {
isDefault = true;
id = 0;
extensions = config.mods.firefox.extensions;
};
profiles."special" = {
isDefault = false;
id = 1;
extensions = config.mods.firefox.extensions;
};
};

View file

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

View file

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

View file

@ -1,5 +1,4 @@
{ lib, config, options, pkgs, ... }:
{
{ lib, config, options, pkgs, ... }: {
options.mods.git = {
username = lib.mkOption {
default = "DashieTM";
@ -16,29 +15,40 @@
ssh_config = lib.mkOption {
default = ''
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
${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
${if (config.sops.secrets?dashie.path) then "IdentityFile ${config.sops.secrets.dashie.path}" else ""}
${
if (config.sops.secrets ? dashie.path) then
"IdentityFile ${config.sops.secrets.dashie.path}"
else
""
}
'';
example = '''';
example = "";
type = lib.types.lines;
description = "ssh configuration (keys for git)";
};
};
config = (lib.optionalAttrs (options?programs.git && options?home.file) {
config = (lib.optionalAttrs (options ? programs.git && options ? home.file) {
programs.git = {
enable = true;
userName = config.mods.git.username;
userEmail = config.mods.git.email;
extraConfig = {
merge = {
tool = "nvimdiff";
};
diff = {
tool = "nvimdiff";
};
merge = { tool = "nvimdiff"; };
diff = { tool = "nvimdiff"; };
};
};
home.file.".ssh/config".text = config.mods.git.ssh_config;

View file

@ -11,24 +11,17 @@
};
};
config = lib.mkIf config.mods.gnome_services.enable (lib.optionalAttrs (options?services.gnome.gnome-keyring)
{
config = lib.mkIf config.mods.gnome_services.enable
(lib.optionalAttrs (options ? services.gnome.gnome-keyring) {
programs.dconf.enable = true;
services = {
# 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;
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

@ -38,46 +38,36 @@
};
config = lib.mkIf config.mods.vapi.enable
(lib.optionalAttrs
(options?hardware.graphics)
{
boot = lib.mkIf config.mods.amdgpu.enable {
kernelModules = [ "kvm-amd" ];
initrd.kernelModules = [ "amdgpu" ];
kernelParams = [
"amdgpu.ppfeaturemask=0xffffffff"
];
};
hardware = {
graphics =
let
base_packages = [
pkgs.libvdpau-va-gl
pkgs.vaapiVdpau
pkgs.mesa.drivers
];
rocm_packages = [
pkgs.rocmPackages.clr.icd
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 {
hardware.nvidia = {
modesetting.enable = true;
# powerManagement.enable = false;
# powerManagement.finegrained = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
(lib.optionalAttrs (options ? hardware.graphics) {
boot = lib.mkIf config.mods.amdgpu.enable {
kernelModules = [ "kvm-amd" ];
initrd.kernelModules = [ "amdgpu" ];
kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
};
services.xserver.videoDrivers = [ "nvidia" ];
}));
hardware = {
graphics = let
base_packages =
[ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.mesa.drivers ];
rocm_packages =
[ pkgs.rocmPackages.clr.icd 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 {
hardware.nvidia = {
modesetting.enable = true;
# powerManagement.enable = false;
# powerManagement.finegrained = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
services.xserver.videoDrivers = [ "nvidia" ];
}));
}

View file

@ -38,62 +38,60 @@
};
};
config =
let
username = config.conf.username;
session = {
command = "${lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland} --config /etc/greetd/hyprgreet.conf";
user = username;
config = let
username = config.conf.username;
session = {
command = "${
lib.getExe inputs.hyprland.packages.${config.conf.system}.hyprland
} --config /etc/greetd/hyprgreet.conf";
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=$!
'';
}
];
};
# greetd display manager
programs.hyprland.enable = true;
services.greetd = {
enable = true;
settings = {
terminal.vt = 1;
default_session = session;
};
};
environment.etc."greetd/environments".text = ''
Hyprland
'';
environment.etc."greetd/environments".text = ''
Hyprland
'';
# 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/hyprgreet.conf".text = ''
exec-once=gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
# 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/hyprgreet.conf".text = ''
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}
monitor=,disable
monitor=${config.mods.greetd.monitor},${config.mods.greetd.resolution},0x0,${config.mods.greetd.scale}
monitor=,disable
input {
kb_layout = ${config.mods.xkb.layout}
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
}
misc {
disable_splash_rendering = false
disable_hyprland_logo = false
}
misc {
disable_splash_rendering = false
disable_hyprland_logo = false
}
exec-once=regreet --style /home/${username}/.config/gtk-3.0/gtk.css; hyprctl dispatch exit
'';
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;
});
# unlock GPG keyring on login
security.pam.services.greetd.enableGnomeKeyring = true;
});
}

View file

@ -16,14 +16,10 @@
'';
};
};
config =
let
callPackage = lib.callPackageWith pkgs;
in
(lib.optionalAttrs (options?home.packages)
{
home.packages = config.mods.home_packages.additional_packages;
} // (lib.mkIf config.mods.home_packages.enable (lib.optionalAttrs (options?home.packages) {
config = (lib.optionalAttrs (options ? home.packages) {
home.packages = config.mods.home_packages.additional_packages;
} // (lib.mkIf config.mods.home_packages.enable
(lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [
nheko
nextcloud-client
@ -60,14 +56,10 @@
poppler_utils
brave
greetd.regreet
sops
flake-checker
ffmpeg
system-config-printer
brightnessctl
(callPackage
../../override/cambalache.nix
{ })
];
#my own programs

View file

@ -11,7 +11,7 @@
};
config = lib.mkIf config.mods.hyprland.anyrun.enable
(lib.optionalAttrs (options?programs.anyrun) {
(lib.optionalAttrs (options ? programs.anyrun) {
programs.anyrun = {
enable = true;
config = {

View file

@ -15,9 +15,7 @@
};
monitor = lib.mkOption {
default = [ ];
example = [
"DP-1,3440x1440@180,2560x0,1,vrr,0"
];
example = [ "DP-1,3440x1440@180,2560x0,1,vrr,0" ];
type = with lib.types; listOf str;
description = ''
The monitor configuration for hyprland.
@ -25,9 +23,7 @@
};
workspace = lib.mkOption {
default = [ ];
example = [
"2,monitor:DP-1, default:true"
];
example = [ "2,monitor:DP-1, default:true" ];
type = with lib.types; listOf str;
description = ''
The workspace configuration for hyprland.
@ -62,281 +58,278 @@
};
config = lib.mkIf config.mods.hyprland.enable
(lib.optionalAttrs (options?wayland.windowManager.hyprland)
{
# install Hyprland related packages
home.packages = with pkgs; [
xorg.xprop
grim
slurp
satty
xdg-desktop-portal-gtk
# xdg-desktop-portal-hyprland
copyq
wl-clipboard
hyprcursor
hyprpicker
];
(lib.optionalAttrs (options ? wayland.windowManager.hyprland) {
# install Hyprland related packages
home.packages = with pkgs; [
xorg.xprop
grim
slurp
satty
xdg-desktop-portal-gtk
# xdg-desktop-portal-hyprland
copyq
wl-clipboard
hyprcursor
hyprpicker
];
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = lib.mkIf config.mods.hyprland.use_default_config
{
"$mod" = "SUPER";
"source" = "/home/${config.conf.username}/.config/reset/keyboard.conf";
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings =
lib.mkIf config.mods.hyprland.use_default_config {
"$mod" = "SUPER";
"source" =
"/home/${config.conf.username}/.config/reset/keyboard.conf";
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
bindm =
[ "$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow" ];
bind = [
# screenshots
''$mod SUPER,S,exec,grim -g "$(slurp)" - | wl-copy''
''
$mod SUPERSHIFTALT,S,exec, grim -g "$(slurp)" $HOME/gits/ost-5semester/Screenshots/$(date +'%Y_%m_%d_%I_%M_%S.png') && (date +'%Y_%m_%d_%I_%M_%S.png') | wl-copy''
''$mod SUPERSHIFT,S,exec,grim -g "$(slurp)" - | satty -f -''
''
$mod SUPERCONTROLSHIFT,S,exec,grim -c -g "2560,0 3440x1440" - | wl-copy''
# regular programs
"$mod SUPER,F,exec,firefox"
"$mod SUPERSHIFT,F,exec,firefox -p special"
"$mod SUPER,T,exec,kitty -1"
"$mod SUPER,E,exec,nautilus -w"
"$mod SUPER,N,exec,neovide"
"$mod SUPER,M,exec,oxidash"
"$mod SUPER,R,exec,anyrun"
"$mod SUPER,G,exec,oxicalc"
"$mod SUPER,D,exec,oxishut"
"$mod SUPER,A,exec,oxipaste"
"$mod SUPERSHIFT,P,exec,hyprdock --gui"
"$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend"
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
# media keys
",XF86AudioMute,exec, $HOME/.config/scripts/audio_control.sh mute"
",XF86AudioLowerVolume,exec, $HOME/.config/scripts/audio_control.sh sink -5%"
",XF86AudioRaiseVolume,exec, $HOME/.config/scripts/audio_control.sh sink +5%"
",XF86AudioPlay,exec, playerctl play-pause"
",XF86AudioNext,exec, playerctl next"
",XF86AudioPrev,exec, playerctl previous"
",XF86MonBrightnessDown,exec, $HOME/.config/scripts/change-brightness brightness 10%-"
",XF86MonBrightnessUp,exec, $HOME/.config/scripts/change-brightness brightness +10%"
# hyprland keybinds
# misc
"$mod SUPER,V,togglefloating,"
"$mod SUPER,B,fullscreen,"
"$mod SUPER,C,togglesplit"
"$mod SUPER,Q,killactive,"
"$mod SUPERSHIFTALT,M,exit,"
"$mod SUPERSHIFT,W,togglespecialworkspace"
# move
"$mod SUPER,left,movewindow,l"
"$mod SUPER,right,movewindow,r"
"$mod SUPER,up,movewindow,u"
"$mod SUPER,down,movewindow,d"
# workspaces
"$mod SUPER,1,workspace,1"
"$mod SUPER,2,workspace,2"
"$mod SUPER,3,workspace,3"
"$mod SUPER,4,workspace,4"
"$mod SUPER,5,workspace,5"
"$mod SUPER,6,workspace,6"
"$mod SUPER,7,workspace,7"
"$mod SUPER,8,workspace,8"
"$mod SUPER,9,workspace,9"
"$mod SUPER,0,workspace,10"
# move to workspace
"$mod SUPERSHIFT,1,movetoworkspace,1"
"$mod SUPERSHIFT,2,movetoworkspace,2"
"$mod SUPERSHIFT,3,movetoworkspace,3"
"$mod SUPERSHIFT,4,movetoworkspace,4"
"$mod SUPERSHIFT,5,movetoworkspace,5"
"$mod SUPERSHIFT,6,movetoworkspace,6"
"$mod SUPERSHIFT,7,movetoworkspace,7"
"$mod SUPERSHIFT,8,movetoworkspace,8"
"$mod SUPERSHIFT,9,movetoworkspace,9"
"$mod SUPERSHIFT,0,movetoworkspace,10"
# move to workspace silent
"$mod SUPERSHIFTALT,1,movetoworkspacesilent,1"
"$mod SUPERSHIFTALT,2,movetoworkspacesilent,2"
"$mod SUPERSHIFTALT,3,movetoworkspacesilent,3"
"$mod SUPERSHIFTALT,4,movetoworkspacesilent,4"
"$mod SUPERSHIFTALT,5,movetoworkspacesilent,5"
"$mod SUPERSHIFTALT,6,movetoworkspacesilent,6"
"$mod SUPERSHIFTALT,7,movetoworkspacesilent,7"
"$mod SUPERSHIFTALT,8,movetoworkspacesilent,8"
"$mod SUPERSHIFTALT,9,movetoworkspacesilent,9"
"$mod SUPERSHIFTALT,0,movetoworkspacesilent,10"
# preselection
"$mod SUPERALT,j,layoutmsg,preselect l"
"$mod SUPERALT,k,layoutmsg,preselect d"
"$mod SUPERALT,l,layoutmsg,preselect u"
"$mod SUPERALT,semicolon,layoutmsg,preselect r"
"$mod SUPERALT,h,layoutmsg,preselect n"
];
binde = [
# hyprland keybinds
# focus
"$mod SUPER,J,movefocus,l"
"$mod SUPER,semicolon,movefocus,r"
"$mod SUPER,L,movefocus,u"
"$mod SUPER,K,movefocus,d"
# resize
"$mod SUPER,U,resizeactive,-20 0"
"$mod SUPER,P,resizeactive,20 0"
"$mod SUPER,O,resizeactive,0 -20"
"$mod SUPER,I,resizeactive,0 20"
];
general = {
gaps_out = "3,5,5,5";
border_size = 3;
"col.active_border" =
lib.mkForce "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
# "col.inactive_border" = "0x66333333";
allow_tearing = true;
};
decoration = { rounding = 4; };
animations = {
bezier = "penguin,0.05,0.9,0.1,1.0";
animation = [
"windowsMove,1,4,default"
"windows,1,7,default,popin 70%"
"windowsOut,1,7,default,popin 70%"
"border,1,10,default"
"fade,1,7,default"
"workspaces,1,6,default"
"layers,1,3,default,popin"
];
};
bind = [
# screenshots
"$mod SUPER,S,exec,grim -g \"$(slurp)\" - | wl-copy"
"$mod SUPERSHIFTALT,S,exec, grim -g \"$(slurp)\" $HOME/gits/ost-5semester/Screenshots/$(date +'%Y_%m_%d_%I_%M_%S.png') && (date +'%Y_%m_%d_%I_%M_%S.png') | wl-copy"
"$mod SUPERSHIFT,S,exec,grim -g \"$(slurp)\" - | satty -f -"
"$mod SUPERCONTROLSHIFT,S,exec,grim -c -g \"2560,0 3440x1440\" - | wl-copy"
dwindle = {
preserve_split = true;
pseudotile = 0;
permanent_direction_override = false;
};
# regular programs
"$mod SUPER,F,exec,firefox"
"$mod SUPER,T,exec,kitty -1"
"$mod SUPER,E,exec,nautilus -w"
"$mod SUPER,N,exec,neovide"
"$mod SUPER,M,exec,oxidash"
"$mod SUPER,R,exec,anyrun"
"$mod SUPER,G,exec,oxicalc"
"$mod SUPER,D,exec,oxishut"
"$mod SUPER,A,exec,oxipaste"
"$mod SUPERSHIFT,P,exec,hyprdock --gui"
"$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend"
"$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate"
# media keys
",XF86AudioMute,exec, $HOME/.config/scripts/audio_control.sh mute"
",XF86AudioLowerVolume,exec, $HOME/.config/scripts/audio_control.sh sink -5%"
",XF86AudioRaiseVolume,exec, $HOME/.config/scripts/audio_control.sh sink +5%"
",XF86AudioPlay,exec, playerctl play-pause"
",XF86AudioNext,exec, playerctl next"
",XF86AudioPrev,exec, playerctl previous"
",XF86MonBrightnessDown,exec, $HOME/.config/scripts/change-brightness brightness 10%-"
",XF86MonBrightnessUp,exec, $HOME/.config/scripts/change-brightness brightness +10%"
# hyprland keybinds
# misc
"$mod SUPER,V,togglefloating,"
"$mod SUPER,B,fullscreen,"
"$mod SUPER,C,togglesplit"
"$mod SUPER,Q,killactive,"
"$mod SUPERSHIFTALT,M,exit,"
"$mod SUPERSHIFT,W,togglespecialworkspace"
# move
"$mod SUPER,left,movewindow,l"
"$mod SUPER,right,movewindow,r"
"$mod SUPER,up,movewindow,u"
"$mod SUPER,down,movewindow,d"
# workspaces
"$mod SUPER,1,workspace,1"
"$mod SUPER,2,workspace,2"
"$mod SUPER,3,workspace,3"
"$mod SUPER,4,workspace,4"
"$mod SUPER,5,workspace,5"
"$mod SUPER,6,workspace,6"
"$mod SUPER,7,workspace,7"
"$mod SUPER,8,workspace,8"
"$mod SUPER,9,workspace,9"
"$mod SUPER,0,workspace,10"
# move to workspace
"$mod SUPERSHIFT,1,movetoworkspace,1"
"$mod SUPERSHIFT,2,movetoworkspace,2"
"$mod SUPERSHIFT,3,movetoworkspace,3"
"$mod SUPERSHIFT,4,movetoworkspace,4"
"$mod SUPERSHIFT,5,movetoworkspace,5"
"$mod SUPERSHIFT,6,movetoworkspace,6"
"$mod SUPERSHIFT,7,movetoworkspace,7"
"$mod SUPERSHIFT,8,movetoworkspace,8"
"$mod SUPERSHIFT,9,movetoworkspace,9"
"$mod SUPERSHIFT,0,movetoworkspace,10"
# move to workspace silent
"$mod SUPERSHIFTALT,1,movetoworkspacesilent,1"
"$mod SUPERSHIFTALT,2,movetoworkspacesilent,2"
"$mod SUPERSHIFTALT,3,movetoworkspacesilent,3"
"$mod SUPERSHIFTALT,4,movetoworkspacesilent,4"
"$mod SUPERSHIFTALT,5,movetoworkspacesilent,5"
"$mod SUPERSHIFTALT,6,movetoworkspacesilent,6"
"$mod SUPERSHIFTALT,7,movetoworkspacesilent,7"
"$mod SUPERSHIFTALT,8,movetoworkspacesilent,8"
"$mod SUPERSHIFTALT,9,movetoworkspacesilent,9"
"$mod SUPERSHIFTALT,0,movetoworkspacesilent,10"
# preselection
"$mod SUPERALT,j,layoutmsg,preselect l"
"$mod SUPERALT,k,layoutmsg,preselect d"
"$mod SUPERALT,l,layoutmsg,preselect u"
"$mod SUPERALT,semicolon,layoutmsg,preselect r"
"$mod SUPERALT,h,layoutmsg,preselect n"
];
binde = [
# hyprland keybinds
# focus
"$mod SUPER,J,movefocus,l"
"$mod SUPER,semicolon,movefocus,r"
"$mod SUPER,L,movefocus,u"
"$mod SUPER,K,movefocus,d"
# resize
"$mod SUPER,U,resizeactive,-20 0"
"$mod SUPER,P,resizeactive,20 0"
"$mod SUPER,O,resizeactive,0 -20"
"$mod SUPER,I,resizeactive,0 20"
];
general = {
gaps_out = "3,5,5,5";
border_size = 3;
"col.active_border" = lib.mkForce "0xFFFF0000 0xFF00FF00 0xFF0000FF 45deg";
# "col.inactive_border" = "0x66333333";
allow_tearing = true;
input = {
kb_layout = "${config.mods.xkb.layout}";
kb_variant = "${config.mods.xkb.variant}";
repeat_delay = 200;
force_no_accel = true;
touchpad = {
natural_scroll = true;
tap-to-click = true;
tap-and-drag = true;
};
};
decoration = {
rounding = 4;
};
misc = {
animate_manual_resizes = 1;
enable_swallow = true;
disable_splash_rendering = true;
disable_hyprland_logo = true;
swallow_regex = "^(.*)(kitty)(.*)$";
initial_workspace_tracking = 1;
};
animations = {
bezier = "penguin,0.05,0.9,0.1,1.0";
animation = [
"windowsMove,1,4,default"
"windows,1,7,default,popin 70%"
"windowsOut,1,7,default,popin 70%"
"border,1,10,default"
"fade,1,7,default"
"workspaces,1,6,default"
"layers,1,3,default,popin"
];
};
cursor = {
# conversion seems to be borked right now, i want a smooth bibata :(
enable_hyprcursor = false;
# no_hardware_cursors = true;
# no_break_fs_vrr = true;
};
dwindle = {
preserve_split = true;
pseudotile = 0;
permanent_direction_override = false;
};
gestures = { workspace_swipe = true; };
input = {
kb_layout = "${config.mods.xkb.layout}";
kb_variant = "${config.mods.xkb.variant}";
repeat_delay = 200;
force_no_accel = true;
touchpad = {
natural_scroll = true;
tap-to-click = true;
tap-and-drag = true;
};
};
monitor = config.mods.hyprland.monitor;
workspace = config.mods.hyprland.workspace;
misc = {
animate_manual_resizes = 1;
enable_swallow = true;
disable_splash_rendering = true;
disable_hyprland_logo = true;
swallow_regex = "^(.*)(kitty)(.*)$";
initial_workspace_tracking = 1;
};
env = [
"GTK_CSD,0"
''TERM,"kitty /bin/fish"''
"XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland"
"XDG_SESSION_DESKTOP=Hyprland"
"HYPRCURSOR_THEME,Bibata-Modern-Classic"
"HYPRCURSOR_SIZE,24"
"XCURSOR_THEME,Bibata-Modern-Classic"
"XCURSOR_SIZE,24"
"QT_QPA_PLATFORM,wayland"
"QT_QPA_PLATFORMTHEME,qt5ct"
"QT_WAYLAND_FORCE_DPI,96"
"QT_AUTO_SCREEN_SCALE_FACTOR,0"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_SCALE_FACTOR,1"
''EDITOR,"neovide --novsync --nofork"''
"WLR_DRM_NO_ATOMIC,1"
"GTK_USE_PORTAL, 1"
];
cursor = {
# conversion seems to be borked right now, i want a smooth bibata :(
enable_hyprcursor = false;
# no_hardware_cursors = true;
# no_break_fs_vrr = true;
};
layerrule = [
# layer rules
# mainly to disable animations within slurp and grim
"noanim, selection"
];
gestures = {
workspace_swipe = true;
};
windowrule = [
# window rules
"tile,^(.*)(Spotify)(.*)$"
"float,^(.*)(OxiCalc)(.*)$"
"float,^(.*)(winecfg.exe)(.*)$"
"float,^(.*)(speed.exe)(.*)$"
"float,^(.*)(copyq)(.*)$"
"center,^(.*)(swappy)(.*)$"
"float,title:^(.*)(Spirit)(.*)$"
"float,title:^(.*)(reset)(.*)$"
"workspace 10 silent,^(.*)(steam)(.*)$"
"workspace 9 silent,^(.*)(dota)(.*)$"
"workspace 9 silent,^(.*)(battlebits)(.*)$"
"workspace 9 silent,^(.*)(aoe)(.*)$"
"suppressevent fullscreen maximize,^(.*)(neovide)(.*)$"
];
monitor = config.mods.hyprland.monitor;
workspace = config.mods.hyprland.workspace;
windowrulev2 = [
"immediate,class:^(.*)(Pal)$"
"immediate,class:^(.*)(dota2)$"
"immediate,class:^(.*)(needforspeedheat.exe)$"
];
env = [
"GTK_CSD,0"
"TERM,\"kitty /bin/fish\""
"XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland"
"XDG_SESSION_DESKTOP=Hyprland"
"HYPRCURSOR_THEME,Bibata-Modern-Classic"
"HYPRCURSOR_SIZE,24"
"XCURSOR_THEME,Bibata-Modern-Classic"
"XCURSOR_SIZE,24"
"QT_QPA_PLATFORM,wayland"
"QT_QPA_PLATFORMTHEME,qt5ct"
"QT_WAYLAND_FORCE_DPI,96"
"QT_AUTO_SCREEN_SCALE_FACTOR,0"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_SCALE_FACTOR,1"
"EDITOR,\"neovide --novsync --nofork\""
"WLR_DRM_NO_ATOMIC,1"
"GTK_USE_PORTAL, 1"
];
exec-once = [
# environment
"systemctl --user import-environment"
"dbus-update-activation-environment --systemd --all"
"hyprctl setcursor Bibata-Modern-Classic 24"
layerrule = [
# layer rules
# mainly to disable animations within slurp and grim
"noanim, selection"
];
# other programs
"hyprpaper"
"ironbar"
"firefox"
"oxipaste_daemon"
# should be taken care of with the new systemd services
# "nextcloud --background"
"oxinoti"
] ++ config.mods.hyprland.extra_autostart;
windowrule = [
# window rules
"tile,^(.*)(Spotify)(.*)$"
"float,^(.*)(OxiCalc)(.*)$"
"float,^(.*)(winecfg.exe)(.*)$"
"float,^(.*)(speed.exe)(.*)$"
"float,^(.*)(copyq)(.*)$"
"center,^(.*)(swappy)(.*)$"
"float,title:^(.*)(Spirit)(.*)$"
"float,title:^(.*)(reset)(.*)$"
"workspace 10 silent,^(.*)(steam)(.*)$"
"workspace 9 silent,^(.*)(dota)(.*)$"
"workspace 9 silent,^(.*)(battlebits)(.*)$"
"workspace 9 silent,^(.*)(aoe)(.*)$"
"suppressevent fullscreen maximize,^(.*)(neovide)(.*)$"
];
windowrulev2 = [
"immediate,class:^(.*)(Pal)$"
"immediate,class:^(.*)(dota2)$"
"immediate,class:^(.*)(needforspeedheat.exe)$"
];
exec-once = [
# environment
"systemctl --user import-environment"
"dbus-update-activation-environment --systemd --all"
"hyprctl setcursor Bibata-Modern-Classic 24"
# other programs
"hyprpaper"
"ironbar"
"firefox"
"oxipaste_daemon"
# should be taken care of with the new systemd services
# "nextcloud --background"
"oxinoti"
] ++ config.mods.hyprland.extra_autostart;
# plugin = {
# hyprspace = {
# bind = [
# "SUPER, W, overview:toggle, toggle"
# ];
# };
# };
} // config.mods.hyprland.custom_config;
# wayland.windowManager.hyprland.plugins = [
# inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
# ];
});
# plugin = {
# hyprspace = {
# bind = [
# "SUPER, W, overview:toggle, toggle"
# ];
# };
# };
} // config.mods.hyprland.custom_config;
# wayland.windowManager.hyprland.plugins = [
# inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
# ];
});
}

View file

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

View file

@ -8,7 +8,7 @@
description = "Enables Hyprpaper";
};
config = lib.mkOption {
default = '''';
default = "";
example = ''
Hyprpaper config
'';
@ -21,11 +21,11 @@
};
config = lib.mkIf config.mods.hyprland.hyprpaper.enable
(lib.optionalAttrs (options?xdg.configFile)
{
home.packages = with pkgs; [ hyprpaper ];
xdg.configFile."hypr/hyprpaper.conf" = lib.mkIf config.mods.hyprland.hyprpaper.enable {
(lib.optionalAttrs (options ? xdg.configFile) {
home.packages = with pkgs; [ hyprpaper ];
xdg.configFile."hypr/hyprpaper.conf" =
lib.mkIf config.mods.hyprland.hyprpaper.enable {
text = config.mods.hyprland.hyprpaper.config;
};
});
});
}

View file

@ -1,8 +1,6 @@
{ lib, config, pkgs, options, ... }:
let
username = config.conf.username;
in
{
let username = config.conf.username;
in {
options.mods = {
hyprland.ironbar = {
enable = lib.mkOption {
@ -14,172 +12,166 @@
};
};
config = lib.mkIf config.mods.hyprland.ironbar.enable
(lib.optionalAttrs (options?programs.ironbar)
{
(lib.optionalAttrs (options ? programs.ironbar) {
programs.ironbar = {
enable = true;
style = ''
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
* {
color: #71bbe6;
padding: 0px;
margin: 0px;
}
.background {
background-color: rgba(0, 0, 0, 0);
}
.workspaces {
margin: 2px 0px 0px 5px;
border-radius: 10px;
/* background-color: #2b2c3b; */
background-color: #1E1E2E;
padding: 2px 5px 2px 5px;
}
.workspaces .item {
margin: 0px 3px 0px 3px;
font-size: 13px;
border-radius: 100%;
padding: 0px 2px 0px 3px;
background-color: rgba(0, 0, 0, 0);
}
.workspaces .item:hover {
background-color: #3e4152;
}
.workspaces .item.focused {
background-color: #3e4152;
}
.audio-box {
padding: 2em;
background-color: #1E1E2E;
border-radius: 5px;
}
.audio-slider {
padding: 5px;
margin: 5px;
}
.audio-button {
padding: 5px 10px 5px 10px;
margin: 0px 1em 20px 1em;
border-radius: 100%;
font-size: 17px;
}
.audio-button-box {
padding: 0px 2.5em 0px 2.5em;
}
.focused {
/* margin: 2px 0px 0px 0px; */
padding: 0px 5px 0px 5px;
/* background-color: 1a1b26; */
background-color: #1E1E2E;
font-size: 17px;
border-radius: 10px;
}
#bar #end {
margin: 0px 5px 0px 0px;
padding: 0px 5px 0px 5px;
background-color: #1E1E2E;
border-radius: 10px;
}
.popup-button {
padding: 0px 5px 0px 3px;
margin: 0em 3px;
border-radius: 100%;
font-size: 13px;
background-color: #1E1E2E;
}
.popup-button-box {
padding: 2px 0px 2px 0px;
}
.clock {
padding: 0px 5px 0px 5px;
font-size: 17px;
background-color: #1E1E2E;
}
.clock:hover {
background-color: #3e4152;
}
.custom button {
background-color: #1E1E2E;
}
.custom button:hover {
background-color: #3e4152;
}
.memory-usage {
font-size: 15px;
margin: 0px 5px 0px 0px;
}
.memory-usage:hover {
background-color: #3e4152;
}
.popup-clock {
background-color: #1E1E2E;
border-radius: 5px;
padding: 2px 8px 10px 8px;
}
.popup-clock .calendar-clock {
font-size: 2.5em;
padding-bottom: 0.1em;
}
.popup-clock .calendar {
border-radius: 5px;
font-size: 1.05em;
}
.popup-clock .calendar:selected {
background-color: #3e4152;
}
'';
features = [
#"another_feature"
];
config = {
monitors."${config.conf.monitor}" = {
end = config.conf.ironbar.modules ++ [
{
type = "sys_info";
format = [
" {memory_percent}"
];
interval.memory = 30;
class = "memory-usage";
}
{
type = "custom";
bar = [
{
programs.ironbar = {
enable = true;
style = ''
@import url("/home/${username}/.config/gtk-3.0/gtk.css");
* {
color: #71bbe6;
padding: 0px;
margin: 0px;
}
.background {
background-color: rgba(0, 0, 0, 0);
}
.workspaces {
margin: 2px 0px 0px 5px;
border-radius: 10px;
/* background-color: #2b2c3b; */
background-color: #1E1E2E;
padding: 2px 5px 2px 5px;
}
.workspaces .item {
margin: 0px 3px 0px 3px;
font-size: 13px;
border-radius: 100%;
padding: 0px 2px 0px 3px;
background-color: rgba(0, 0, 0, 0);
}
.workspaces .item:hover {
background-color: #3e4152;
}
.workspaces .item.focused {
background-color: #3e4152;
}
.audio-box {
padding: 2em;
background-color: #1E1E2E;
border-radius: 5px;
}
.audio-slider {
padding: 5px;
margin: 5px;
}
.audio-button {
padding: 5px 10px 5px 10px;
margin: 0px 1em 20px 1em;
border-radius: 100%;
font-size: 17px;
}
.audio-button-box {
padding: 0px 2.5em 0px 2.5em;
}
.focused {
/* margin: 2px 0px 0px 0px; */
padding: 0px 5px 0px 5px;
/* background-color: 1a1b26; */
background-color: #1E1E2E;
font-size: 17px;
border-radius: 10px;
}
#bar #end {
margin: 0px 5px 0px 0px;
padding: 0px 5px 0px 5px;
background-color: #1E1E2E;
border-radius: 10px;
}
.popup-button {
padding: 0px 5px 0px 3px;
margin: 0em 3px;
border-radius: 100%;
font-size: 13px;
background-color: #1E1E2E;
}
.popup-button-box {
padding: 2px 0px 2px 0px;
}
.clock {
padding: 0px 5px 0px 5px;
font-size: 17px;
background-color: #1E1E2E;
}
.clock:hover {
background-color: #3e4152;
}
.custom button {
background-color: #1E1E2E;
}
.custom button:hover {
background-color: #3e4152;
}
.memory-usage {
font-size: 15px;
margin: 0px 5px 0px 0px;
}
.memory-usage:hover {
background-color: #3e4152;
}
.popup-clock {
background-color: #1E1E2E;
border-radius: 5px;
padding: 2px 8px 10px 8px;
}
.popup-clock .calendar-clock {
font-size: 2.5em;
padding-bottom: 0.1em;
}
.popup-clock .calendar {
border-radius: 5px;
font-size: 1.05em;
}
.popup-clock .calendar:selected {
background-color: #3e4152;
}
'';
features = [
#"another_feature"
];
config = {
monitors."${config.conf.monitor}" = {
end = config.conf.ironbar.modules ++ [
{
type = "sys_info";
format = [ " {memory_percent}" ];
interval.memory = 30;
class = "memory-usage";
}
{
type = "custom";
bar = [{
type = "button";
class = "popup-button";
label = "";
on_click = "popup:toggle";
}
];
class = "popup-button-box";
popup = [
{
}];
class = "popup-button-box";
popup = [{
type = "box";
orientation = "vertical";
class = "audio-box";
@ -192,13 +184,15 @@
type = "button";
class = "audio-button";
label = "";
on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh bluetooth";
on_click =
"!/home/${username}/.config/eww/scripts/audio_control.sh bluetooth";
}
{
type = "button";
class = "audio-button";
label = "󰋋";
on_click = "!/home/${username}/.config/eww/scripts/audio_control.sh internal";
on_click =
"!/home/${username}/.config/eww/scripts/audio_control.sh internal";
}
];
class = "audio-button-box";
@ -212,7 +206,8 @@
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
value =
"pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-sink-volume @DEFAULT_SINK@ $0%";
}
{
@ -224,51 +219,49 @@
class = "audio-slider";
step = 1.0;
length = 200;
value = "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change = "!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
value =
"pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'";
on_change =
"!pactl set-source-volume @DEFAULT_SOURCE@ $0%";
}
];
}
];
}
{
type = "custom";
bar = [
{
}];
}
{
type = "custom";
bar = [{
type = "button";
class = "popup-button";
label = "";
on_click = "!oxidash --css /home/${username}/gits/oxidash/style.css";
}
];
class = "popup-button-box";
}
{
type = "clock";
format = "%I:%M";
format_popup = "%I:%M:%S";
locale = "en_US";
}
{ type = "tray"; }
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [{
type = "workspaces";
all_monitors = true;
}];
center = [
{
on_click =
"!oxidash --css /home/${username}/gits/oxidash/style.css";
}];
class = "popup-button-box";
}
{
type = "clock";
format = "%I:%M";
format_popup = "%I:%M:%S";
locale = "en_US";
}
{ type = "tray"; }
];
position = "top";
height = 10;
anchor_to_edges = true;
start = [{
type = "workspaces";
all_monitors = true;
}];
center = [{
type = "focused";
show_icon = true;
show_title = true;
icon_size = 20;
truncate = "end";
}
];
}];
};
};
};
};
});
});
}

View file

@ -12,19 +12,20 @@
};
config = lib.mkIf config.mods.kde_connect.enable
(lib.optionalAttrs (options?networking.firewall)
{
networking.firewall = {
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
(lib.optionalAttrs (options ? networking.firewall) {
networking.firewall = {
allowedTCPPortRanges = [{
from = 1714;
to = 1764;
} # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
allowedUDPPortRanges = [{
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

@ -10,7 +10,8 @@
default = true;
example = false;
type = lib.types.bool;
description = "Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
description =
"Whether to overwrite the cache config of keepassxc. Note, this means that changes can't be applied via the program anymore!";
};
cache_config = lib.mkOption {
default = ''
@ -20,41 +21,41 @@
LastOpenedDatabases=/home/dashie/Music/Passwords.kdbx
LastKeyFiles=@Variant(\0\0\0\x1c\0\0\0\x1\0\0\0\x42\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0M\0u\0s\0i\0\x63\0/\0P\0\x61\0s\0s\0w\0o\0r\0\x64\0s\0.\0k\0\x64\0\x62\0x\0\0\0\n\0\0\0\x42\0/\0h\0o\0m\0\x65\0/\0\x64\0\x61\0s\0h\0i\0\x65\0/\0M\0u\0s\0i\0\x63\0/\0l\0o\0g\0i\0n\0_\0k\0\x65\0y\0.\0k\0\x65\0y\0x)
'';
example = '''';
example = "";
type = lib.types.lines;
description = "Cache config to be used.";
};
};
config = lib.mkIf config.mods.keepassxc.enable
(lib.optionalAttrs (options?home.file) {
(lib.optionalAttrs (options ? home.file) {
home.packages = [ pkgs.keepassxc ];
xdg.configFile."keepassxc/keepassxc.ini" = {
text =
''
[General]
ConfigVersion=2
text = ''
[General]
ConfigVersion=2
[Browser]
Enabled=true
[Browser]
Enabled=true
[GUI]
ApplicationTheme=classic
HidePasswords=true
MinimizeOnClose=true
MinimizeToTray=true
ShowTrayIcon=true
TrayIconAppearance=monochrome-light
[GUI]
ApplicationTheme=classic
HidePasswords=true
MinimizeOnClose=true
MinimizeToTray=true
ShowTrayIcon=true
TrayIconAppearance=monochrome-light
[PasswordGenerator]
Length=30
[PasswordGenerator]
Length=30
[Security]
EnableCopyOnDoubleClick=true
'';
[Security]
EnableCopyOnDoubleClick=true
'';
};
home.file.".cache/keepassxc/keepassxc.ini" = lib.mkIf config.mods.keepassxc.use_cache_config {
text = config.mods.keepassxc.cache_config;
};
home.file.".cache/keepassxc/keepassxc.ini" =
lib.mkIf config.mods.keepassxc.use_cache_config {
text = config.mods.keepassxc.cache_config;
};
});
}

View file

@ -13,7 +13,7 @@
description = "Your variant";
};
};
config = (lib.optionalAttrs (options?services.xserver) {
config = (lib.optionalAttrs (options ? services.xserver) {
# Configure keymap in X11
services.xserver = {
xkb.layout = "${config.mods.xkb.layout}";

View file

@ -16,11 +16,10 @@
'';
};
};
config =
(lib.optionalAttrs (options?home.packages)
{
home.packages = config.mods.media_packages.additional_packages;
} // (lib.mkIf config.mods.media_packages.enable (lib.optionalAttrs (options?home.packages) {
config = (lib.optionalAttrs (options ? home.packages) {
home.packages = config.mods.media_packages.additional_packages;
} // (lib.mkIf config.mods.media_packages.enable
(lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [
# base audio
pipewire
@ -49,8 +48,6 @@
yt-dlp
];
programs.obs-studio.enable = true;
programs.obs-studio.plugins = with pkgs; [
obs-studio-plugins.obs-vaapi
];
programs.obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ];
})));
}

View file

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

View file

@ -8,12 +8,9 @@
};
};
config = lib.mkIf config.mods.piper.enable
(lib.optionalAttrs (options?services.ratbagd)
{
services.ratbagd.enable = true;
} // lib.optionalAttrs (options?home.packages) {
home.packages = with pkgs; [
piper
];
(lib.optionalAttrs (options ? services.ratbagd) {
services.ratbagd.enable = true;
} // lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ piper ];
});
}

View file

@ -8,17 +8,16 @@
};
};
config = lib.mkIf config.mods.printing.enable
(lib.optionalAttrs (options?services.printing)
{
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.browsing = true;
services.printing.drivers = [ pkgs.hplip ];
services.printing.startWhenNeeded = true; # optional
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
});
(lib.optionalAttrs (options ? services.printing) {
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.browsing = true;
services.printing.drivers = [ pkgs.hplip ];
services.printing.startWhenNeeded = true; # optional
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
});
}

30
modules/programs/sops.nix Normal file
View file

@ -0,0 +1,30 @@
{ lib, pkgs, config, options, ... }: {
options.mods.sops = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enable sops secrets";
};
};
config = lib.mkIf config.mods.sops.enable
(lib.optionalAttrs (options ? home.packages) {
home.packages = with pkgs; [ sops ];
sops = {
gnupg = {
home = "~/.gnupg";
sshKeyPaths = [ ];
};
defaultSopsFile = ../../secrets/secrets.yaml;
secrets = {
hub = { };
lab = { };
${config.conf.username} = { };
nextcloud = { };
access = { };
};
};
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
});
}

View file

@ -30,92 +30,99 @@
};
# environment.systemPackages needed in order to configure systemwide
config = lib.mkIf config.mods.starship.enable (lib.optionalAttrs (options?environment.systemPackages) {
programs.starship =
let
config = lib.mkIf config.mods.starship.enable
(lib.optionalAttrs (options ? environment.systemPackages) {
programs.starship = let
base16 = pkgs.callPackage inputs.base16.lib { };
scheme = (base16.mkSchemeAttrs config.stylix.base16Scheme);
code_format = "[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)";
in
{
code_format =
"[](bg:prev_bg fg:#5256c3)[ $symbol ($version)](bg:#5256c3)";
in {
enable = true;
interactiveOnly = true;
presets = lib.mkIf config.mods.starship.use_default_prompt [ "pastel-powerline" ];
settings = lib.mkIf config.mods.starship.use_default_prompt
{
# derived from https://starship.rs/presets/pastel-powerline
format = ''$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)'';
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'';
username = {
show_always = false;
style_user = "bg:#5277C3 fg:#${scheme.base05}";
style_root = "bg:#5277C3 fg:#${scheme.base05}";
format = "[ $user ]($style)[](bg:#3465A4 fg:#5277C3)";
disabled = false;
};
os = {
symbols = { NixOS = " "; };
style = "bg:#3465A4 fg:#${scheme.base05}";
disabled = false;
};
directory = {
style = "bg:#3465A4 fg:#${scheme.base05}";
format = "[ $path ]($style)";
truncation_length = 3;
truncation_symbol = "/";
};
git_branch = {
always_show_remote = true;
symbol = "";
style = "bg:#5256c3 fg:#${scheme.base05}";
format = "[ ](bg:#5256c3 fg:prev_bg)[$symbol ($remote_name )$branch ]($style)";
};
git_status = {
staged = "+\${count} (fg:#C4A000)";
ahead = "\${count} (fg:#C4A000)";
diverged = "\${count} (fg:#C4A000)";
behind = "\${count} (fg:#C4A000)";
stashed = " ";
untracked = "?\${count} (fg:#C4A000)";
modified = "!\${count} (fg:#C4A000)";
deleted = "\${count} (fg:#C4A000)";
conflicted = "=\${count} (fg:#C4A000)";
renamed = "»\${count} (fg:#C4A000)";
style = "bg:#5256c3 fg:fg:#C4A000";
format = "[$all_status$ahead_behind]($style)";
};
git_metrics = {
disabled = false;
format = "([| ](bg:#5256c3)[+$added]($added_style bg:#5256c3)[ -$deleted]($deleted_style bg:#5256c3))";
};
c = { format = code_format; };
elixir = { format = code_format; };
elm = { format = code_format; };
golang = { format = code_format; };
gradle = { format = code_format; };
haskell = { format = code_format; };
java = { format = code_format; };
julia = { format = code_format; };
nodejs = { format = code_format; };
nim = { format = code_format; };
nix_shell = { 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;
presets = lib.mkIf config.mods.starship.use_default_prompt
[ "pastel-powerline" ];
settings = lib.mkIf config.mods.starship.use_default_prompt {
# derived from https://starship.rs/presets/pastel-powerline
format =
"$username$directory$git_branch$git_status$git_metrics[ ](bg:none fg:prev_bg)";
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";
username = {
show_always = false;
style_user = "bg:#5277C3 fg:#${scheme.base05}";
style_root = "bg:#5277C3 fg:#${scheme.base05}";
format = "[ $user ]($style)[](bg:#3465A4 fg:#5277C3)";
disabled = false;
};
os = {
symbols = { NixOS = " "; };
style = "bg:#3465A4 fg:#${scheme.base05}";
disabled = false;
};
directory = {
style = "bg:#3465A4 fg:#${scheme.base05}";
format = "[ $path ]($style)";
truncation_length = 3;
truncation_symbol = "/";
};
git_branch = {
always_show_remote = true;
symbol = "";
style = "bg:#5256c3 fg:#${scheme.base05}";
format =
"[ ](bg:#5256c3 fg:prev_bg)[$symbol ($remote_name )$branch ]($style)";
};
git_status = {
staged = "+\${count} (fg:#C4A000)";
ahead = "\${count} (fg:#C4A000)";
diverged = "\${count} (fg:#C4A000)";
behind = "\${count} (fg:#C4A000)";
stashed = " ";
untracked = "?\${count} (fg:#C4A000)";
modified = "!\${count} (fg:#C4A000)";
deleted = "\${count} (fg:#C4A000)";
conflicted = "=\${count} (fg:#C4A000)";
renamed = "»\${count} (fg:#C4A000)";
style = "bg:#5256c3 fg:fg:#C4A000";
format = "[$all_status$ahead_behind]($style)";
};
git_metrics = {
disabled = false;
format =
"([| ](bg:#5256c3)[+$added]($added_style bg:#5256c3)[ -$deleted]($deleted_style bg:#5256c3))";
};
c = { format = code_format; };
elixir = { format = code_format; };
elm = { format = code_format; };
golang = { format = code_format; };
gradle = { format = code_format; };
haskell = { format = code_format; };
java = { format = code_format; };
julia = { format = code_format; };
nodejs = { format = code_format; };
nim = { format = code_format; };
nix_shell = {
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

@ -36,7 +36,7 @@
'';
};
};
config = (lib.optionalAttrs (options?stylix) {
config = (lib.optionalAttrs (options ? stylix) {
stylix = {
enable = true;
image = ../../base/black.jpg;
@ -75,8 +75,10 @@
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");
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

@ -0,0 +1,17 @@
{ lib, config, options, pkgs, ... }:
let callPackage = lib.callPackageWith pkgs;
in {
options.mods.teams = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description =
"Enables teams via a chromium pwa (for the poor souls that have to use this for work)";
};
};
config = lib.mkIf config.mods.teams.enable
(lib.optionalAttrs (options ? home.packages) {
home.packages = [ (callPackage ../../override/teams.nix { }) ];
});
}

View file

@ -11,7 +11,8 @@
};
};
config = lib.optionalAttrs (options?virtualisation.virtualbox.host) {
virtualisation.virtualbox.host.enable = lib.mkIf config.mods.virtualbox.enable true;
config = lib.optionalAttrs (options ? virtualisation.virtualbox.host) {
virtualisation.virtualbox.host.enable =
lib.mkIf config.mods.virtualbox.enable true;
};
}

View file

@ -11,7 +11,6 @@
};
};
config = lib.optionalAttrs (options?hardware) {
hardware.xone.enable = true;
};
config =
lib.optionalAttrs (options ? hardware) { hardware.xone.enable = true; };
}

View file

@ -0,0 +1,14 @@
{ lib, config, options, ... }: {
options.mods.yazi = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables yazi";
};
};
config = lib.mkIf config.mods.yazi.enable
(lib.optionalAttrs (options ? home.packages) {
programs.yazi = import ./yazi.nix;
});
}

File diff suppressed because it is too large Load diff