format all

This commit is contained in:
Kopatz
2025-10-30 21:59:31 +01:00
parent b1dda4d037
commit 8a78e618bb
188 changed files with 3526 additions and 1825 deletions

133
flake.nix
View File

@@ -59,24 +59,27 @@
#}; #};
}; };
outputs = outputs =
{ self {
, nur self,
, nixpkgs nur,
, nixos-hardware nixpkgs,
, nixpkgs-unstable nixos-hardware,
, agenix nixpkgs-unstable,
, home-manager agenix,
, home-manager-unstable home-manager,
home-manager-unstable,
#, nixos-cosmic #, nixos-cosmic
, nixvim nixvim,
, stylix stylix,
, disko disko,
, flake-utils flake-utils,
, ... ...
}@inputs: }@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
overlays = { outputs, ... }: { overlays =
{ outputs, ... }:
{
nixpkgs.overlays = with outputs.overlays; [ nixpkgs.overlays = with outputs.overlays; [
#unstable-packages #unstable-packages
stable-packages stable-packages
@@ -85,54 +88,78 @@
nur.overlays.default nur.overlays.default
]; ];
}; };
defaultModules = [ ./modules agenix.nixosModules.default overlays ]; defaultModules = [
./modules
agenix.nixosModules.default
overlays
];
# helper function to create a machine # helper function to create a machine
mkHost = mkHost =
{ modules {
, specialArgs ? { modules,
specialArgs ? {
pkgsVersion = nixpkgs-unstable; pkgsVersion = nixpkgs-unstable;
home-manager-version = home-manager-unstable; home-manager-version = home-manager-unstable;
} },
, system ? "x86_64-linux" system ? "x86_64-linux",
, minimal ? false minimal ? false,
, graphical ? true graphical ? true,
}: }:
let lib = specialArgs.pkgsVersion.lib; let
in specialArgs.pkgsVersion.lib.nixosSystem { lib = specialArgs.pkgsVersion.lib;
in
specialArgs.pkgsVersion.lib.nixosSystem {
inherit system; inherit system;
modules = modules ++ defaultModules ++ lib.lists.optionals (!minimal) modules =
[ specialArgs.home-manager-version.nixosModules.home-manager ] modules
++ defaultModules
++ lib.lists.optionals (!minimal) [ specialArgs.home-manager-version.nixosModules.home-manager ]
++ lib.lists.optionals (!minimal && graphical) [ ++ lib.lists.optionals (!minimal && graphical) [
stylix.nixosModules.stylix stylix.nixosModules.stylix
inputs.nixpkgs-xr.nixosModules.nixpkgs-xr inputs.nixpkgs-xr.nixosModules.nixpkgs-xr
./modules/graphical/stylix.nix ./modules/graphical/stylix.nix
#nixos-cosmic.nixosModules.default #nixos-cosmic.nixosModules.default
#./modules/graphical/cosmic.nix #./modules/graphical/cosmic.nix
({ outputs, ... }: { stylix.image = ./tsukasa.jpg; }) (
{ outputs, ... }:
{
stylix.image = ./tsukasa.jpg;
}
)
]; ];
specialArgs = specialArgs // { inherit inputs outputs; }; specialArgs = specialArgs // {
inherit inputs outputs;
};
}; };
mkStableServer = mkStableServer =
{ modules {
, specialArgs ? { modules,
specialArgs ? {
pkgsVersion = nixpkgs; pkgsVersion = nixpkgs;
home-manager-version = home-manager; home-manager-version = home-manager;
} },
, system ? "x86_64-linux" system ? "x86_64-linux",
, minimal ? false minimal ? false,
}: }:
let lib = specialArgs.pkgsVersion.lib; let
in specialArgs.pkgsVersion.lib.nixosSystem { lib = specialArgs.pkgsVersion.lib;
in
specialArgs.pkgsVersion.lib.nixosSystem {
inherit system; inherit system;
modules = modules modules =
++ [ ./modules agenix.nixosModules.default overlays ] modules
++ lib.lists.optionals (!minimal) ++ [
[ specialArgs.home-manager-version.nixosModules.home-manager ]; ./modules
specialArgs = specialArgs // { inherit inputs outputs; }; agenix.nixosModules.default
overlays
]
++ lib.lists.optionals (!minimal) [ specialArgs.home-manager-version.nixosModules.home-manager ];
specialArgs = specialArgs // {
inherit inputs outputs;
};
}; };
customPackages = flake-utils.lib.eachDefaultSystem (system: { customPackages = flake-utils.lib.eachDefaultSystem (system: {
packages = packages = import ./pkgs { pkgs = nixpkgs-unstable.legacyPackages.${system}; };
import ./pkgs { pkgs = nixpkgs-unstable.legacyPackages.${system}; };
}); });
in in
{ {
@@ -140,7 +167,10 @@
nixosConfigurations = { nixosConfigurations = {
"kop-pc" = mkHost { "kop-pc" = mkHost {
modules = [ ./users/kopatz ./systems/pc/configuration.nix ]; modules = [
./users/kopatz
./systems/pc/configuration.nix
];
}; };
"framework" = mkHost { "framework" = mkHost {
modules = [ modules = [
@@ -159,11 +189,16 @@
pkgsVersion = nixpkgs; pkgsVersion = nixpkgs;
home-manager-version = home-manager; home-manager-version = home-manager;
}; };
modules = modules = [
[ disko.nixosModules.disko ./systems/adam-site/configuration.nix ]; disko.nixosModules.disko
./systems/adam-site/configuration.nix
];
}; };
"amd-server" = mkHost { "amd-server" = mkHost {
modules = [ ./users/kopatz ./systems/amd-server/configuration.nix ]; modules = [
./users/kopatz
./systems/amd-server/configuration.nix
];
}; };
"amd-server-vpn-vm" = mkHost { "amd-server-vpn-vm" = mkHost {
modules = [ modules = [
@@ -173,8 +208,12 @@
]; ];
}; };
# build vm -> nixos-rebuild build-vm --flake .#vm # build vm -> nixos-rebuild build-vm --flake .#vm
"vm" = "vm" = mkHost {
mkHost { modules = [ ./users/vm ./systems/vm/configuration.nix ]; }; modules = [
./users/vm
./systems/vm/configuration.nix
];
};
# nixos-rebuild switch --flake .#server-vm --target-host root@192.168.0.21 # nixos-rebuild switch --flake .#server-vm --target-host root@192.168.0.21
"server-vm" = mkHost { "server-vm" = mkHost {
modules = [ modules = [

View File

@@ -1,4 +1,12 @@
{ osConfig, config, pkgs, inputs, lib, ... }: { {
osConfig,
config,
pkgs,
inputs,
lib,
...
}:
{
config = lib.mkIf osConfig.custom.graphical.code.enable rec { config = lib.mkIf osConfig.custom.graphical.code.enable rec {
#home.activation.makeVSCodeConfigWritable = #home.activation.makeVSCodeConfigWritable =
# let # let

View File

@@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
programs.direnv = { programs.direnv = {
enable = true; enable = true;

View File

@@ -1,3 +1,4 @@
{ ... }: { { ... }:
{
home.file.".config/Vencord/themes/theme.css".source = ./BasicBackground.theme.css; home.file.".config/Vencord/themes/theme.css".source = ./BasicBackground.theme.css;
} }

View File

@@ -1,6 +1,13 @@
{ lib, osConfig, pkgs, ... }: {
let enable = osConfig.custom.graphical.i3.enable || osConfig.custom.graphical.hyprland.enable; lib,
in { osConfig,
pkgs,
...
}:
let
enable = osConfig.custom.graphical.i3.enable || osConfig.custom.graphical.hyprland.enable;
in
{
config = lib.mkIf enable { config = lib.mkIf enable {
services.dunst = { services.dunst = {
enable = true; enable = true;

View File

@@ -1,10 +1,13 @@
{ lib, pkgs, ... }: { { lib, pkgs, ... }:
{
programs.fastfetch = { programs.fastfetch = {
enable = true; enable = true;
settings = { settings = {
#logo = { source = ../test.sixel; type = "raw"; width = 40; height = 40; }; #logo = { source = ../test.sixel; type = "raw"; width = 40; height = 40; };
display = { separator = ""; }; display = {
separator = "";
};
# https://www.nerdfonts.com/cheat-sheet # https://www.nerdfonts.com/cheat-sheet
modules = [ modules = [

View File

@@ -17,8 +17,7 @@
# Firefox 83 introduced sponsored top sites # Firefox 83 introduced sponsored top sites
# (https://support.mozilla.org/en-US/kb/sponsor-privacy), which are sponsored ads # (https://support.mozilla.org/en-US/kb/sponsor-privacy), which are sponsored ads
# displayed as suggestions in the URL bar. # displayed as suggestions in the URL bar.
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false;
false;
# Disable about:config warning. # Disable about:config warning.
# No details # No details
"browser.aboutConfig.showWarning" = false; "browser.aboutConfig.showWarning" = false;

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, osConfig, ... }: {
pkgs,
lib,
osConfig,
...
}:
let let
base16 = osConfig.stylix.base16Scheme; base16 = osConfig.stylix.base16Scheme;
@@ -232,17 +237,22 @@ user_pref("layout.word_select.eat_space_to_next_word", false);
"ebay".metaData.hidden = true; "ebay".metaData.hidden = true;
"ddg" = { "ddg" = {
urls = [{ urls = [
{
template = "https://duckduckgo.com"; template = "https://duckduckgo.com";
params = [{ params = [
{
name = "q"; name = "q";
value = "{searchTerms}"; value = "{searchTerms}";
}]; }
}]; ];
}
];
definedAliases = [ ",d" ]; definedAliases = [ ",d" ];
}; };
"Nix Packages" = { "Nix Packages" = {
urls = [{ urls = [
{
template = "https://search.nixos.org/packages"; template = "https://search.nixos.org/packages";
params = [ params = [
{ {
@@ -254,27 +264,36 @@ user_pref("layout.word_select.eat_space_to_next_word", false);
value = "{searchTerms}"; value = "{searchTerms}";
} }
]; ];
}]; }
];
definedAliases = [ ",n" ]; definedAliases = [ ",n" ];
}; };
"Wikipedia" = { "Wikipedia" = {
urls = [{ urls = [
{
template = "https://en.wikipedia.org/wiki/Special:Search"; template = "https://en.wikipedia.org/wiki/Special:Search";
params = [{ params = [
{
name = "search"; name = "search";
value = "{searchTerms}"; value = "{searchTerms}";
}]; }
}]; ];
}
];
definedAliases = [ ",w" ]; definedAliases = [ ",w" ];
}; };
"GitHub" = { "GitHub" = {
urls = [{ urls = [
{
template = "https://github.com/search"; template = "https://github.com/search";
params = [{ params = [
{
name = "q"; name = "q";
value = "{searchTerms}"; value = "{searchTerms}";
}]; }
}]; ];
}
];
definedAliases = [ ",gh" ]; definedAliases = [ ",gh" ];
}; };
}; };
@@ -313,8 +332,7 @@ in
"ebay@search.mozilla.org".installation_mode = "blocked"; "ebay@search.mozilla.org".installation_mode = "blocked";
"wikipedia@search.mozilla.org".installation_mode = "blocked"; "wikipedia@search.mozilla.org".installation_mode = "blocked";
"{5cd68d86-8324-4ab2-9e0d-3afcc60bee5f}" = { "{5cd68d86-8324-4ab2-9e0d-3afcc60bee5f}" = {
install_url = install_url = "https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi";
"https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
}; };
}; };
@@ -323,7 +341,8 @@ in
default = { default = {
name = "privacy-friendly"; name = "privacy-friendly";
extraConfig = betterfox; extraConfig = betterfox;
settings = merge ([ settings = merge (
[
(import ./config/preferences.nix) (import ./config/preferences.nix)
(import ./config/browser-features.nix) (import ./config/browser-features.nix)
(import ./config/privacy.nix) (import ./config/privacy.nix)
@@ -331,8 +350,9 @@ in
(import ./config/tracking-webaudio.nix) (import ./config/tracking-webaudio.nix)
(import ./config/security.nix) (import ./config/security.nix)
(import ./config/speed.nix) (import ./config/speed.nix)
] ++ lib.optionals osConfig.custom.hardware.nvidia.enable ]
[ (import ./config/nvidia-fixes.nix) ]); ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ (import ./config/nvidia-fixes.nix) ]
);
userChrome = '' userChrome = ''
/* Hide tab bar. Used with Sidebery */ /* Hide tab bar. Used with Sidebery */
#TabsToolbar { #TabsToolbar {
@@ -375,15 +395,17 @@ in
enable-webaudio = { enable-webaudio = {
name = "privacy-but-enable-webaudio"; name = "privacy-but-enable-webaudio";
id = 2; id = 2;
settings = merge ([ settings = merge (
[
(import ./config/preferences.nix) (import ./config/preferences.nix)
(import ./config/browser-features.nix) (import ./config/browser-features.nix)
(import ./config/privacy.nix) (import ./config/privacy.nix)
(import ./config/tracking.nix) (import ./config/tracking.nix)
(import ./config/security.nix) (import ./config/security.nix)
(import ./config/speed.nix) (import ./config/speed.nix)
] ++ lib.optionals osConfig.custom.hardware.nvidia.enable ]
[ (import ./config/nvidia-fixes.nix) ]); ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ (import ./config/nvidia-fixes.nix) ]
);
userChrome = '' userChrome = ''
/* Hide tab bar. Used with Sidebery */ /* Hide tab bar. Used with Sidebery */
#TabsToolbar { #TabsToolbar {
@@ -413,10 +435,13 @@ in
visibility: collapse !important; visibility: collapse !important;
} }
''; '';
settings = merge settings = merge (
([ (import ./config/preferences.nix) (import ./config/speed.nix) ] [
++ lib.optionals osConfig.custom.hardware.nvidia.enable (import ./config/preferences.nix)
[ (import ./config/nvidia-fixes.nix) ]); (import ./config/speed.nix)
]
++ lib.optionals osConfig.custom.hardware.nvidia.enable [ (import ./config/nvidia-fixes.nix) ]
);
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
clearurls clearurls
darkreader darkreader
@@ -435,8 +460,15 @@ in
genericName = "Web Browser"; genericName = "Web Browser";
exec = "firefox -P privacy-but-enable-webaudio %U"; exec = "firefox -P privacy-but-enable-webaudio %U";
terminal = false; terminal = false;
categories = [ "Application" "Network" "WebBrowser" ]; categories = [
mimeType = [ "text/html" "text/xml" ]; "Application"
"Network"
"WebBrowser"
];
mimeType = [
"text/html"
"text/xml"
];
}; };
}; };
} }

View File

@@ -1,4 +1,10 @@
{ lib, config, osConfig, pkgs, ... }: {
lib,
config,
osConfig,
pkgs,
...
}:
let let
merge = lib.foldr (a: b: a // b) { }; merge = lib.foldr (a: b: a // b) { };
search = { search = {
@@ -11,17 +17,22 @@ let
"eBay".metaData.hidden = true; "eBay".metaData.hidden = true;
"DuckDuckGo" = { "DuckDuckGo" = {
urls = [{ urls = [
{
template = "https://duckduckgo.com"; template = "https://duckduckgo.com";
params = [{ params = [
{
name = "q"; name = "q";
value = "{searchTerms}"; value = "{searchTerms}";
}]; }
}]; ];
}
];
definedAliases = [ ",d" ]; definedAliases = [ ",d" ];
}; };
"Nix Packages" = { "Nix Packages" = {
urls = [{ urls = [
{
template = "https://search.nixos.org/packages"; template = "https://search.nixos.org/packages";
params = [ params = [
{ {
@@ -33,27 +44,36 @@ let
value = "{searchTerms}"; value = "{searchTerms}";
} }
]; ];
}]; }
];
definedAliases = [ ",n" ]; definedAliases = [ ",n" ];
}; };
"Wikipedia" = { "Wikipedia" = {
urls = [{ urls = [
{
template = "https://en.wikipedia.org/wiki/Special:Search"; template = "https://en.wikipedia.org/wiki/Special:Search";
params = [{ params = [
{
name = "search"; name = "search";
value = "{searchTerms}"; value = "{searchTerms}";
}]; }
}]; ];
}
];
definedAliases = [ ",w" ]; definedAliases = [ ",w" ];
}; };
"GitHub" = { "GitHub" = {
urls = [{ urls = [
{
template = "https://github.com/search"; template = "https://github.com/search";
params = [{ params = [
{
name = "q"; name = "q";
value = "{searchTerms}"; value = "{searchTerms}";
}]; }
}]; ];
}
];
definedAliases = [ ",gh" ]; definedAliases = [ ",gh" ];
}; };
}; };
@@ -86,15 +106,15 @@ in
"ebay@search.mozilla.org".installation_mode = "blocked"; "ebay@search.mozilla.org".installation_mode = "blocked";
"wikipedia@search.mozilla.org".installation_mode = "blocked"; "wikipedia@search.mozilla.org".installation_mode = "blocked";
"{5cd68d86-8324-4ab2-9e0d-3afcc60bee5f}" = { "{5cd68d86-8324-4ab2-9e0d-3afcc60bee5f}" = {
install_url = install_url = "https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi";
"https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
}; };
}; };
}; };
profiles.default = { profiles.default = {
inherit search; inherit search;
settings = merge ([ settings = merge (
[
(import ../firefox/config/preferences.nix) (import ../firefox/config/preferences.nix)
(import ../firefox/config/browser-features.nix) (import ../firefox/config/browser-features.nix)
(import ../firefox/config/privacy.nix) (import ../firefox/config/privacy.nix)
@@ -103,8 +123,11 @@ in
(import ../firefox/config/security.nix) (import ../firefox/config/security.nix)
(import ../firefox/config/speed.nix) (import ../firefox/config/speed.nix)
(import ./floorp-config.nix) (import ./floorp-config.nix)
] ++ lib.optionals osConfig.custom.hardware.nvidia.enable ]
[ (import ../firefox/config/nvidia-fixes.nix) ]); ++ lib.optionals osConfig.custom.hardware.nvidia.enable [
(import ../firefox/config/nvidia-fixes.nix)
]
);
userChrome = '' userChrome = ''
/* Hide tab bar. Used with Sidebery */ /* Hide tab bar. Used with Sidebery */
#TabsToolbar { #TabsToolbar {

View File

@@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
home.file.".gitconfig" = { home.file.".gitconfig" = {
enable = true; enable = true;

View File

@@ -1,4 +1,11 @@
{ config, osConfig, pkgs, inputs, lib, ... }: {
config,
osConfig,
pkgs,
inputs,
lib,
...
}:
let let
cfg = osConfig.custom.graphical.hyprland; cfg = osConfig.custom.graphical.hyprland;
isPc = osConfig.networking.hostName == "kop-pc"; isPc = osConfig.networking.hostName == "kop-pc";
@@ -16,7 +23,13 @@ let
hyprctl --instance 0 "dispatch exec hyprlock" hyprctl --instance 0 "dispatch exec hyprlock"
''; '';
scale = if isLaptop then "1.33333" else "1"; scale = if isLaptop then "1.33333" else "1";
monitor1 = if isPc then "DP-1" else if isLaptop then "eDP-1" else "eDP-1"; monitor1 =
if isPc then
"DP-1"
else if isLaptop then
"eDP-1"
else
"eDP-1";
monitor2 = "HDMI-A-1"; monitor2 = "HDMI-A-1";
in in
{ {
@@ -38,24 +51,27 @@ in
# See https://wiki.hyprland.org/Configuring/Monitors/ # See https://wiki.hyprland.org/Configuring/Monitors/
monitor = monitor =
if isPc then [ if isPc then
[
"${monitor2},1920x1080@60,0x0,${scale}" "${monitor2},1920x1080@60,0x0,${scale}"
"${monitor1},2560x1440@144,1920x0,${scale}" "${monitor1},2560x1440@144,1920x0,${scale}"
"Unknown-1,disable" "Unknown-1,disable"
] else if isLaptop then [ ]
else if isLaptop then
[
# laptop # laptop
"eDP-1,2256x1504@60,0x0,${scale}" "eDP-1,2256x1504@60,0x0,${scale}"
#"DP-3,1920x1080@60,1920x0,1" #"DP-3,1920x1080@60,1920x0,1"
#",preferred,auto,1,mirror,eDP-1" #",preferred,auto,1,mirror,eDP-1"
",preferred,auto,auto" ",preferred,auto,auto"
] else ]
else
[ [
# Default # Default
",preferred,auto,auto" ",preferred,auto,auto"
]; ];
workspace = workspace = lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [
lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [
"1,monitor:${monitor1}" "1,monitor:${monitor1}"
"2,monitor:${monitor1}" "2,monitor:${monitor1}"
"3,monitor:${monitor1}" "3,monitor:${monitor1}"
@@ -74,8 +90,11 @@ in
# source = ~/.config/hypr/myColors.conf # source = ~/.config/hypr/myColors.conf
# Some default env vars. # Some default env vars.
env = env = [
[ "XCURSOR_SIZE,24" "NIXOS_OZONE_WL,1" "GDK_SCALE,${scale}" ] "XCURSOR_SIZE,24"
"NIXOS_OZONE_WL,1"
"GDK_SCALE,${scale}"
]
++ lib.optionals osConfig.custom.hardware.nvidia.enable [ ++ lib.optionals osConfig.custom.hardware.nvidia.enable [
"LIBVA_DRIVER_NAME,nvidia" "LIBVA_DRIVER_NAME,nvidia"
"GBM_BACKEND,nvidia-drm" "GBM_BACKEND,nvidia-drm"
@@ -93,7 +112,9 @@ in
follow_mouse = 1; follow_mouse = 1;
float_switch_override_focus = 2; float_switch_override_focus = 2;
touchpad = { natural_scroll = true; }; touchpad = {
natural_scroll = true;
};
accel_profile = "flat"; accel_profile = "flat";
sensitivity = 0; sensitivity = 0;
@@ -169,8 +190,7 @@ in
dwindle = { dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this preserve_split = true; # you probably want this
}; };
@@ -212,7 +232,8 @@ in
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste"; wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
grimblast = "${pkgs.grimblast}/bin/grimblast"; grimblast = "${pkgs.grimblast}/bin/grimblast";
saved-screenshot-cmd = ''${grimblast} --freeze save area $OUT && notify-send "Saved screenshot to $OUT" -h string:image-path:$OUT && echo "file://$(realpath $OUT)" | wl-copy -t text/uri-list saved-screenshot-cmd = ''
${grimblast} --freeze save area $OUT && notify-send "Saved screenshot to $OUT" -h string:image-path:$OUT && echo "file://$(realpath $OUT)" | wl-copy -t text/uri-list
''; '';
pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep";
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
@@ -241,10 +262,8 @@ in
''$mainMod, R, exec, hyprctl hyprpaper reload ,"$(ls -d ~/synced/default/dinge/Bg/* | shuf -n 1)"'' ''$mainMod, R, exec, hyprctl hyprpaper reload ,"$(ls -d ~/synced/default/dinge/Bg/* | shuf -n 1)"''
"$mainMod, W, exec, hyprctl hyprpaper reload ,${config.stylix.image}" "$mainMod, W, exec, hyprctl hyprpaper reload ,${config.stylix.image}"
" , Print, exec, hyprshade off && ${grimblast} --freeze copy area && hyprshade auto" " , Print, exec, hyprshade off && ${grimblast} --freeze copy area && hyprshade auto"
'' ''$mainMod, Print, exec, export OUT=/tmp/$(date +'%s_grim.png') && ${saved-screenshot-cmd}''
$mainMod, Print, exec, export OUT=/tmp/$(date +'%s_grim.png') && ${saved-screenshot-cmd}'' ''Shift_L, Print, exec, export OUT=~/Pictures/$(date +'%s_grim.png') && ${saved-screenshot-cmd}''
''
Shift_L, Print, exec, export OUT=~/Pictures/$(date +'%s_grim.png') && ${saved-screenshot-cmd}''
#"$mainMod, G, exec, ${peek}" # record gif #"$mainMod, G, exec, ${peek}" # record gif
"$mainMod, SPACE, exec, ${rofi} -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi" "$mainMod, SPACE, exec, ${rofi} -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi"
" , XF86AudioPlay, exec, ${playerctl} play-pause" " , XF86AudioPlay, exec, ${playerctl} play-pause"
@@ -359,12 +378,14 @@ in
"dex --autostart --environment Hyprland" "dex --autostart --environment Hyprland"
"${pkgs.hypridle}/bin/hypridle &" "${pkgs.hypridle}/bin/hypridle &"
#"${pkgs.dunst}/bin/dunst &" #"${pkgs.dunst}/bin/dunst &"
] ++ lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [ ]
++ lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [
"[workspace 9 silent] sleep 2 && discord" "[workspace 9 silent] sleep 2 && discord"
"[workspace 9 silent] sleep 2 && discordcanary" "[workspace 9 silent] sleep 2 && discordcanary"
"[workspace 10 silent] firefox" "[workspace 10 silent] firefox"
"xrandr --monitor ${monitor1} --primary" "xrandr --monitor ${monitor1} --primary"
] ++ [ ]
++ [
"sleep 3 && ${pkgs.waybar}/bin/waybar &" "sleep 3 && ${pkgs.waybar}/bin/waybar &"
"${restartPortals}" "${restartPortals}"
]; ];

View File

@@ -1,4 +1,11 @@
{ config, osConfig, pkgs, inputs, lib, ... }: {
config,
osConfig,
pkgs,
inputs,
lib,
...
}:
with lib; with lib;
let let
cfg = osConfig.custom.graphical.hyprland.videobridge; cfg = osConfig.custom.graphical.hyprland.videobridge;

View File

@@ -1,6 +1,15 @@
{ config, osConfig, pkgs, inputs, lib, ... }: {
let cfg = osConfig.custom.graphical.hyprland; config,
in { osConfig,
pkgs,
inputs,
lib,
...
}:
let
cfg = osConfig.custom.graphical.hyprland;
in
{
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.hyprlock.enable = true; programs.hyprlock.enable = true;
programs.hyprlock.settings = { programs.hyprlock.settings = {

View File

@@ -1,9 +1,15 @@
{ osConfig, pkgs, lib, ... }:
let cfg = osConfig.custom.graphical.hyprland;
in {
config = lib.mkIf cfg.enable
{ {
osConfig,
pkgs,
lib,
...
}:
let
cfg = osConfig.custom.graphical.hyprland;
in
{
config = lib.mkIf cfg.enable {
home.file.".config/hypr/hyprshade.toml".source = ../../.config/hypr/hyprshade.toml; home.file.".config/hypr/hyprshade.toml".source = ../../.config/hypr/hyprshade.toml;
wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.hyprshade}/bin/hyprshade auto" ]; wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.hyprshade}/bin/hyprshade auto" ];
systemd.user = { systemd.user = {
@@ -27,9 +33,14 @@ in {
Install.WantedBy = [ "timers.target" ]; Install.WantedBy = [ "timers.target" ];
Unit = { Description = "Apply screen filter on schedule"; }; Unit = {
Description = "Apply screen filter on schedule";
};
Timer.OnCalendar = [ "*-*-* 06:00:00" "*-*-* 19:00:00" ]; Timer.OnCalendar = [
"*-*-* 06:00:00"
"*-*-* 19:00:00"
];
}; };
}; };
}; };

View File

@@ -1,6 +1,15 @@
{ config, osConfig, pkgs, inputs, lib, ... }: {
let cfg = osConfig.custom.graphical.hyprland; config,
in { osConfig,
pkgs,
inputs,
lib,
...
}:
let
cfg = osConfig.custom.graphical.hyprland;
in
{
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
plugins = [ pkgs.hyprlandPlugins.hyprspace ]; plugins = [ pkgs.hyprlandPlugins.hyprspace ];
@@ -9,7 +18,8 @@ in {
"$mainMod, TAB, overview:toggle" "$mainMod, TAB, overview:toggle"
"$mainMod SHIFT, TAB, overview:toggle, all" "$mainMod SHIFT, TAB, overview:toggle, all"
]; ];
plugin = [{ plugin = [
{
overview = { overview = {
affectStrut = false; affectStrut = false;
hideTopLayers = true; hideTopLayers = true;
@@ -18,7 +28,8 @@ in {
showNewWorkspace = true; showNewWorkspace = true;
disableBlur = true; disableBlur = true;
}; };
}]; }
];
}; };
}; };
}; };

View File

@@ -1,7 +1,16 @@
{ config, osConfig, pkgs, inputs, lib, ... }: {
config,
osConfig,
pkgs,
inputs,
lib,
...
}:
with lib; with lib;
let cfg = osConfig.custom.graphical.hyprland; let
in { cfg = osConfig.custom.graphical.hyprland;
in
{
config = config =
let let
# styles from https://github.com/khaneliman/khanelinix/blob/8375f8cfbe5bfd87565b4dc34c9d30630c17336d/modules/home/desktop/addons/waybar/default.nix # styles from https://github.com/khaneliman/khanelinix/blob/8375f8cfbe5bfd87565b4dc34c9d30630c17336d/modules/home/desktop/addons/waybar/default.nix
@@ -37,25 +46,43 @@ in {
#"hyprland/window" #"hyprland/window"
]; ];
modules-center = [ ]; modules-center = [ ];
modules-right = [ "group/stats" "group/other" ]; modules-right = [
"group/stats"
"group/other"
];
"group/stats" = { "group/stats" = {
"orientation" = "horizontal"; "orientation" = "horizontal";
"modules" = [ "network" "cpu" "memory" "temperature" ] "modules" = [
"network"
"cpu"
"memory"
"temperature"
]
++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "custom/nvidia" ] ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "custom/nvidia" ]
++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "custom/amd-gpu" ] ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "custom/amd-gpu" ]
++ lib.optionals osConfig.services.power-profiles-daemon.enable [ "power-profiles-daemon" ]; ++ lib.optionals osConfig.services.power-profiles-daemon.enable [ "power-profiles-daemon" ];
}; };
"group/other" = { "group/other" = {
"orientation" = "horizontal"; "orientation" = "horizontal";
"modules" = "modules" = [
[ "tray" "backlight" "pulseaudio" "mpris" "battery" "clock" ]; "tray"
"backlight"
"pulseaudio"
"mpris"
"battery"
"clock"
];
}; };
"cpu" = { "cpu" = {
"format" = " {usage}%"; "format" = " {usage}%";
"tooltip" = true; "tooltip" = true;
}; };
"disk" = { "format" = " {percentage_used}%"; }; "disk" = {
"memory" = { "format" = "󰍛 {}%"; }; "format" = " {percentage_used}%";
};
"memory" = {
"format" = "󰍛 {}%";
};
"idle_inhibitor" = { "idle_inhibitor" = {
"format" = "{icon} "; "format" = "{icon} ";
@@ -95,7 +122,10 @@ in {
"phone" = ""; "phone" = "";
"portable" = ""; "portable" = "";
"car" = ""; "car" = "";
"default" = [ "" "" ]; "default" = [
""
""
];
}; };
"scroll-step" = 1; "scroll-step" = 1;
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
@@ -110,18 +140,30 @@ in {
"temperature".critical-threshold = 80; "temperature".critical-threshold = 80;
"temperature".format = "{temperatureC}°C "; "temperature".format = "{temperatureC}°C ";
"temperature".interval = 5; "temperature".interval = 5;
"temperature".hwmon-path = "temperature".hwmon-path = lib.mkIf (
lib.mkIf (osConfig.networking.hostName == "framework") osConfig.networking.hostName == "framework"
"/sys/class/hwmon/hwmon6/temp1_input"; ) "/sys/class/hwmon/hwmon6/temp1_input";
"backlight".format = "{percent}% {icon}"; "backlight".format = "{percent}% {icon}";
"backlight".states = [ 0 50 ]; "backlight".states = [
"backlight".format-icons = [ "" "" ]; 0
50
];
"backlight".format-icons = [
""
""
];
"battery".states.good = 95; "battery".states.good = 95;
"battery".interval = 5; "battery".interval = 5;
"battery".states.warning = 30; "battery".states.warning = 30;
"battery".states.critical = 15; "battery".states.critical = 15;
"battery".format = "{capacity}% / {power:.2}W {icon}"; "battery".format = "{capacity}% / {power:.2}W {icon}";
"battery".format-icons = [ "" "" "" "" "" ]; "battery".format-icons = [
""
""
""
""
""
];
"clock" = { "clock" = {
format = "{:%F %H:%M}"; format = "{:%F %H:%M}";
tooltip-format = "<tt><small>{calendar}</small></tt>"; tooltip-format = "<tt><small>{calendar}</small></tt>";
@@ -148,7 +190,9 @@ in {
"default" = ""; "default" = "";
"mpv" = "🎵"; "mpv" = "🎵";
}; };
"status-icons" = { "paused" = ""; }; "status-icons" = {
"paused" = "";
};
}; };
"power-profiles-daemon" = { "power-profiles-daemon" = {
"format" = "{icon}"; "format" = "{icon}";
@@ -217,8 +261,7 @@ in {
"class<firefox-beta>" = ""; "class<firefox-beta>" = "";
"class<firefox-developer-edition>" = ""; "class<firefox-developer-edition>" = "";
"class<firefox> title<.*github.*>" = ""; "class<firefox> title<.*github.*>" = "";
"class<firefox> title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = "class<firefox> title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = "";
"";
"class<kitty>" = ""; "class<kitty>" = "";
"class<org.wezfurlong.wezterm>" = ""; "class<org.wezfurlong.wezterm>" = "";
"class<mediainfo-gui>" = "󱂷"; "class<mediainfo-gui>" = "󱂷";
@@ -247,8 +290,7 @@ in {
}; };
}; };
}; };
style = style = "${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}";
"${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}";
}; };
}; };
} }

View File

@@ -1,6 +1,14 @@
{ osConfig, pkgs, config, lib, ... }: {
let cfg = osConfig.custom.graphical.i3; osConfig,
in { pkgs,
config,
lib,
...
}:
let
cfg = osConfig.custom.graphical.i3;
in
{
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.file.".config/i3" = { home.file.".config/i3" = {
recursive = true; recursive = true;
@@ -55,7 +63,9 @@ in {
module-margin = 1; module-margin = 1;
modules-left = "i3 xwindow"; modules-left = "i3 xwindow";
modules-center = ""; modules-center = "";
modules-right = [ "music network memory cpu cpu-wattage cpu-temp" ] modules-right = [
"music network memory cpu cpu-wattage cpu-temp"
]
++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "nvidia-gpu" ] ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "nvidia-gpu" ]
++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "amd-gpu" ] ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "amd-gpu" ]
++ [ "pulseaudio date tray" ]; ++ [ "pulseaudio date tray" ];
@@ -69,8 +79,10 @@ in {
# override-redirect = true; # override-redirect = true;
}; };
"module/i3" = "module/i3" =
let padding = 2; let
in { padding = 2;
in
{
type = "internal/i3"; type = "internal/i3";
pin-workspaces = true; pin-workspaces = true;
show-urgent = true; show-urgent = true;

View File

@@ -1,4 +1,10 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
{ {
programs.kitty = { programs.kitty = {
enable = true; enable = true;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
programs.lf = { programs.lf = {
enable = true; enable = true;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
programs.mpv = { programs.mpv = {
enable = true; enable = true;

View File

@@ -1,3 +1,5 @@
{ {
plugins.nvim-autopairs = { enable = true; }; plugins.nvim-autopairs = {
enable = true;
};
} }

View File

@@ -1 +1,5 @@
{ plugins.barbar = { enable = true; }; } # tab bar up top {
plugins.barbar = {
enable = true;
};
} # tab bar up top

View File

@@ -10,15 +10,25 @@
}; };
}; };
cmp-buffer = { enable = true; }; cmp-buffer = {
enable = true;
};
cmp-emoji = { enable = true; }; cmp-emoji = {
enable = true;
};
cmp-nvim-lsp = { enable = true; }; cmp-nvim-lsp = {
enable = true;
};
cmp-path = { enable = true; }; cmp-path = {
enable = true;
};
cmp_luasnip = { enable = true; }; cmp_luasnip = {
enable = true;
};
cmp = { cmp = {
enable = true; enable = true;
@@ -48,11 +58,29 @@
completion = { completion = {
scrollbar = true; scrollbar = true;
sidePadding = 0; sidePadding = 0;
border = [ "" "" "" "" "" "" "" "" ]; border = [
""
""
""
""
""
""
""
""
];
}; };
settings.documentation = { settings.documentation = {
border = [ "" "" "" "" "" "" "" "" ]; border = [
""
""
""
""
""
""
""
""
];
}; };
}; };
@@ -65,8 +93,7 @@
"<C-f>" = "cmp.mapping.scroll_docs(4)"; "<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()"; "<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()"; "<C-e>" = "cmp.mapping.close()";
"<CR>" = "<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false })";
"cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false })";
"<Tab>" = "<Tab>" =
# lua # lua
'' ''
@@ -96,7 +123,11 @@
}; };
formatting = { formatting = {
fields = [ "abbr" "kind" "menu" ]; fields = [
"abbr"
"kind"
"menu"
];
format = format =
# lua # lua
'' ''

View File

@@ -1,15 +1,25 @@
{ lib, pkgs, osConfig, ... }: {
lib,
pkgs,
osConfig,
...
}:
# https://nix-community.github.io/nixvim/NeovimOptions/index.html # https://nix-community.github.io/nixvim/NeovimOptions/index.html
let let
cfg = osConfig.custom.nixvimPlugins; cfg = osConfig.custom.nixvimPlugins;
args = { inherit lib pkgs; }; args = { inherit lib pkgs; };
importFile = file: importFile =
let config = import file; file:
in if builtins.isFunction config then config args else config; let
configs = map importFile ([ config = import file;
in
if builtins.isFunction config then config args else config;
configs = map importFile (
[
./config.nix ./config.nix
] ++ lib.optionals cfg [ ]
++ lib.optionals cfg [
./auto-pairs.nix ./auto-pairs.nix
./autosave.nix ./autosave.nix
./blankline.nix ./blankline.nix
@@ -36,12 +46,14 @@ let
./colorizer.nix ./colorizer.nix
./surround.nix ./surround.nix
./vimwiki.nix ./vimwiki.nix
]); ]
merged = );
builtins.foldl' (acc: elem: lib.recursiveUpdate acc elem) { } configs; merged = builtins.foldl' (acc: elem: lib.recursiveUpdate acc elem) { } configs;
in in
{ {
home.sessionVariables = { EDITOR = "nvim"; }; home.sessionVariables = {
EDITOR = "nvim";
};
home.packages = with pkgs; [ nixfmt-rfc-style ]; # nixd config option to set nixpkgs-fmt should work, but it doesn't home.packages = with pkgs; [ nixfmt-rfc-style ]; # nixd config option to set nixpkgs-fmt should work, but it doesn't
programs.nixvim = merged; programs.nixvim = merged;
} }

View File

@@ -1,7 +1,11 @@
{ {
plugins = { plugins = {
diffview = { enable = true; }; diffview = {
lazygit = { enable = true; }; enable = true;
};
lazygit = {
enable = true;
};
#neogit = { #neogit = {
# enable = true; # enable = true;
# settings.integrations = { diffview = true; }; # settings.integrations = { diffview = true; };

View File

@@ -1 +1,5 @@
{ plugins.lightline = { enable = true; }; } #status line at the bottom {
plugins.lightline = {
enable = true;
};
} # status line at the bottom

View File

@@ -9,10 +9,12 @@
cssls.enable = true; cssls.enable = true;
gopls.enable = true; gopls.enable = true;
clojure_lsp.enable = true; clojure_lsp.enable = true;
qmlls = qmlls = {
{
enable = true; enable = true;
settings.cmd = [ "qmlls" "-E" ]; settings.cmd = [
"qmlls"
"-E"
];
}; };
nixd = { nixd = {
enable = true; enable = true;

View File

@@ -2,7 +2,10 @@
plugins.render-markdown = { plugins.render-markdown = {
enable = true; enable = true;
settings = { settings = {
file_types = [ "markdown" "vimwiki"]; file_types = [
"markdown"
"vimwiki"
];
}; };
}; };
} }

View File

@@ -17,7 +17,6 @@
}; };
}; };
# default keybinds # default keybinds
# window = { # window = {
# mappings = { # mappings = {

View File

@@ -1,3 +1,5 @@
{ {
plugins = { refactoring.enable = true; }; plugins = {
refactoring.enable = true;
};
} }

View File

@@ -16,6 +16,8 @@
options.desc = "List buffers"; options.desc = "List buffers";
}; };
}; };
extensions.fzf-native = { enable = true; }; extensions.fzf-native = {
enable = true;
};
}; };
} }

View File

@@ -2,5 +2,7 @@
opts = { opts = {
timeoutlen = 500; timeoutlen = 500;
}; };
plugins.which-key = { enable = true; }; plugins.which-key = {
enable = true;
};
} }

View File

@@ -1,6 +1,10 @@
{ {
plugins.wilder = { plugins.wilder = {
enable = true; enable = true;
modes = [ ":" "/" "?" ]; modes = [
":"
"/"
"?"
];
}; };
} }

View File

@@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
home.file.".config/nvim" = { home.file.".config/nvim" = {
enable = true; enable = true;

View File

@@ -1,3 +1,13 @@
{ osConfig, pkgs, lib, inputs, ... }: {
let cfg = osConfig.custom.services.opensnitch; osConfig,
in { config = lib.mkIf cfg.enable { services.opensnitch-ui.enable = true; }; } pkgs,
lib,
inputs,
...
}:
let
cfg = osConfig.custom.services.opensnitch;
in
{
config = lib.mkIf cfg.enable { services.opensnitch-ui.enable = true; };
}

View File

@@ -1,8 +1,15 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
with config.stylix.fonts; with config.stylix.fonts;
let let
mkLiteral = name: "${name}"; mkLiteral = name: "${name}";
mkRgba = opacity: color: mkRgba =
opacity: color:
let let
c = config.lib.stylix.colors; c = config.lib.stylix.colors;
r = c."${color}-rgb-r"; r = c."${color}-rgb-r";
@@ -11,8 +18,7 @@ let
in in
"rgba ( ${r}, ${g}, ${b}, ${opacity} % )"; "rgba ( ${r}, ${g}, ${b}, ${opacity} % )";
mkRgb = mkRgba "100"; mkRgb = mkRgba "100";
rofiOpacity = rofiOpacity = builtins.toString (builtins.ceil (config.stylix.opacity.popups * 100));
builtins.toString (builtins.ceil (config.stylix.opacity.popups * 100));
rofiTheme = { rofiTheme = {
background = mkRgba rofiOpacity "base00"; background = mkRgba rofiOpacity "base00";
lightbg = mkRgba rofiOpacity "base01"; lightbg = mkRgba rofiOpacity "base01";
@@ -68,7 +74,9 @@ in
enable = true; enable = true;
text = '' text = ''
* { * {
${builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name}: ${value};") rofiTheme)} ${builtins.concatStringsSep "\n" (
lib.mapAttrsToList (name: value: "${name}: ${value};") rofiTheme
)}
} }
''; '';
}; };

View File

@@ -1,4 +1,10 @@
{ osConfig, pkgs, config, lib, ... }: {
osConfig,
pkgs,
config,
lib,
...
}:
let let
cfg = osConfig.custom.graphical.stylix; cfg = osConfig.custom.graphical.stylix;
base16 = config.stylix.base16Scheme; base16 = config.stylix.base16Scheme;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
home = { home = {
pointerCursor = { pointerCursor = {

View File

@@ -1,8 +1,14 @@
{ pkgs, config, osConfig, lib, ... }:
{ {
config = lib.mkIf osConfig.custom.hardware.vr.enable pkgs,
config,
osConfig,
lib,
...
}:
{ {
xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json"; config = lib.mkIf osConfig.custom.hardware.vr.enable {
xdg.configFile."openxr/1/active_runtime.json".source =
"${pkgs.monado}/share/openxr/1/openxr_monado.json";
xdg.configFile."openvr/openvrpaths.vrpath".text = '' xdg.configFile."openvr/openvrpaths.vrpath".text = ''
{ {
"config" : "config" :

View File

@@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: { {
config,
pkgs,
inputs,
...
}:
{
programs.fzf = { programs.fzf = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
@@ -18,11 +24,9 @@
}; };
shellAliases = { shellAliases = {
# TODO: gifsicle -O3 --lossy=30 noita-20240328-191617-1612416266-00316616.gif -o noita-20240328-191617-1612416266.gif # TODO: gifsicle -O3 --lossy=30 noita-20240328-191617-1612416266-00316616.gif -o noita-20240328-191617-1612416266.gif
backupNoita = backupNoita = "cp -r ~/.local/share/Steam/steamapps/compatdata/881100/pfx/drive_c/users/steamuser/AppData/LocalLow/Nolla_Games_Noita/* ~/synced/default/dont_remotebackup/noita_save";
"cp -r ~/.local/share/Steam/steamapps/compatdata/881100/pfx/drive_c/users/steamuser/AppData/LocalLow/Nolla_Games_Noita/* ~/synced/default/dont_remotebackup/noita_save";
checkTime = "(cd ~/synced/work_drive/TS && nix run)"; checkTime = "(cd ~/synced/work_drive/TS && nix run)";
checkWaylandWindowsKDE = checkWaylandWindowsKDE = "qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole";
"qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole";
collectGarbage = "nh clean all"; collectGarbage = "nh clean all";
edit = "cd ~/projects/github/nix-config && nvim ."; edit = "cd ~/projects/github/nix-config && nvim .";
ll = "ls -l"; ll = "ls -l";
@@ -36,14 +40,10 @@
dev = "nix-shell --run zsh"; dev = "nix-shell --run zsh";
rmt = "trash put"; rmt = "trash put";
bat = "bat -P --style plain"; bat = "bat -P --style plain";
cdf = cdf = "cd $(fd --type d --exclude node_modules --exclude bin --exclude target --exclude .cache . | fzf)";
"cd $(fd --type d --exclude node_modules --exclude bin --exclude target --exclude .cache . | fzf)"; cpu_performance = "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor";
cpu_performance = cpu_powersave = "echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor";
"echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; cpu_schedutil = "echo schedutil | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor";
cpu_powersave =
"echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor";
cpu_schedutil =
"echo schedutil | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor";
cpu_freq = ''watch -n 1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""''; cpu_freq = ''watch -n 1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""'';
gpu_monitor = "nvidia-smi dmon -s puct"; gpu_monitor = "nvidia-smi dmon -s puct";
nix-shell = "nix-shell --command zsh"; nix-shell = "nix-shell --command zsh";

View File

@@ -1,4 +1,11 @@
{ pkgs, modulesPath, config, lib, ... }: { {
pkgs,
modulesPath,
config,
lib,
...
}:
{
imports = [ imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix" "${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix"
]; ];
@@ -15,8 +22,7 @@
enable = true; enable = true;
enable32Bit = true; enable32Bit = true;
}; };
boot.kernelParams = boot.kernelParams = [ "nvidia-drm.fbdev=1" ];
[ "nvidia-drm.fbdev=1" ];
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = { hardware.nvidia = {

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: { {
config,
pkgs,
lib,
...
}:
{
services.postgresql = { services.postgresql = {
enable = true; enable = true;
extensions = with pkgs.postgresql14Packages; [ pg_libversion ]; extensions = with pkgs.postgresql14Packages; [ pg_libversion ];

View File

@@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
typst typst
]; ];

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.audio; cfg = config.custom.graphical.audio;

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.graphical.awesome; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.graphical.awesome;
in
{
options.custom.graphical.awesome = { options.custom.graphical.awesome = {
enable = lib.mkEnableOption "Enables awesome"; enable = lib.mkEnableOption "Enables awesome";
}; };

View File

@@ -1,7 +1,15 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
with lib; with lib;
let cfg = config.custom.graphical.basics; let
in { cfg = config.custom.graphical.basics;
in
{
options.custom.graphical.basics = { options.custom.graphical.basics = {
enable = mkEnableOption "Enables basics"; enable = mkEnableOption "Enables basics";
}; };

View File

@@ -1,7 +1,15 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
with lib; with lib;
let cfg = config.custom.graphical.code.android; let
in { cfg = config.custom.graphical.code.android;
in
{
options.custom.graphical.code.android = { options.custom.graphical.code.android = {
enable = mkEnableOption "Enables code"; enable = mkEnableOption "Enables code";
}; };
@@ -10,6 +18,9 @@ in {
documentation.dev.enable = true; documentation.dev.enable = true;
programs.adb.enable = true; programs.adb.enable = true;
environment.systemPackages = with pkgs; [ android-studio ]; environment.systemPackages = with pkgs; [ android-studio ];
users.users.${config.mainUser.name}.extraGroups = [ "adbusers" "kvm" ]; users.users.${config.mainUser.name}.extraGroups = [
"adbusers"
"kvm"
];
}; };
} }

View File

@@ -1,4 +1,10 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.code; cfg = config.custom.graphical.code;
@@ -12,7 +18,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
documentation.dev.enable = true; documentation.dev.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
man-pages man-pages
stable.jetbrains.idea-ultimate stable.jetbrains.idea-ultimate
typescript typescript
@@ -20,9 +28,11 @@ in
nodejs_22 # needed for tabby extension nodejs_22 # needed for tabby extension
python3 python3
gcc gcc
] ++ lib.optionals cfg.rider [ ]
++ lib.optionals cfg.rider [
pkgs.jetbrains.rider pkgs.jetbrains.rider
] ++ lib.optionals cfg.clion [ ]
++ lib.optionals cfg.clion [
pkgs.jetbrains.clion pkgs.jetbrains.clion
]; ];
@@ -31,4 +41,3 @@ in
#}; #};
}; };
} }

View File

@@ -1,4 +1,10 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
let let
cfg = config.custom.graphical.cosmic; cfg = config.custom.graphical.cosmic;
in in
@@ -13,7 +19,7 @@ in
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
}; };
services.desktopManager.cosmic.enable = true; services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = if (config.custom.graphical.sddm.enable == false) then true else false; services.displayManager.cosmic-greeter.enable =
if (config.custom.graphical.sddm.enable == false) then true else false;
}; };
} }

View File

@@ -1,4 +1,9 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
{ {
imports = [ imports = [

View File

@@ -1,4 +1,10 @@
{ lib, config, pkgs, inputs, ... }: {
lib,
config,
pkgs,
inputs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.emulators; cfg = config.custom.graphical.emulators;

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.games; cfg = config.custom.graphical.games;
@@ -22,12 +27,13 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.steam = { programs.steam = {
enable = true; enable = true;
remotePlay.openFirewall = remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
dedicatedServer.openFirewall =
true; # Open ports in the firewall for Source Dedicated Server
gamescopeSession.enable = true; gamescopeSession.enable = true;
extraCompatPackages = with pkgs; [ proton-ge-bin steamtinkerlaunch ]; extraCompatPackages = with pkgs; [
proton-ge-bin
steamtinkerlaunch
];
}; };
programs.gamemode = { programs.gamemode = {
enable = true; enable = true;
@@ -37,8 +43,15 @@ in
}; };
}; };
environment.systemPackages = with pkgs; [ mangohud lutris ] environment.systemPackages =
++ optionals cfg.enablePreinstalled (with pkgs; [ with pkgs;
[
mangohud
lutris
]
++ optionals cfg.enablePreinstalled (
with pkgs;
[
#taisei #taisei
#osu-lazer-bin #osu-lazer-bin
wineWowPackages.unstableFull wineWowPackages.unstableFull
@@ -49,7 +62,9 @@ in
tetrio-desktop tetrio-desktop
beyond-all-reason beyond-all-reason
#libs #libs
]) ++ optionals cfg.enableVr (with pkgs; [ bs-manager ]); ]
)
++ optionals cfg.enableVr (with pkgs; [ bs-manager ]);
}; };
} }

View File

@@ -1,9 +1,12 @@
{ config, lib, ... }: { config, lib, ... }:
let cfg = config.custom.graphical.gnome; let
in { cfg = config.custom.graphical.gnome;
in
{
# doesnt work for me.. nothing changes # doesnt work for me.. nothing changes
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.dconf.profiles.user.databases = [{ programs.dconf.profiles.user.databases = [
{
lockAll = true; lockAll = true;
settings = with lib.gvariant; { settings = with lib.gvariant; {
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {
@@ -16,22 +19,23 @@ in {
"org/gnome/desktop/wm/preferences" = { "org/gnome/desktop/wm/preferences" = {
resize-with-right-button = true; resize-with-right-button = true;
}; };
"org/gnome/desktop/sound" = { event-sounds = false; }; "org/gnome/desktop/sound" = {
"org/gnome/desktop/peripherals/mouse" = { accel-profile = "flat"; }; event-sounds = false;
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = };
{ "org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
name = "nautilus"; name = "nautilus";
command = "nautilus"; command = "nautilus";
binding = "<Super>e"; binding = "<Super>e";
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
{
name = "kitty super"; name = "kitty super";
command = "kitty"; command = "kitty";
binding = "<Super>q"; binding = "<Super>q";
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = {
{
binding = "<Alt>space"; binding = "<Alt>space";
command = "rofi -show combi"; command = "rofi -show combi";
name = "Open Rofi"; name = "Open Rofi";
@@ -71,9 +75,14 @@ in {
#move-to-monitor-right = [ "<Super><Shift>r" ]; #move-to-monitor-right = [ "<Super><Shift>r" ];
move-to-workspace-down = mkEmptyArray type.string; move-to-workspace-down = mkEmptyArray type.string;
move-to-workspace-up = mkEmptyArray type.string; move-to-workspace-up = mkEmptyArray type.string;
switch-to-workspace-down = switch-to-workspace-down = [
[ "<Primary><Super>Down" "<Primary><Super>j" ]; "<Primary><Super>Down"
switch-to-workspace-up = [ "<Primary><Super>Up" "<Primary><Super>k" ]; "<Primary><Super>j"
];
switch-to-workspace-up = [
"<Primary><Super>Up"
"<Primary><Super>k"
];
toggle-maximized = [ "<Super>f" ]; toggle-maximized = [ "<Super>f" ];
close = [ "<Alt>F4" ]; close = [ "<Alt>F4" ];
switch-to-workspace-1 = [ "<Super>1" ]; switch-to-workspace-1 = [ "<Super>1" ];
@@ -109,6 +118,7 @@ in {
switch-to-application-9 = mkEmptyArray type.string; switch-to-application-9 = mkEmptyArray type.string;
}; };
}; };
}]; }
];
}; };
} }

View File

@@ -1,16 +1,24 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let cfg = config.custom.graphical.gnome; let
in { cfg = config.custom.graphical.gnome;
options.custom.graphical.gnome = { enable = mkEnableOption "Enables gnome"; }; in
{
options.custom.graphical.gnome = {
enable = mkEnableOption "Enables gnome";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.xserver = { services.xserver = {
xkb.layout = config.mainUser.layout; xkb.layout = config.mainUser.layout;
xkb.variant = config.mainUser.variant; xkb.variant = config.mainUser.variant;
enable = true; enable = true;
displayManager.gdm.enable = displayManager.gdm.enable = lib.mkIf (!config.custom.graphical.sddm.enable) true;
lib.mkIf (!config.custom.graphical.sddm.enable) true;
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
}; };
@@ -21,7 +29,9 @@ in {
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.gnome.excludePackages = (with pkgs; [ environment.gnome.excludePackages = (
with pkgs;
[
gnome-photos gnome-photos
gnome-tour gnome-tour
cheese cheese
@@ -37,7 +47,8 @@ in {
iagno # go game iagno # go game
hitori # sudoku game hitori # sudoku game
atomix # puzzle game atomix # puzzle game
]); ]
);
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wmctrl wmctrl

View File

@@ -1,6 +1,14 @@
{ config, pkgs, lib, inputs, ... }: {
let cfg = config.custom.graphical.hyprland; config,
in { pkgs,
lib,
inputs,
...
}:
let
cfg = config.custom.graphical.hyprland;
in
{
options.custom.graphical.hyprland = { options.custom.graphical.hyprland = {
enable = lib.mkEnableOption "Enables hyprland"; enable = lib.mkEnableOption "Enables hyprland";
}; };
@@ -14,8 +22,7 @@ in {
xkb.variant = config.mainUser.variant; xkb.variant = config.mainUser.variant;
enable = true; enable = true;
}; };
services.displayManager.sddm.enable = services.displayManager.sddm.enable = !config.services.xserver.displayManager.gdm.enable;
!config.services.xserver.displayManager.gdm.enable;
nix.settings = { nix.settings = {
substituters = [ "https://hyprland.cachix.org" ]; substituters = [ "https://hyprland.cachix.org" ];
@@ -30,7 +37,9 @@ in {
pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-hyprland
]; ];
programs.hyprland = { enable = true; }; programs.hyprland = {
enable = true;
};
security.pam.services.hyprlock = { }; security.pam.services.hyprlock = { };
systemd = { systemd = {
@@ -41,8 +50,7 @@ in {
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 1; RestartSec = 1;
TimeoutStopSec = 10; TimeoutStopSec = 10;
@@ -73,8 +81,7 @@ in {
#xwayland #xwayland
(writeShellScriptBin "copyfiletoclip" '' (writeShellScriptBin "copyfiletoclip" ''
echo "file://$(realpath $1)" | wl-copy -t text/uri-list echo "file://$(realpath $1)" | wl-copy -t text/uri-list
'' '')
)
]; ];
}; };

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.graphical.i3; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.graphical.i3;
in
{
options = { options = {
custom.graphical.i3.enable = lib.mkOption { custom.graphical.i3.enable = lib.mkOption {
@@ -24,14 +31,18 @@ in {
}; };
services = { services = {
displayManager = { defaultSession = "none+i3"; }; displayManager = {
defaultSession = "none+i3";
};
xserver = { xserver = {
enable = true; enable = true;
xkb.layout = config.mainUser.layout; xkb.layout = config.mainUser.layout;
xkb.variant = config.mainUser.variant; xkb.variant = config.mainUser.variant;
desktopManager = { xterm.enable = false; }; desktopManager = {
xterm.enable = false;
};
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;
@@ -53,8 +64,7 @@ in {
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 1; RestartSec = 1;
TimeoutStopSec = 10; TimeoutStopSec = 10;

View File

@@ -1,8 +1,17 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let cfg = config.custom.graphical.ime; let
in { cfg = config.custom.graphical.ime;
options.custom.graphical.ime = { enable = mkEnableOption "Enables ime"; }; in
{
options.custom.graphical.ime = {
enable = mkEnableOption "Enables ime";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
i18n.inputMethod = { i18n.inputMethod = {

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.graphical.lightdm; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.graphical.lightdm;
in
{
options = { options = {
custom.graphical.lightdm.enable = lib.mkOption { custom.graphical.lightdm.enable = lib.mkOption {

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.lxqt; cfg = config.custom.graphical.lxqt;

View File

@@ -1,6 +1,13 @@
{ config, lib, pkgs, ... }: {
let cfg = config.custom.graphical.nightlight; config,
in { lib,
pkgs,
...
}:
let
cfg = config.custom.graphical.nightlight;
in
{
options.custom.graphical.nightlight = { options.custom.graphical.nightlight = {
enable = lib.mkEnableOption "Enables nightlight"; enable = lib.mkEnableOption "Enables nightlight";
}; };

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.graphical.niri; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.graphical.niri;
in
{
options = { options = {
custom.graphical.niri.enable = lib.mkOption { custom.graphical.niri.enable = lib.mkOption {
@@ -11,7 +18,9 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.niri = { enable = true; }; programs.niri = {
enable = true;
};
environment.systemPackages = with pkgs; [ xwayland-satellite ]; environment.systemPackages = with pkgs; [ xwayland-satellite ];
}; };
} }

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.custom.graphical.noise-supression; cfg = config.custom.graphical.noise-supression;
in in

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.obs; cfg = config.custom.graphical.obs;

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.openrgb; cfg = config.custom.graphical.openrgb;

View File

@@ -1,7 +1,14 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let cfg = config.custom.graphical.plasma; let
in { cfg = config.custom.graphical.plasma;
in
{
options.custom.graphical.plasma = { options.custom.graphical.plasma = {
enable = mkEnableOption "Enables plasma"; enable = mkEnableOption "Enables plasma";
}; };

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.graphical.sddm; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.graphical.sddm;
in
{
options = { options = {
custom.graphical.sddm.enable = lib.mkOption { custom.graphical.sddm.enable = lib.mkOption {

View File

@@ -1,7 +1,15 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
with lib; with lib;
let cfg = config.custom.graphical.shared; let
in { cfg = config.custom.graphical.shared;
in
{
options.custom.graphical.shared = { options.custom.graphical.shared = {
enable = mkEnableOption "Enables shared"; enable = mkEnableOption "Enables shared";
}; };
@@ -39,13 +47,18 @@ in {
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 53317 ]; # localsend allowedTCPPorts = [ 53317 ]; # localsend
allowedUDPPorts = [ 1194 53317 ]; # openvpn, localsend allowedUDPPorts = [
allowedTCPPortRanges = [{ 1194
53317
]; # openvpn, localsend
allowedTCPPortRanges = [
{
from = 1714; from = 1714;
to = 1764; to = 1764;
} # KDE Connect } # KDE Connect
]; ];
allowedUDPPortRanges = [{ allowedUDPPortRanges = [
{
from = 1714; from = 1714;
to = 1764; to = 1764;
} # KDE Connect } # KDE Connect

View File

@@ -1,6 +1,13 @@
{ lib, config, pkgs, ... }: {
let cfg = config.custom.graphical.stylix; lib,
in { config,
pkgs,
...
}:
let
cfg = config.custom.graphical.stylix;
in
{
options.custom.graphical.stylix = with lib; { options.custom.graphical.stylix = with lib; {
enable = mkEnableOption "Enables stylix"; enable = mkEnableOption "Enables stylix";
image = mkOption { image = mkOption {
@@ -11,7 +18,13 @@ in {
''; '';
}; };
base16Scheme = mkOption { base16Scheme = mkOption {
type = with lib.types; nullOr (oneOf [ path lines attrs ]); type =
with lib.types;
nullOr (oneOf [
path
lines
attrs
]);
default = null; default = null;
description = '' description = ''
The base16 scheme to use. The base16 scheme to use.

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.graphical.sway; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.graphical.sway;
in
{
options = { options = {
custom.graphical.sway.enable = lib.mkOption { custom.graphical.sway.enable = lib.mkOption {

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.graphical.xfce; cfg = config.custom.graphical.xfce;

View File

@@ -1,33 +1,53 @@
{ lib, config, pkgs, inputs, pkgsVersion, ... }: {
let cfg = config.custom.hardware.amd-gpu; lib,
in { config,
pkgs,
inputs,
pkgsVersion,
...
}:
let
cfg = config.custom.hardware.amd-gpu;
in
{
options.custom.hardware.amd-gpu = { options.custom.hardware.amd-gpu = {
enable = lib.mkEnableOption "Enables amd gpus"; enable = lib.mkEnableOption "Enables amd gpus";
overdrive = lib.mkEnableOption "Enables overdrive"; overdrive = lib.mkEnableOption "Enables overdrive";
rocm.enable = lib.mkEnableOption "Enables rocm"; rocm.enable = lib.mkEnableOption "Enables rocm";
}; };
config = config = lib.mkIf cfg.enable {
lib.mkIf cfg.enable { boot.kernelParams = lib.mkIf cfg.overdrive [
boot.kernelParams = lib.mkIf cfg.overdrive "amdgpu.ppfeaturemask=0xfff7ffff"
[ "amdgpu.ppfeaturemask=0xfff7ffff" "split_lock_detect=off" ]; "split_lock_detect=off"
];
hardware.graphics = { hardware.graphics = {
enable = true; enable = true;
enable32Bit = true; enable32Bit = true;
extraPackages = lib.mkIf cfg.rocm.enable (with pkgs; [ rocmPackages.clr rocmPackages.clr.icd ]); extraPackages = lib.mkIf cfg.rocm.enable (
with pkgs;
[
rocmPackages.clr
rocmPackages.clr.icd
]
);
}; };
hardware.amdgpu.initrd.enable = lib.mkDefault true; hardware.amdgpu.initrd.enable = lib.mkDefault true;
services.xserver.videoDrivers = [ "amdgpu" ]; services.xserver.videoDrivers = [ "amdgpu" ];
# controller (overclock, undervolt, fan curves) # controller (overclock, undervolt, fan curves)
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
nvtopPackages.amd nvtopPackages.amd
amdgpu_top amdgpu_top
] ++ lib.optionals cfg.rocm.enable [ ]
++ lib.optionals cfg.rocm.enable [
clinfo clinfo
rocmPackages.rocminfo rocmPackages.rocminfo
] ++ lib.optionals cfg.overdrive [ ]
++ lib.optionals cfg.overdrive [
lact lact
]; ];
systemd = { systemd = {
@@ -45,8 +65,7 @@ in {
]; ];
}; };
in in
lib.mkIf cfg.rocm.enable lib.mkIf cfg.rocm.enable [
[
"L+ /opt/rocm - - - - ${rocmEnv}" "L+ /opt/rocm - - - - ${rocmEnv}"
]; ];
}; };

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.hardware.android; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.hardware.android;
in
{
options.custom.hardware.android = { options.custom.hardware.android = {
enable = lib.mkEnableOption "Enables android phone support"; enable = lib.mkEnableOption "Enables android phone support";
}; };

View File

@@ -1,4 +1,5 @@
{ pkgs, config, ... }: { { pkgs, config, ... }:
{
imports = [ imports = [
./amd-gpu.nix ./amd-gpu.nix
./android.nix ./android.nix

View File

@@ -1,6 +1,13 @@
{ config, pkgs, lib, ... }: {
let cfg = config.custom.hardware.fingerprint; config,
in { pkgs,
lib,
...
}:
let
cfg = config.custom.hardware.fingerprint;
in
{
options.custom.hardware.fingerprint = { options.custom.hardware.fingerprint = {
enable = lib.mkEnableOption "Enables fingerprint sensor support"; enable = lib.mkEnableOption "Enables fingerprint sensor support";
}; };

View File

@@ -12,4 +12,3 @@ in
services.fwupd.enable = true; services.fwupd.enable = true;
}; };
} }

View File

@@ -1,6 +1,15 @@
{ lib, config, pkgs, inputs, pkgsVersion, ... }: {
let cfg = config.custom.hardware.nvidia; lib,
in { config,
pkgs,
inputs,
pkgsVersion,
...
}:
let
cfg = config.custom.hardware.nvidia;
in
{
options.custom.hardware.nvidia = { options.custom.hardware.nvidia = {
enable = lib.mkEnableOption "Enables nvidia gpus"; enable = lib.mkEnableOption "Enables nvidia gpus";
powerLimit = { powerLimit = {
@@ -32,13 +41,16 @@ in {
let let
# the option was renamed in unstable # the option was renamed in unstable
nvidiaOption = nvidiaOption =
if (pkgsVersion == inputs.nixpkgs-unstable) then { if (pkgsVersion == inputs.nixpkgs-unstable) then
{
hardware.graphics = { hardware.graphics = {
enable = true; enable = true;
enable32Bit = true; enable32Bit = true;
extraPackages = with pkgs; [ nvidia-vaapi-driver ]; extraPackages = with pkgs; [ nvidia-vaapi-driver ];
}; };
} else { }
else
{
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
@@ -47,9 +59,12 @@ in {
}; };
nvidia_oc = "${pkgs.nvidia_oc}/bin/nvidia_oc"; nvidia_oc = "${pkgs.nvidia_oc}/bin/nvidia_oc";
in in
lib.mkIf cfg.enable (lib.recursiveUpdate nvidiaOption { lib.mkIf cfg.enable (
boot.kernelParams = lib.recursiveUpdate nvidiaOption {
[ "nvidia-drm.fbdev=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; boot.kernelParams = [
"nvidia-drm.fbdev=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
];
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.deviceSection = '' services.xserver.deviceSection = ''
Option "Coolbits" "24" Option "Coolbits" "24"
@@ -103,22 +118,17 @@ in {
}; };
systemd.services.nvidiaSetPower = lib.mkIf cfg.powerLimit.enable { systemd.services.nvidiaSetPower = lib.mkIf cfg.powerLimit.enable {
description = description = "Increase GPU power limit to ${toString cfg.powerLimit.wattage} watts";
"Increase GPU power limit to ${toString cfg.powerLimit.wattage} watts"; script = "/run/current-system/sw/bin/nvidia-smi -pl=${toString cfg.powerLimit.wattage}";
script = "/run/current-system/sw/bin/nvidia-smi -pl=${
toString cfg.powerLimit.wattage
}";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
}; };
systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable { systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable {
description = "Set GPU clocks"; description = "Set GPU clocks";
script = script = "${nvidia_oc} set -i 0 --min-clock ${toString cfg.clock.min} --max-clock ${toString cfg.clock.max} --freq-offset ${toString cfg.clock.offset}";
"${nvidia_oc} set -i 0 --min-clock ${toString cfg.clock.min} --max-clock ${
toString cfg.clock.max
} --freq-offset ${toString cfg.clock.offset}";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; after = [ "network.target" ];
}; };
}); }
);
} }

View File

@@ -1,4 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
boot = { boot = {
extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; extraModulePackages = with config.boot.kernelPackages; [ zenpower ];

View File

@@ -16,4 +16,3 @@ in
hardware.system76.enableAll = true; hardware.system76.enableAll = true;
}; };
} }

View File

@@ -12,4 +12,3 @@ in
services.fstrim.enable = true; services.fstrim.enable = true;
}; };
} }

View File

@@ -1,7 +1,14 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
with lib; with lib;
let cfg = config.custom.hardware.tablet; let
in { cfg = config.custom.hardware.tablet;
in
{
options.custom.hardware.tablet = { options.custom.hardware.tablet = {
enable = mkEnableOption "Enables tablet"; enable = mkEnableOption "Enables tablet";
}; };

View File

@@ -1,8 +1,17 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
with lib; with lib;
let cfg = config.custom.hardware.tpm; let
in { cfg = config.custom.hardware.tpm;
options.custom.hardware.tpm = { enable = mkEnableOption "Enables tpm"; }; in
{
options.custom.hardware.tpm = {
enable = mkEnableOption "Enables tpm";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
with lib; with lib;
let let
cfg = config.custom.hardware.vfio; cfg = config.custom.hardware.vfio;
@@ -15,9 +20,24 @@ in
config = mkIf (cfg.enable && config.virtualisation.libvirtd.enable) { config = mkIf (cfg.enable && config.virtualisation.libvirtd.enable) {
boot = { boot = {
kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" ]; kernelModules = [
kernelParams = [ "amd_iommu=on" "iommu=pt" ] ++ (if cfg.stub_pci != [] then [ "vfio-pci.ids=${concatStringsSep "," cfg.stub_pci}" ] else []); "vfio"
blacklistedKernelModules = [ "nouveau" "nvidia" "nvidiafb" "nvidia-drm" "nvidia-uvm" "nvidia-modeset" ]; "vfio_iommu_type1"
"vfio_pci"
];
kernelParams = [
"amd_iommu=on"
"iommu=pt"
]
++ (if cfg.stub_pci != [ ] then [ "vfio-pci.ids=${concatStringsSep "," cfg.stub_pci}" ] else [ ]);
blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidiafb"
"nvidia-drm"
"nvidia-uvm"
"nvidia-modeset"
];
}; };
}; };
} }

View File

@@ -1,16 +1,27 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
let let
cfg = config.custom.hardware.vr; cfg = config.custom.hardware.vr;
# https://wiki.nixos.org/wiki/VR#Patching_AMDGPU_to_allow_high_priority_queues # https://wiki.nixos.org/wiki/VR#Patching_AMDGPU_to_allow_high_priority_queues
amdgpu = amdgpu =
{ pkgs {
, lib pkgs,
, kernel ? pkgs.linuxPackages_latest.kernel lib,
kernel ? pkgs.linuxPackages_latest.kernel,
}: }:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
pname = "amdgpu-kernel-module"; pname = "amdgpu-kernel-module";
inherit (kernel) src version postPatch nativeBuildInputs; inherit (kernel)
src
version
postPatch
nativeBuildInputs
;
kernel_dev = kernel.dev; kernel_dev = kernel.dev;
kernelVersion = kernel.modDirVersion; kernelVersion = kernel.modDirVersion;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
with lib; with lib;
let let
cfg = config.custom.hardware.wooting; cfg = config.custom.hardware.wooting;

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, inputs, ... }: {
config,
pkgs,
lib,
inputs,
...
}:
with lib; with lib;
let let
cfg = config.custom.misc.backup; cfg = config.custom.misc.backup;
@@ -22,7 +28,15 @@ in
}; };
excludePaths = lib.mkOption { excludePaths = lib.mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ "**/Cache" "**/.cache" "**/__pycache__" "**/node_modules" "**/venv" "*.o" "*.out" ]; default = [
"**/Cache"
"**/.cache"
"**/__pycache__"
"**/node_modules"
"**/venv"
"*.o"
"*.out"
];
description = "paths to exclude from the backup"; description = "paths to exclude from the backup";
}; };
excludePathsRemote = lib.mkOption { excludePathsRemote = lib.mkOption {
@@ -39,17 +53,29 @@ in
text = '' text = ''
# Check how much space is used by the backup paths # Check how much space is used by the backup paths
echo "Checking storage space (small) with excluded paths..." echo "Checking storage space (small) with excluded paths..."
du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)} ${builtins.concatStringsSep " " cfg.small} du -sch ${
builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)
} ${builtins.concatStringsSep " " cfg.small}
echo "Checking storage space (small) with excluded paths (remote)..." echo "Checking storage space (small) with excluded paths (remote)..."
du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)} ${builtins.concatStringsSep " " cfg.small} du -sch ${
builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)
} ${builtins.concatStringsSep " " cfg.small}
echo "Checking storage space (medium) with excluded paths..." echo "Checking storage space (medium) with excluded paths..."
du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)} ${builtins.concatStringsSep " " cfg.medium} du -sch ${
builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)
} ${builtins.concatStringsSep " " cfg.medium}
echo "Checking storage space (medium) with excluded paths (remote)..." echo "Checking storage space (medium) with excluded paths (remote)..."
du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)} ${builtins.concatStringsSep " " cfg.medium} du -sch ${
builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)
} ${builtins.concatStringsSep " " cfg.medium}
echo "Checking storage space (full) with excluded paths..." echo "Checking storage space (full) with excluded paths..."
du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)} ${builtins.concatStringsSep " " cfg.large} du -sch ${
builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)
} ${builtins.concatStringsSep " " cfg.large}
echo "Checking storage space (full) with excluded paths (remote)..." echo "Checking storage space (full) with excluded paths (remote)..."
du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)} ${builtins.concatStringsSep " " cfg.large} du -sch ${
builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)
} ${builtins.concatStringsSep " " cfg.large}
''; '';
}; };
cli = "${pkgs.internxt-cli}/bin/internxt"; cli = "${pkgs.internxt-cli}/bin/internxt";
@@ -94,7 +120,11 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
environment.systemPackages = [ checkStorageSpace startInternxtWebdav stopInternxtWebdav ]; environment.systemPackages = [
checkStorageSpace
startInternxtWebdav
stopInternxtWebdav
];
age.secrets.restic-pw = { age.secrets.restic-pw = {
file = ../../secrets/restic-pw.age; file = ../../secrets/restic-pw.age;
}; };
@@ -126,7 +156,12 @@ in
OnCalendar = "04:00"; OnCalendar = "04:00";
Persistent = true; Persistent = true;
}; };
pruneOpts = [ "--keep-daily 7" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; pruneOpts = [
"--keep-daily 7"
"--keep-weekly 3"
"--keep-monthly 3"
"--keep-yearly 3"
];
repository = "/1tbssd/restic"; repository = "/1tbssd/restic";
}; };
#localbackup-1tb = { #localbackup-1tb = {
@@ -148,7 +183,12 @@ in
paths = cfg.medium; paths = cfg.medium;
rcloneConfigFile = config.age.secrets.restic-gdrive.path; rcloneConfigFile = config.age.secrets.restic-gdrive.path;
repository = "rclone:it-experts:backup"; repository = "rclone:it-experts:backup";
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; pruneOpts = [
"--keep-daily 5"
"--keep-weekly 3"
"--keep-monthly 3"
"--keep-yearly 3"
];
timerConfig = { timerConfig = {
OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00";
Persistent = true; Persistent = true;
@@ -160,14 +200,23 @@ in
environmentFile = config.age.secrets.restic-s3.path; environmentFile = config.age.secrets.restic-s3.path;
exclude = cfg.excludePathsRemote; exclude = cfg.excludePathsRemote;
paths = cfg.small; paths = cfg.small;
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; pruneOpts = [
"--keep-daily 5"
"--keep-weekly 3"
"--keep-monthly 3"
"--keep-yearly 3"
];
timerConfig = { timerConfig = {
OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00";
Persistent = true; Persistent = true;
}; };
repository = "s3:s3.us-west-002.backblazeb2.com/kop-bucket"; repository = "s3:s3.us-west-002.backblazeb2.com/kop-bucket";
}; };
remotebackup-large = let cli = "${pkgs.internxt-cli}/bin/internxt"; in { remotebackup-large =
let
cli = "${pkgs.internxt-cli}/bin/internxt";
in
{
initialize = true; initialize = true;
passwordFile = config.age.secrets.restic-pw.path; passwordFile = config.age.secrets.restic-pw.path;
environmentFile = config.age.secrets.restic-internxt.path; environmentFile = config.age.secrets.restic-internxt.path;
@@ -179,7 +228,12 @@ in
backupCleanupCommand = '' backupCleanupCommand = ''
${stopInternxtWebdav} ${stopInternxtWebdav}
''; '';
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; pruneOpts = [
"--keep-daily 5"
"--keep-weekly 3"
"--keep-monthly 3"
"--keep-yearly 3"
];
timerConfig = { timerConfig = {
OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00";
Persistent = true; Persistent = true;
@@ -188,7 +242,9 @@ in
type = "webdav"; type = "webdav";
url = "https://127.0.0.1:3005"; url = "https://127.0.0.1:3005";
}; };
rcloneOptions = { "no-check-certificate" = true; }; rcloneOptions = {
"no-check-certificate" = true;
};
repository = "rclone:internxt:backup"; repository = "rclone:internxt:backup";
}; };
}; };

View File

@@ -12,4 +12,3 @@ in
services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.enable = true;
}; };
} }

View File

@@ -1,8 +1,18 @@
{ lib, config, pkgs, inputs, ... }: {
lib,
config,
pkgs,
inputs,
...
}:
with lib; with lib;
let cfg = config.custom.cli-tools; let
in { cfg = config.custom.cli-tools;
options.custom.cli-tools = { enable = mkEnableOption "Enables cli-tools"; }; in
{
options.custom.cli-tools = {
enable = mkEnableOption "Enables cli-tools";
};
config = config =
let let
@@ -48,10 +58,7 @@ in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
getTotalPowerUsed getTotalPowerUsed
watchCurrentPowerUsed watchCurrentPowerUsed
(if lib.versionOlder lib.version "25.05" then (if lib.versionOlder lib.version "25.05" then wget else powerjoular) # monitor power usage
wget
else
powerjoular) # monitor power usage
bat # fancy cat bat # fancy cat
fd # nicer find fd # nicer find
duf # nicer du duf # nicer du

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, inputs, ... }: {
config,
pkgs,
lib,
inputs,
...
}:
with lib; with lib;
let let
cfg = config.custom.misc.docker; cfg = config.custom.misc.docker;
@@ -9,7 +15,9 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
virtualisation.docker.daemon.settings = { ip = "127.0.0.1"; }; virtualisation.docker.daemon.settings = {
ip = "127.0.0.1";
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
docker-compose docker-compose
]; ];

View File

@@ -1,11 +1,15 @@
{ lib, pkgs, config, ... }: { {
lib,
pkgs,
config,
...
}:
{
# before: Startup finished in 18.830s (firmware) + 5.844s (loader) + 4.422s (kernel) + 7.616s (userspace) = 36.713s # before: Startup finished in 18.830s (firmware) + 5.844s (loader) + 4.422s (kernel) + 7.616s (userspace) = 36.713s
# after: Startup finished in 14.115s (firmware) + 789ms (loader) + 4.312s (kernel) + 5.777s (userspace) = 24.995s # after: Startup finished in 14.115s (firmware) + 789ms (loader) + 4.312s (kernel) + 5.777s (userspace) = 24.995s
systemd = { systemd = {
targets.network-online.wantedBy = targets.network-online.wantedBy = lib.mkForce [ ]; # Normally ["multi-user.target"]
lib.mkForce [ ]; # Normally ["multi-user.target"] services.NetworkManager-wait-online.wantedBy = lib.mkForce [ ]; # Normally ["network-online.target"]
services.NetworkManager-wait-online.wantedBy =
lib.mkForce [ ]; # Normally ["network-online.target"]
}; };
# mash spacebar to still be able to select a different boot option # mash spacebar to still be able to select a different boot option
boot.loader.timeout = 1; boot.loader.timeout = 1;

View File

@@ -1,7 +1,14 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
let cfg = config.custom.misc.firejail; let
in { cfg = config.custom.misc.firejail;
in
{
options.custom.misc.firejail = { options.custom.misc.firejail = {
enable = lib.mkEnableOption "Enables firejail"; enable = lib.mkEnableOption "Enables firejail";
package = lib.mkOption { package = lib.mkOption {
@@ -13,12 +20,17 @@ in {
mk = lib.mkOption { mk = lib.mkOption {
readOnly = true; readOnly = true;
description = "Utility function to make a wrappedBinaries entry"; description = "Utility function to make a wrappedBinaries entry";
default = name: default =
{ pkg, profile ? name, bin ? name }: { name:
{
pkg,
profile ? name,
bin ? name,
}:
{
${bin} = { ${bin} = {
executable = "${lib.getBin pkg}/bin/${bin}"; executable = "${lib.getBin pkg}/bin/${bin}";
profile = profile = "${config.custom.misc.firejail.package}/etc/firejail/${profile}.profile";
"${config.custom.misc.firejail.package}/etc/firejail/${profile}.profile";
}; };
}; };
}; };

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
let let
#amdgpu_module_pkg = #amdgpu_module_pkg =
# { pkgs, lib, fetchurl, kernel ? pkgs.linuxPackages_latest.kernel, ... }: # { pkgs, lib, fetchurl, kernel ? pkgs.linuxPackages_latest.kernel, ... }:
@@ -46,22 +51,26 @@ let
# amdgpu_module = pkgs.callPackage amdgpu_module_pkg { # amdgpu_module = pkgs.callPackage amdgpu_module_pkg {
# kernel = config.boot.kernelPackages.kernel; # kernel = config.boot.kernelPackages.kernel;
# }; # };
amd_drm_next_pkg = { fetchurl, buildLinux, ... }@args: amd_drm_next_pkg =
{ fetchurl, buildLinux, ... }@args:
buildLinux (args // rec { buildLinux (
args
// rec {
version = "6.14.0-rc6"; version = "6.14.0-rc6";
modDirVersion = version; modDirVersion = version;
src = fetchurl { src = fetchurl {
url = url = "https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-fixes-6.15-2025-04-09/linux-amd-drm-fixes-6.15-2025-04-09.tar.gz";
"https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-fixes-6.15-2025-04-09/linux-amd-drm-fixes-6.15-2025-04-09.tar.gz";
#"https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-next-6.15-2025-03-21/linux-amd-drm-next-6.15-2025-03-21.tar.gz"; #"https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-next-6.15-2025-03-21/linux-amd-drm-next-6.15-2025-03-21.tar.gz";
hash = "sha256-AhyDuV9KufqDJEJ+Fp+jnAta3OM/a9OcMNG9UV+OgR0="; hash = "sha256-AhyDuV9KufqDJEJ+Fp+jnAta3OM/a9OcMNG9UV+OgR0=";
}; };
kernelPatches = [ ]; kernelPatches = [ ];
extraMeta.branch = "6.14.0-rc6"; extraMeta.branch = "6.14.0-rc6";
} // (args.argsOverride or { })); }
// (args.argsOverride or { })
);
linux_amd_drm_next = pkgs.callPackage amd_drm_next_pkg { }; linux_amd_drm_next = pkgs.callPackage amd_drm_next_pkg { };
linux_6_14 = pkgs.buildLinux { linux_6_14 = pkgs.buildLinux {

View File

@@ -12,4 +12,3 @@ in
networking.nftables.enable = true; networking.nftables.enable = true;
}; };
} }

View File

@@ -1,6 +1,14 @@
{ lib, config, pkgs, inputs, ... }: {
lib,
config,
pkgs,
inputs,
...
}:
with lib; with lib;
let cfg = config.custom.nixvimPlugins; let
in { cfg = config.custom.nixvimPlugins;
in
{
options.custom.nixvimPlugins = mkEnableOption "Enables nixvim plugins"; options.custom.nixvimPlugins = mkEnableOption "Enables nixvim plugins";
} }

View File

@@ -1,9 +1,9 @@
{ config, pkgs, ... }: { { config, pkgs, ... }:
{
environment.etc."current-system-packages".text = environment.etc."current-system-packages".text =
let let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages; packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique; formatted = builtins.concatStringsSep "\n" sortedUnique;
in in
formatted; formatted;

View File

@@ -1,8 +1,17 @@
{ pkgs, lib, config, ... }: {
let cfg = config.custom.misc.podman; pkgs,
in { lib,
config,
...
}:
let
cfg = config.custom.misc.podman;
in
{
options = { options = {
custom.misc.podman = { enable = lib.mkEnableOption "Enable podman service"; }; custom.misc.podman = {
enable = lib.mkEnableOption "Enable podman service";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Enable common container config files in /etc/containers # Enable common container config files in /etc/containers

View File

@@ -1,7 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let cfg = config.custom.static-ip; let
in { cfg = config.custom.static-ip;
in
{
options.custom.static-ip = { options.custom.static-ip = {
enable = mkEnableOption "Enables static-ip"; enable = mkEnableOption "Enables static-ip";
ip = lib.mkOption { ip = lib.mkOption {
@@ -23,20 +25,23 @@ in {
}; };
}; };
config = config =
let fallback = "1.1.1.1"; let
in mkIf cfg.enable { fallback = "1.1.1.1";
in
mkIf cfg.enable {
networking = { networking = {
defaultGateway = cfg.gateway; defaultGateway = cfg.gateway;
useDHCP = false; useDHCP = false;
nameservers = [ cfg.dns ] nameservers = [ cfg.dns ] ++ lib.lists.optionals (!config.services.resolved.enable) [ fallback ];
++ lib.lists.optionals (!config.services.resolved.enable) [ fallback ];
interfaces = { interfaces = {
${cfg.interface} = { ${cfg.interface} = {
name = "eth0"; name = "eth0";
ipv4.addresses = [{ ipv4.addresses = [
{
address = cfg.ip; address = cfg.ip;
prefixLength = 24; prefixLength = 24;
}]; }
];
}; };
}; };
}; };

View File

@@ -12,4 +12,3 @@ in
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
}; };
} }

View File

@@ -1,14 +1,20 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let cfg = config.custom.virt-manager; let
in { cfg = config.custom.virt-manager;
in
{
options.custom.virt-manager = { options.custom.virt-manager = {
enable = mkEnableOption "Enables virt-manager"; enable = mkEnableOption "Enables virt-manager";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.dconf.enable = programs.dconf.enable = true; # virt-manager requires dconf to remember settings
true; # virt-manager requires dconf to remember settings
environment.systemPackages = with pkgs; [ virtiofsd ]; environment.systemPackages = with pkgs; [ virtiofsd ];
environment.sessionVariables.GSETTINGS_BACKEND = "keyfile"; environment.sessionVariables.GSETTINGS_BACKEND = "keyfile";
boot.extraModprobeConfig = '' boot.extraModprobeConfig = ''
@@ -25,19 +31,31 @@ in {
}; };
hooks.qemu = { hooks.qemu = {
# doesnt work, screen just freezes. no error in libvirt logs though, so idk how to fix it # doesnt work, screen just freezes. no error in libvirt logs though, so idk how to fix it
"passthrough" = lib.getExe (pkgs.writeShellApplication { "passthrough" = lib.getExe (
pkgs.writeShellApplication {
name = "qemu-hook"; name = "qemu-hook";
excludeShellChecks = [ "SC2046" "SC2086" ]; excludeShellChecks = [
"SC2046"
"SC2086"
];
runtimeInputs = with pkgs; [ libvirt systemd kmod ]; runtimeInputs = with pkgs; [
libvirt
systemd
kmod
];
text = builtins.readFile ./hook.sh; text = builtins.readFile ./hook.sh;
}); }
);
}; };
}; };
spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = true;
}; };
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = true;
users.users.${config.mainUser.name}.extraGroups = users.users.${config.mainUser.name}.extraGroups = [
[ "libvirtd" "kvm" "input" ]; "libvirtd"
"kvm"
"input"
];
}; };
} }

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.custom.wireshark; cfg = config.custom.wireshark;
@@ -15,4 +20,3 @@ in
users.users.${config.mainUser.name}.extraGroups = [ "wireshark" ]; users.users.${config.mainUser.name}.extraGroups = [ "wireshark" ];
}; };
} }

View File

@@ -1,4 +1,10 @@
{ pkgs, lib, config, ... }: { {
pkgs,
lib,
config,
...
}:
{
zramSwap = { zramSwap = {
enable = true; enable = true;
}; };

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