Compare commits

..

No commits in common. "1110694a3a33bd64f4866e6198cece50f3dee185" and "ed1c53e94c8b58182e0638f6c8964722e4521356" have entirely different histories.

25 changed files with 1151 additions and 1266 deletions

View File

@ -1,10 +1,6 @@
{ config, pkgs, lib, options, ... }:
{ {
config,
pkgs,
lib,
options,
...
}: {
imports = [ ./modules ]; imports = [ ./modules ];
config = { config = {

View File

@ -59,11 +59,7 @@
}; };
}; };
outputs = { outputs = { self, nixpkgs, ... }@inputs: {
self,
nixpkgs,
...
} @ inputs: {
nixosModules = { nixosModules = {
ezpassthru = import ./modules/ezpassthru.nix; ezpassthru = import ./modules/ezpassthru.nix;
ezwg = import ./modules/ezwg.nix; ezwg = import ./modules/ezwg.nix;

View File

@ -1,9 +1,7 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib,
pkgs, {
...
}: {
imports = [ (import ./modules inputs) ]; imports = [ (import ./modules inputs) ];
programs.direnv = { programs.direnv = {
@ -94,58 +92,4 @@ inputs: {
eval (${pkgs.direnv}/bin/direnv hook fish) eval (${pkgs.direnv}/bin/direnv hook fish)
''; '';
}; };
programs.firefox = {
package = lib.mkDefault (librewolf.override {
cfg = {
enableGnomeExtensions = true;
pipewireSupport = true;
};
});
extensions = lib.optionals (pkgs ? nur.repos.rycee.firefox-addons) (with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
bitwarden
violentmonkey
canvasblocker
sponsorblock
stylus
vimium
]);
profiles.default = {
settings = {
"browser.startup.homepage" = "https://wizbos.club";
# Make the browser usable, if I wanted autism privacy, I would use TOR browser.
"privacy.resistFingerprinting" = false;
"webgl.disabled" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
"privacy.clearOnShutdown.sessions" = false;
"privacy.clearOnShutdown.cache" = false;
"places.history.enabled" = true;
"network.dns.disableIPv6" = false;
"media.peerconnection.ice.no_host" = false;
# Make Jitsi work sanely
"media.setsinkid.enabled" = true;
"privacy.webrtc.legacyGlobalIndicator" = false;
"privacy.webrtc.hideGlobalIndicator" = true;
# good tweaks
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"layers.acceleration.force-enabled" = true;
"gfx.webrender.all" = true;
"svg.context-properties.content.enabled" = true;
"reader.color_scheme" = "dark";
# # LibreWolf ruins the user agent making sites unusable without RFP, so use the user agent from RFP manually. This also seems sane for compatibility when using Firefox.
# "general.useragent.override" = "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0";
# set the user agent to a _realistic_ user agent because cloudflare keeps sniffing my balls
"general.useragent.override" = "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0";
};
};
};
} }

View File

@ -1,43 +1,24 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib, with lib;
pkgs, let
...
}:
with lib; let
cfg = config.ezcolors; cfg = config.ezcolors;
pow = n: i: pow = n: i: if i == 1 then n else if i == 0 then 1 else n * pow n (i - 1);
if i == 1
then n
else if i == 0
then 1
else n * pow n (i - 1);
alf = [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ]; alf = [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ];
fil = c: fil = c: lib.imap0 (n: x: if (lib.toLower x) == (lib.toLower c) then n else null) alf;
lib.imap0 (n: x:
if (lib.toLower x) == (lib.toLower c)
then n
else null)
alf;
fin = c: builtins.elemAt (builtins.filter (x: x != null) (fil c)) 0; fin = c: builtins.elemAt (builtins.filter (x: x != null) (fil c)) 0;
add = l: add = l: lib.foldr ({ n, x }: c: (x * (pow 16 n)) + c) 0 (lib.imap0 (n: x: { inherit n x; }) l);
lib.foldr ({
n,
x,
}: c: (x * (pow 16 n)) + c)
0 (lib.imap0 (n: x: {inherit n x;}) l);
calc = s: add (builtins.map fin (builtins.filter (x: builtins.isString x && builtins.stringLength x == 1) (builtins.split "" s))); calc = s: add (builtins.map fin (builtins.filter (x: builtins.isString x && builtins.stringLength x == 1) (builtins.split "" s)));
splitHex = c: let splitHex = c:
let
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c; s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
ss = builtins.elemAt s'; ss = builtins.elemAt s';
o = o = if ss 0 == null then 3 else 0;
if ss 0 == null in
then 3 {
else 0;
in {
r = ss (0 + o); r = ss (0 + o);
g = ss (1 + o); g = ss (1 + o);
b = ss (2 + o); b = ss (2 + o);
@ -47,35 +28,35 @@ with lib; let
hexToAlphaCss = c: a: with hexToRgb c; "rgba(${r}, ${g}, ${b}, ${a})"; hexToAlphaCss = c: a: with hexToRgb c; "rgba(${r}, ${g}, ${b}, ${a})";
makeScheme = base16: makeScheme = base16: lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex" v) base16 //
lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex" v) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-r" (splitHex v).r) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-r" (splitHex v).r) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-g" (splitHex v).g) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-g" (splitHex v).g) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-b" (splitHex v).b) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex-b" (splitHex v).b) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-r" (hexToRgb v).r) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-r" (hexToRgb v).r) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-g" (hexToRgb v).g) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-g" (hexToRgb v).g) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-b" (hexToRgb v).b) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-rgb-b" (hexToRgb v).b) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-r" ((hexToRgb v).r / 255.0)) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-r" ((hexToRgb v).r / 255.0)) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-g" ((hexToRgb v).g / 255.0)) base16 //
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-g" ((hexToRgb v).g / 255.0)) base16 lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-b" ((hexToRgb v).b / 255.0)) base16;
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-dec-b" ((hexToRgb v).b / 255.0)) base16;
mustache = scheme: src: mustache = scheme: src:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation (
{
# TODO add template name # TODO add template name
name = "base16-generated"; name = "base16-generated";
inherit src; inherit src;
data = pkgs.writeText "base16-generated-data" (builtins.toJSON scheme); data = pkgs.writeText "base16-generated-data" (builtins.toJSON scheme);
phases = [ "buildPhase" ]; phases = [ "buildPhase" ];
buildPhase = "${pkgs.mustache-go}/bin/mustache $data $src > $out"; buildPhase = "${pkgs.mustache-go}/bin/mustache $data $src > $out";
}; }
);
scheme =
makeScheme cfg.base16 scheme = (makeScheme cfg.base16 // {
// {
scheme-name = "base16 generated"; scheme-name = "base16 generated";
scheme-slug = "idk"; scheme-slug = "idk";
scheme-author = "nixos"; scheme-author = "nixos";
}; });
genTheme = repo: mustache scheme "${repo}/templates/default.mustache"; genTheme = repo: mustache scheme "${repo}/templates/default.mustache";
@ -94,7 +75,8 @@ with lib; let
homepage = "https://github.com/thefryscorer/schemer2"; homepage = "https://github.com/thefryscorer/schemer2";
}; };
}; };
in { in
{
options.ezcolors = { options.ezcolors = {
enable = mkEnableOption "Enable automatic colors"; enable = mkEnableOption "Enable automatic colors";
@ -143,7 +125,8 @@ in {
}; };
}; };
config = let config =
let
colorsJson = builtins.toFile "colors.json" (builtins.toJSON cfg.base16); colorsJson = builtins.toFile "colors.json" (builtins.toJSON cfg.base16);
themeHashOut = pkgs.runCommand "theme-hash" { } '' themeHashOut = pkgs.runCommand "theme-hash" { } ''
cat ${colorsJson} | ${pkgs.coreutils}/bin/sha256sum | ${pkgs.coreutils}/bin/head -c 8 > $out cat ${colorsJson} | ${pkgs.coreutils}/bin/sha256sum | ${pkgs.coreutils}/bin/head -c 8 > $out
@ -263,13 +246,9 @@ in {
base16FromImage = lib.filterAttrs (k: v: k != "scheme" && k != "author") (builtins.fromJSON (builtins.readFile base16FromImageSrc)); base16FromImage = lib.filterAttrs (k: v: k != "scheme" && k != "author") (builtins.fromJSON (builtins.readFile base16FromImageSrc));
in in
mkMerge [ mkMerge [(mkIf cfg.enable {
(mkIf cfg.enable {
# Read only utility attributes # Read only utility attributes
ezcolors.base16 = ezcolors.base16 = if builtins.typeOf cfg.baseColors == "set" then cfg.baseColors else base16FromImage;
if builtins.typeOf cfg.baseColors == "set"
then cfg.baseColors
else base16FromImage;
ezcolors.base16Rgb = builtins.mapAttrs (n: c: hexToRgb c) cfg.base16; ezcolors.base16Rgb = builtins.mapAttrs (n: c: hexToRgb c) cfg.base16;
ezcolors.base16Split = builtins.mapAttrs (n: c: splitHex c) cfg.base16; ezcolors.base16Split = builtins.mapAttrs (n: c: splitHex c) cfg.base16;
@ -338,7 +317,8 @@ in {
# GTK # GTK
gtk = { gtk = {
enable = true; enable = true;
theme = let theme =
let
generated-gtk-theme = pkgs.callPackage "${inputs.rycee}/pkgs/materia-theme" { generated-gtk-theme = pkgs.callPackage "${inputs.rycee}/pkgs/materia-theme" {
configBase16 = { configBase16 = {
name = "Generated"; name = "Generated";
@ -346,7 +326,8 @@ in {
colors = builtins.mapAttrs (k: v: { hex.rgb = v; }) cfg.base16; colors = builtins.mapAttrs (k: v: { hex.rgb = v; }) cfg.base16;
}; };
}; };
in { in
{
name = "Generated"; name = "Generated";
package = generated-gtk-theme; package = generated-gtk-theme;
}; };
@ -367,8 +348,7 @@ in {
"workbench.colorTheme" = "nix colors"; "workbench.colorTheme" = "nix colors";
}; };
home.file = home.file = lib.mkMerge
lib.mkMerge
[ [
( (
mkIf config.programs.vscode.enable { mkIf config.programs.vscode.enable {
@ -395,8 +375,7 @@ in {
} }
) )
]; ];
}) }) (mkIf (cfg.enable && cfg.plasma) {
(mkIf (cfg.enable && cfg.plasma) {
programs.plasma.files.kdeglobals = with (lib.mapAttrs (n: c: "#${c}") cfg.base16); { programs.plasma.files.kdeglobals = with (lib.mapAttrs (n: c: "#${c}") cfg.base16); {
# programs.plasma.files.kdeglobals = with (lib.mapAttrs (n: c: "${toString c.r},${toString c.g},${toString c.b}") cfg.base16Rgb); { # programs.plasma.files.kdeglobals = with (lib.mapAttrs (n: c: "${toString c.r},${toString c.g},${toString c.b}") cfg.base16Rgb); {
General = { General = {
@ -504,6 +483,5 @@ in {
ForegroundVisited = base0E; ForegroundVisited = base0E;
}; };
}; };
}) })];
];
} }

View File

@ -1,12 +1,10 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib, with lib;
pkgs, let
...
}:
with lib; let
cfg = config.de2u; cfg = config.de2u;
in { in
{
options.de2u = { options.de2u = {
enable = mkEnableOption "Enable de2 user stuff"; enable = mkEnableOption "Enable de2 user stuff";
@ -39,7 +37,60 @@ in {
}; };
}; };
programs.firefox.enable = true; programs.firefox = {
enable = lib.mkDefault true;
package = lib.mkDefault ((if pkgs ? librewolf then pkgs.librewolf else pkgs.firefox).override {
cfg = {
enableGnomeExtensions = true;
pipewireSupport = true;
};
});
extensions = lib.optionals (pkgs ? nur.repos.rycee.firefox-addons) (with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
bitwarden
violentmonkey
canvasblocker
sponsorblock
stylus
]);
profiles.default = {
settings = {
"browser.startup.homepage" = "https://wizbos.club";
# Make the browser usable, if I wanted autism privacy, I would use TOR browser.
"privacy.resistFingerprinting" = false;
"webgl.disabled" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
"privacy.clearOnShutdown.sessions" = false;
"privacy.clearOnShutdown.cache" = false;
"places.history.enabled" = true;
"network.dns.disableIPv6" = false;
"media.peerconnection.ice.no_host" = false;
# Make Jitsi work sanely
"media.setsinkid.enabled" = true;
"privacy.webrtc.legacyGlobalIndicator" = false;
"privacy.webrtc.hideGlobalIndicator" = true;
# good tweaks
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"layers.acceleration.force-enabled" = true;
"gfx.webrender.all" = true;
"svg.context-properties.content.enabled" = true;
"reader.color_scheme" = "dark";
# # LibreWolf ruins the user agent making sites unusable without RFP, so use the user agent from RFP manually. This also seems sane for compatibility when using Firefox.
# "general.useragent.override" = "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0";
# set the user agent to a _realistic_ user agent because cloudflare keeps sniffing my balls
"general.useragent.override" = "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0";
};
};
};
programs.kermit = { programs.kermit = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
@ -87,20 +138,12 @@ in {
xdg.configFile."gtk-4.0/gtk.css".text = '' xdg.configFile."gtk-4.0/gtk.css".text = ''
/* UNITE windowDecorations */ /* UNITE windowDecorations */
@import url('${config.home.homeDirectory}/.nix-profile/share/gnome-shell/extensions/unite@hardpixel.eu/styles/gtk4/buttons-right/${ @import url('${config.home.homeDirectory}/.nix-profile/share/gnome-shell/extensions/unite@hardpixel.eu/styles/gtk4/buttons-right/${if (cfg.tiling && !cfg.touch) then "always" else "both"}.css');
if (cfg.tiling && !cfg.touch)
then "always"
else "both"
}.css');
/* windowDecorations UNITE */ /* windowDecorations UNITE */
''; '';
gtk.gtk3.extraCss = '' gtk.gtk3.extraCss = ''
/* UNITE windowDecorations */ /* UNITE windowDecorations */
@import url('${config.home.homeDirectory}/.nix-profile/share/gnome-shell/extensions/unite@hardpixel.eu/styles/gtk3/buttons-right/${ @import url('${config.home.homeDirectory}/.nix-profile/share/gnome-shell/extensions/unite@hardpixel.eu/styles/gtk3/buttons-right/${if (cfg.tiling && !cfg.touch) then "always" else "both"}.css');
if (cfg.tiling && !cfg.touch)
then "always"
else "both"
}.css');
/* windowDecorations UNITE */ /* windowDecorations UNITE */
''; '';
home.activation.gtk3css-over-unite = { home.activation.gtk3css-over-unite = {
@ -115,14 +158,15 @@ in {
xdg.configFile."mimeapps.list".force = true; xdg.configFile."mimeapps.list".force = true;
xdg.mimeApps = let xdg.mimeApps = let
browser = browser =
if config.programs.firefox.enable if config.programs.firefox.enable then
then
( (
if config.programs.firefox.package.pname == "firefox" if config.programs.firefox.package.pname == "firefox" then
then "firefox.desktop" "firefox.desktop"
else "librewolf.desktop" else
"librewolf.desktop"
) )
else "chromium-browser.desktop"; else
"chromium-browser.desktop";
apps = { apps = {
"text/plain" = "org.gnome.TextEditor.desktop"; "text/plain" = "org.gnome.TextEditor.desktop";
@ -200,10 +244,7 @@ in {
tray-pos = "center"; tray-pos = "center";
}; };
"org/gnome/shell/extensions/user-theme" = { "org/gnome/shell/extensions/user-theme" = {
name = name = if config.ezcolors.enable then "Generated" else "Default";
if config.ezcolors.enable
then "Generated"
else "Default";
}; };
"org/gnome/shell/extensions/just-perfection" = { "org/gnome/shell/extensions/just-perfection" = {
# activities-button = !cfg.tiling; # conflicts with unite? # activities-button = !cfg.tiling; # conflicts with unite?
@ -248,18 +289,9 @@ in {
only-on-primary = cfg.tiling; only-on-primary = cfg.tiling;
}; };
"org/gnome/shell/extensions/unite" = { "org/gnome/shell/extensions/unite" = {
hide-window-titlebars = hide-window-titlebars = if (cfg.tiling && !cfg.touch) then "always" else "both";
if (cfg.tiling && !cfg.touch) hide-activities-button = if (cfg.tiling || cfg.touch) then "never" else "always";
then "always" show-window-buttons = if cfg.tiling then "never" else "both";
else "both";
hide-activities-button =
if (cfg.tiling || cfg.touch)
then "never"
else "always";
show-window-buttons =
if cfg.tiling
then "never"
else "both";
notifications-position = "center"; notifications-position = "center";
restrict-to-primary-screen = false; restrict-to-primary-screen = false;
show-legacy-tray = false; show-legacy-tray = false;
@ -283,10 +315,7 @@ in {
snap-color = "rgba(0,0,0,0)"; snap-color = "rgba(0,0,0,0)";
}; };
"org/gnome/desktop/wm/preferences" = { "org/gnome/desktop/wm/preferences" = {
focus-mode = focus-mode = if cfg.tiling then "sloppy" else "click";
if cfg.tiling
then "sloppy"
else "click";
resize-with-right-button = true; resize-with-right-button = true;
num-workspaces = 9; num-workspaces = 9;
}; };
@ -298,7 +327,8 @@ in {
enabled = true; enabled = true;
}; };
"org/gnome/desktop/wm/keybindings" = let "org/gnome/desktop/wm/keybindings" =
let
workspaceAttrsList = lib.flatten (map workspaceAttrsList = lib.flatten (map
(n: [ (n: [
(lib.nameValuePair "move-to-workspace-${n}" [ "<Shift><Super>${n}" ]) (lib.nameValuePair "move-to-workspace-${n}" [ "<Shift><Super>${n}" ])
@ -306,8 +336,7 @@ in {
]) ])
(map (n: toString n) (lib.range 1 9))); (map (n: toString n) (lib.range 1 9)));
in in
lib.listToAttrs workspaceAttrsList lib.listToAttrs workspaceAttrsList // {
// {
minimize = [ "<Super>comma" ]; minimize = [ "<Super>comma" ];
maximize = [ "" ]; maximize = [ "" ];
unmaximize = [ "" ]; unmaximize = [ "" ];
@ -351,9 +380,7 @@ in {
"org/gnome/mutter/wayland/keybindings" = { "org/gnome/mutter/wayland/keybindings" = {
restore-shortcuts = [ "" ]; restore-shortcuts = [ "" ];
}; };
"org/gnome/shell/keybindings" = "org/gnome/shell/keybindings" = lib.listToAttrs (map (n: lib.nameValuePair "switch-to-application-${toString n}" [ "" ]) (lib.range 1 9)) // {
lib.listToAttrs (map (n: lib.nameValuePair "switch-to-application-${toString n}" [""]) (lib.range 1 9))
// {
open-application-menu = [ "" ]; open-application-menu = [ "" ];
toggle-message-tray = [ "<Super>v" ]; toggle-message-tray = [ "<Super>v" ];
toggle-overview = [ "" ]; toggle-overview = [ "" ];

View File

@ -1,12 +1,11 @@
inputs: {
config, inputs:
lib, { config, lib, pkgs, ... }:
pkgs, with lib;
... let
}:
with lib; let
cfg = config.de3u; cfg = config.de3u;
in { in
{
imports = [ imports = [
inputs.plasma-manager.homeManagerModules.plasma-manager inputs.plasma-manager.homeManagerModules.plasma-manager
]; ];
@ -107,14 +106,15 @@ in {
}; };
General = { General = {
BrowserApplication = BrowserApplication =
if config.programs.firefox.enable if config.programs.firefox.enable then
then
( (
if config.programs.firefox.package.pname == "firefox" if config.programs.firefox.package.pname == "firefox" then
then "firefox.desktop" "firefox.desktop"
else "librewolf.desktop" else
"librewolf.desktop"
) )
else "chromium-browser.desktop"; else
"chromium-browser.desktop";
TerminalApplication = "kermit"; TerminalApplication = "kermit";
TerminalService = "kermit.desktop"; TerminalService = "kermit.desktop";
}; };
@ -251,7 +251,61 @@ in {
}; };
}; };
programs.firefox.enable = true; programs.firefox = {
enable = lib.mkDefault true;
package = lib.mkDefault (librewolf.override {
cfg = {
enableGnomeExtensions = true;
pipewireSupport = true;
};
});
extensions = lib.optionals (pkgs ? nur.repos.rycee.firefox-addons) (with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
bitwarden
violentmonkey
canvasblocker
sponsorblock
stylus
vimium
]);
profiles.default = {
settings = {
"browser.startup.homepage" = "https://wizbos.club";
# Make the browser usable, if I wanted autism privacy, I would use TOR browser.
"privacy.resistFingerprinting" = false;
"webgl.disabled" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
"privacy.clearOnShutdown.sessions" = false;
"privacy.clearOnShutdown.cache" = false;
"places.history.enabled" = true;
"network.dns.disableIPv6" = false;
"media.peerconnection.ice.no_host" = false;
# Make Jitsi work sanely
"media.setsinkid.enabled" = true;
"privacy.webrtc.legacyGlobalIndicator" = false;
"privacy.webrtc.hideGlobalIndicator" = true;
# good tweaks
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"layers.acceleration.force-enabled" = true;
"gfx.webrender.all" = true;
"svg.context-properties.content.enabled" = true;
"reader.color_scheme" = "dark";
# # LibreWolf ruins the user agent making sites unusable without RFP, so use the user agent from RFP manually. This also seems sane for compatibility when using Firefox.
# "general.useragent.override" = "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0";
# set the user agent to a _realistic_ user agent because cloudflare keeps sniffing my balls
"general.useragent.override" = "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0";
};
};
};
programs.kermit = { programs.kermit = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
@ -278,14 +332,15 @@ in {
xdg.configFile."mimeapps.list".force = true; xdg.configFile."mimeapps.list".force = true;
xdg.mimeApps = let xdg.mimeApps = let
browser = browser =
if config.programs.firefox.enable if config.programs.firefox.enable then
then
( (
if config.programs.firefox.package.pname == "firefox" if config.programs.firefox.package.pname == "firefox" then
then "firefox.desktop" "firefox.desktop"
else "librewolf.desktop" else
"librewolf.desktop"
) )
else "chromium-browser.desktop"; else
"chromium-browser.desktop";
apps = { apps = {
"text/plain" = "org.kde.kate.desktop"; "text/plain" = "org.kde.kate.desktop";

View File

@ -1,9 +1,7 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib,
pkgs, {
...
}: {
imports = [ imports = [
(lib.mkAliasOptionModule [ "ezpcusr" "gaming" ] [ "gaming" "enable" ]) (lib.mkAliasOptionModule [ "ezpcusr" "gaming" ] [ "gaming" "enable" ])
(lib.mkAliasOptionModule [ "ezpcusr" "newWine" ] [ "gaming" "newWine" ]) (lib.mkAliasOptionModule [ "ezpcusr" "newWine" ] [ "gaming" "newWine" ])

View File

@ -1,10 +1,7 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib, with lib;
pkgs, let
...
}:
with lib; let
cfg = config.ezpcusr; cfg = config.ezpcusr;
lockCommand = "${pkgs.swaylock-effects}/bin/swaylock --clock --indicator --screenshots --effect-scale 0.8 --effect-blur 8x3 --effect-vignette 0.2:0.5 --fade-in 0.5 --text-color ${config.ezcolors.base16.base08} --inside-color ${config.ezcolors.base16.base00} --ring-color ${config.ezcolors.base16.base01} --datestr \"%Y-%m-%e\" --timestr \"%I:%M %p\""; lockCommand = "${pkgs.swaylock-effects}/bin/swaylock --clock --indicator --screenshots --effect-scale 0.8 --effect-blur 8x3 --effect-vignette 0.2:0.5 --fade-in 0.5 --text-color ${config.ezcolors.base16.base08} --inside-color ${config.ezcolors.base16.base00} --ring-color ${config.ezcolors.base16.base01} --datestr \"%Y-%m-%e\" --timestr \"%I:%M %p\"";
@ -33,8 +30,7 @@ with lib; let
''; '';
scrsaveup = scrsaveup =
if cfg.uploadScript != null if cfg.uploadScript != null then
then
pkgs.writeScript "scr-save-up.sh" '' pkgs.writeScript "scr-save-up.sh" ''
#!${pkgs.zsh}/bin/zsh #!${pkgs.zsh}/bin/zsh
LOC=$(${getscrloc}) LOC=$(${getscrloc})
@ -42,7 +38,8 @@ with lib; let
${cfg.uploadScript} $LOC | xargs echo -n | ${pkgs.wl-clipboard}/bin/wl-copy ${cfg.uploadScript} $LOC | xargs echo -n | ${pkgs.wl-clipboard}/bin/wl-copy
notify-send "Screenshot Uploaded!" notify-send "Screenshot Uploaded!"
'' ''
else null; else
null;
scrvidsaveclip = pkgs.writeScript "scr-vid-save-clip.sh" '' scrvidsaveclip = pkgs.writeScript "scr-vid-save-clip.sh" ''
#!${pkgs.zsh}/bin/zsh #!${pkgs.zsh}/bin/zsh
@ -52,8 +49,7 @@ with lib; let
''; '';
scrvidsaveup = scrvidsaveup =
if cfg.uploadScript != null if cfg.uploadScript != null then
then
pkgs.writeScript "scr-vid-save-up.sh" '' pkgs.writeScript "scr-vid-save-up.sh" ''
#!${pkgs.zsh}/bin/zsh #!${pkgs.zsh}/bin/zsh
LOC=$(${getscrloc} mp4) LOC=$(${getscrloc} mp4)
@ -61,15 +57,15 @@ with lib; let
${cfg.uploadScript} $LOC | ${pkgs.findutils}/bin/xargs echo -n | ${pkgs.wl-clipboard}/bin/wl-copy ${cfg.uploadScript} $LOC | ${pkgs.findutils}/bin/xargs echo -n | ${pkgs.wl-clipboard}/bin/wl-copy
notify-send "Screen Recording Uploaded!" notify-send "Screen Recording Uploaded!"
'' ''
else null; else
null;
scrvidstop = pkgs.writeScript "scr-vid-stop.sh" '' scrvidstop = pkgs.writeScript "scr-vid-stop.sh" ''
#!${pkgs.zsh}/bin/zsh #!${pkgs.zsh}/bin/zsh
${pkgs.procps}/bin/pkill -2 wf-recorder ${pkgs.procps}/bin/pkill -2 wf-recorder
''; '';
ezDrv = pkgs.runCommand "ez-commands" {} ( ezDrv = pkgs.runCommand "ez-commands" { } (''
''
mkdir -p $out/bin mkdir -p $out/bin
ln -s ${selshot} $out/bin/selshot ln -s ${selshot} $out/bin/selshot
ln -s ${selvid} $out/bin/selvid ln -s ${selvid} $out/bin/selvid
@ -77,26 +73,25 @@ with lib; let
ln -s ${scrsaveclip} $out/bin/scrsaveclip ln -s ${scrsaveclip} $out/bin/scrsaveclip
ln -s ${scrvidsaveclip} $out/bin/scrvidsaveclip ln -s ${scrvidsaveclip} $out/bin/scrvidsaveclip
ln -s ${scrvidstop} $out/bin/scrvidstop ln -s ${scrvidstop} $out/bin/scrvidstop
'' '' + (
+ ( if cfg.uploadScript != null then ''
if cfg.uploadScript != null
then ''
ln -s ${cfg.uploadScript} $out/bin/upload_file ln -s ${cfg.uploadScript} $out/bin/upload_file
ln -s ${scrsaveup} $out/bin/scrsaveup ln -s ${scrsaveup} $out/bin/scrsaveup
ln -s ${scrvidsaveup} $out/bin/scrvidsaveup ln -s ${scrvidsaveup} $out/bin/scrvidsaveup
'' '' else ""
else ""
) )
); );
in { in
{
options.ezpcusr = { options.ezpcusr = {
enable = mkEnableOption "Enable simple PC user config"; enable = mkEnableOption "Enable simple PC user config";
uploadScript = mkOption { uploadScript = mkOption {
type = types.nullOr types.package; type = types.nullOr types.package;
default = null; default = null;
description = "A path to a script that takes a path to a file and returns a URL"; description =
"A path to a script that takes a path to a file and returns a URL";
}; };
screenshotsPath = mkOption { screenshotsPath = mkOption {
@ -199,7 +194,8 @@ in {
modifier = lib.mkDefault "Mod4"; modifier = lib.mkDefault "Mod4";
keybindings = let keybindings =
let
# ugly stupid way of doing things but im lazy # ugly stupid way of doing things but im lazy
bwRofi = pkgs.writeScript "bw-rofi" '' bwRofi = pkgs.writeScript "bw-rofi" ''
#!${pkgs.bash}/bin/bash #!${pkgs.bash}/bin/bash
@ -236,39 +232,26 @@ in {
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.wayland.windowManager.sway.config.modifier;
alphabet = [ "Ctrl" "Alt" "Ctrl+Alt" ]; alphabet = [ "Ctrl" "Alt" "Ctrl+Alt" ];
genKeyAttrs = move: genKeyAttrs = move: lib.listToAttrs (
lib.listToAttrs (
map map
( (
n: { n: {
name = "${modifier}${ name = "${modifier}${if move then "+Shift" else ""}+${builtins.elemAt alphabet ((n - 11) / 10)}+${toString (lib.mod n 10)}";
if move value = "${if move then "move container to " else ""}workspace ${toString n}";
then "+Shift"
else ""
}+${builtins.elemAt alphabet ((n - 11) / 10)}+${toString (lib.mod n 10)}";
value = "${
if move
then "move container to "
else ""
}workspace ${toString n}";
} }
) )
(lib.lists.range 11 (10 * (builtins.length alphabet) + 10)) (lib.lists.range 11 (10 * (builtins.length alphabet) + 10))
); );
in in
lib.mkOptionDefault ( lib.mkOptionDefault (
genKeyAttrs true genKeyAttrs true // genKeyAttrs false // (
// genKeyAttrs false
// (
let let
volumeUp = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; volumeUp = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
volumeDown = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; volumeDown = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
in { in
{
"Print" = "exec ${scrsaveclip}"; "Print" = "exec ${scrsaveclip}";
"Shift+Print" = "Shift+Print" = if cfg.uploadScript != null then "exec ${scrsaveup}" else "nop";
if cfg.uploadScript != null
then "exec ${scrsaveup}"
else "nop";
"Ctrl+Print" = "exec ${scrvidsaveclip}"; "Ctrl+Print" = "exec ${scrvidsaveclip}";
"Ctrl+Alt+Print" = "exec ${scrvidstop}"; "Ctrl+Alt+Print" = "exec ${scrvidstop}";
@ -278,8 +261,10 @@ in {
"XF86AudioRaiseVolume" = volumeUp; "XF86AudioRaiseVolume" = volumeUp;
"XF86AudioLowerVolume" = volumeDown; "XF86AudioLowerVolume" = volumeDown;
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" =
"XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" =
"exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 10"; "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 10";
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 10"; "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 10";
@ -287,9 +272,12 @@ in {
"${modifier}+apostrophe" = "exec ${pkgs.light}/bin/light -A 10"; "${modifier}+apostrophe" = "exec ${pkgs.light}/bin/light -A 10";
# Previous/next but change the shuffle/random state before action (and change back afterwards) # Previous/next but change the shuffle/random state before action (and change back afterwards)
"${modifier}+Shift+bracketright" = "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle"; "${modifier}+Shift+bracketright" =
"${modifier}+Shift+bracketleft" = "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl previous && ${pkgs.playerctl}/bin/playerctl shuffle Toggle"; "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"Shift+XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle"; "${modifier}+Shift+bracketleft" =
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl previous && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
"Shift+XF86AudioNext" =
"exec ${pkgs.playerctl}/bin/playerctl shuffle Toggle && ${pkgs.playerctl}/bin/playerctl next && ${pkgs.playerctl}/bin/playerctl shuffle Toggle";
# Previous/next # Previous/next
"${modifier}+bracketright" = "exec ${pkgs.playerctl}/bin/playerctl next"; "${modifier}+bracketright" = "exec ${pkgs.playerctl}/bin/playerctl next";
@ -308,15 +296,18 @@ in {
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"${modifier}+backslash" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "${modifier}+backslash" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"${modifier}+Ctrl+Shift+m" = let "${modifier}+Ctrl+Shift+m" =
let
ripMusicAdvanced = pkgs.writeShellScript "rip-music-advanced.sh" '' ripMusicAdvanced = pkgs.writeShellScript "rip-music-advanced.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current) CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT) URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
PARAMS=$(${pkgs.rofi}/bin/rofi -dmenu) PARAMS=$(${pkgs.rofi}/bin/rofi -dmenu)
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$PARAMS" echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$PARAMS"
''; '';
in "exec ${ripMusicAdvanced}"; in
"${modifier}+Ctrl+m" = let "exec ${ripMusicAdvanced}";
"${modifier}+Ctrl+m" =
let
ripMusic = pkgs.writeShellScript "rip-music.sh" '' ripMusic = pkgs.writeShellScript "rip-music.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current) CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT) URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
@ -329,17 +320,21 @@ in {
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$ALBUM" echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$ALBUM"
fi fi
''; '';
in "exec ${ripMusic}"; in
"exec ${ripMusic}";
"${modifier}+m" = let "${modifier}+m" =
let
musicRofi = pkgs.writeShellScript "music-rofi" '' musicRofi = pkgs.writeShellScript "music-rofi" ''
SONGN=$(${pkgs.mpc_cli}/bin/mpc -f "%position% - %artist% - %album% - %title%" playlist | ${pkgs.rofi}/bin/rofi -dmenu -i | ${pkgs.coreutils}/bin/cut -d " " -f 1) SONGN=$(${pkgs.mpc_cli}/bin/mpc -f "%position% - %artist% - %album% - %title%" playlist | ${pkgs.rofi}/bin/rofi -dmenu -i | ${pkgs.coreutils}/bin/cut -d " " -f 1)
[ ! -z "$SONGN" ] && ${pkgs.mpc_cli}/bin/mpc play "$SONGN" [ ! -z "$SONGN" ] && ${pkgs.mpc_cli}/bin/mpc play "$SONGN"
''; '';
in "exec ${musicRofi}"; in
"exec ${musicRofi}";
"${modifier}+k" = "exec ${pkgs.mpc_cli}/bin/mpc clear"; "${modifier}+k" = "exec ${pkgs.mpc_cli}/bin/mpc clear";
"${config.wayland.windowManager.sway.config.modifier}+Shift+k" = lib.mkForce "exec ${pkgs.mpc_cli}/bin/mpc ls \"Local media/Tracks\" | ${pkgs.mpc_cli}/bin/mpc add"; "${config.wayland.windowManager.sway.config.modifier}+Shift+k" = lib.mkForce "exec ${pkgs.mpc_cli}/bin/mpc ls \"Local media/Tracks\" | ${pkgs.mpc_cli}/bin/mpc add";
"${config.wayland.windowManager.sway.config.modifier}+Shift+m" = let "${config.wayland.windowManager.sway.config.modifier}+Shift+m" =
let
mopidySearch = pkgs.writeShellScript "mopidy-search.sh" '' mopidySearch = pkgs.writeShellScript "mopidy-search.sh" ''
QUERY=$(${pkgs.rofi}/bin/rofi -dmenu) QUERY=$(${pkgs.rofi}/bin/rofi -dmenu)
[ -z "$QUERY" ] && exit [ -z "$QUERY" ] && exit
@ -359,7 +354,8 @@ in {
PLAYLIST_ENTRY_POSITION=$(echo "$PLAYLIST_ENTRY" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}') PLAYLIST_ENTRY_POSITION=$(echo "$PLAYLIST_ENTRY" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}')
${pkgs.mpc_cli}/bin/mpc play "$PLAYLIST_ENTRY_POSITION" ${pkgs.mpc_cli}/bin/mpc play "$PLAYLIST_ENTRY_POSITION"
''; '';
in "exec ${mopidySearch}"; in
"exec ${mopidySearch}";
"${modifier}+p" = "exec ${bwRofi}"; "${modifier}+p" = "exec ${bwRofi}";
"${modifier}+t" = "exec ${bwRofiOtp}"; "${modifier}+t" = "exec ${bwRofiOtp}";
@ -501,8 +497,8 @@ in {
spacing = 5; spacing = 5;
}; };
}; };
}
// cfg.waybarConfig) } // cfg.waybarConfig)
]; ];
style = '' style = ''
@ -667,12 +663,14 @@ in {
}; };
}; };
xdg.configFile."neofetch/config.conf".text = let xdg.configFile."neofetch/config.conf".text =
let
image = builtins.path { image = builtins.path {
name = "nixos_circlejerk.png"; name = "nixos_circlejerk.png";
path = ../data/nixos_circlejerk.png; path = ../data/nixos_circlejerk.png;
}; };
in '' in
''
image_source="${image}" image_source="${image}"
image_backend="kitty" image_backend="kitty"
''; '';

View File

@ -1,12 +1,10 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib, with lib;
pkgs, let
...
}:
with lib; let
cfg = config.gaming; cfg = config.gaming;
in { in
{
options.gaming = { options.gaming = {
enable = mkEnableOption "Enable gaming stuff"; enable = mkEnableOption "Enable gaming stuff";
@ -35,11 +33,9 @@ in {
STAGING_RT_PRIORITY_SERVER = 90; STAGING_RT_PRIORITY_SERVER = 90;
}; };
home.packages = let home.packages =
newwine = pkgs.winePackages.full.override { let
wineBuild = "wineWow"; newwine = (pkgs.winePackages.full.override { wineBuild = "wineWow"; wineRelease = "staging"; });
wineRelease = "staging";
};
newwinetricks = pkgs.winetricks.overrideAttrs (old: rec { newwinetricks = pkgs.winetricks.overrideAttrs (old: rec {
pathAdd = "${newwine}/bin:" + old.pathAdd; pathAdd = "${newwine}/bin:" + old.pathAdd;
postInstall = '' postInstall = ''
@ -59,8 +55,7 @@ in {
''; '';
}); });
in in
with pkgs; with pkgs; [
[
oldwine oldwine
oldwinetricks oldwinetricks
@ -68,8 +63,7 @@ in {
tuxpaint tuxpaint
extremetuxracer extremetuxracer
] ] ++ lib.optionals cfg.newWine [
++ lib.optionals cfg.newWine [
( (
pkgs.runCommand "new-wine-stuff" pkgs.runCommand "new-wine-stuff"
{ } '' { } ''
@ -79,8 +73,7 @@ in {
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
'' ''
) )
] ] ++ lib.optional cfg.steamService (pkgs.writeShellScriptBin "steam" "${pkgs.systemd}/bin/systemctl --user start steam");
++ lib.optional cfg.steamService (pkgs.writeShellScriptBin "steam" "${pkgs.systemd}/bin/systemctl --user start steam");
systemd.user.services.scc = mkIf cfg.scService { systemd.user.services.scc = mkIf cfg.scService {
Unit = { Unit = {
@ -108,7 +101,8 @@ in {
Service = { Service = {
Type = "simple"; Type = "simple";
ExecStart = let ExecStart =
let
steamStart = pkgs.writeShellScript "steam-start" '' steamStart = pkgs.writeShellScript "steam-start" ''
${pkgs.systemd}/bin/systemctl --user stop scc ${pkgs.systemd}/bin/systemctl --user stop scc
# no sleep is needed here because steam is slow as fuck lol # no sleep is needed here because steam is slow as fuck lol
@ -116,7 +110,8 @@ in {
''; '';
in in
lib.mkIf cfg.scService "${steamStart}"; lib.mkIf cfg.scService "${steamStart}";
ExecStop = let ExecStop =
let
steamStop = pkgs.writeShellScript "steam-stop" '' steamStop = pkgs.writeShellScript "steam-stop" ''
${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset ${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset
${pkgs.systemd}/bin/systemctl --user start scc ${pkgs.systemd}/bin/systemctl --user start scc

View File

@ -1,11 +1,9 @@
{ { config, lib, pkgs, ... }:
config,
lib, let
pkgs,
...
}: let
cfg = config.programs.kermit; cfg = config.programs.kermit;
in { in
{
options.programs.kermit = { options.programs.kermit = {
enable = lib.mkEnableOption "A VTE-based, simple and froggy terminal emulator 🐸"; enable = lib.mkEnableOption "A VTE-based, simple and froggy terminal emulator 🐸";
@ -27,20 +25,16 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
xdg.configFile."kermit.conf".text = xdg.configFile."kermit.conf".text = (lib.generators.toKeyValue
(lib.generators.toKeyValue
{ {
mkKeyValue = lib.generators.mkKeyValueDefault { } " "; mkKeyValue = lib.generators.mkKeyValueDefault { } " ";
} }
cfg.settings) cfg.settings) + cfg.extraConfig;
+ cfg.extraConfig;
home.packages = [ home.packages = [ (pkgs.kermit-terminal.overrideAttrs (super: {
(pkgs.kermit-terminal.overrideAttrs (super: {
postInstall = '' postInstall = ''
sed -i 's/\/usr\/bin\///' $out/share/applications/kermit.desktop sed -i 's/\/usr\/bin\///' $out/share/applications/kermit.desktop
''; '';
})) })) ];
];
}; };
} }

View File

@ -1,9 +1,4 @@
{ { config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}: {
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.packages = with pkgs; [ zsh-powerlevel9k ]; home.packages = with pkgs; [ zsh-powerlevel9k ];

View File

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.packages = with pkgs; [ zsh-powerlevel9k ]; home.packages = with pkgs; [ zsh-powerlevel9k ];

View File

@ -1,12 +1,11 @@
inputs: { inputs:
config, { config, pkgs, lib, ... }:
pkgs,
lib, let
...
}: let
# TODO: find a better source # TODO: find a better source
mimeTypes = pkgs.fetchurl { mimeTypes = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/eprints/eprints3.4/master/lib/mime.types"; url =
"https://raw.githubusercontent.com/eprints/eprints3.4/master/lib/mime.types";
sha256 = "0cdhq71wk5h3zcfrz8dyqc3vrjyikwjqsla855v036r54lch0kn2"; sha256 = "0cdhq71wk5h3zcfrz8dyqc3vrjyikwjqsla855v036r54lch0kn2";
}; };
@ -14,7 +13,8 @@ inputs: {
#!${pkgs.zsh}/bin/zsh #!${pkgs.zsh}/bin/zsh
git commit -am "$*" git commit -am "$*"
''; '';
in { in
{
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -79,8 +79,7 @@ in {
"rust-analyzer.diagnostics.disabled" = [ "unresolved-proc-macro" ]; "rust-analyzer.diagnostics.disabled" = [ "unresolved-proc-macro" ];
}; };
extensions = with pkgs.vscode-extensions; extensions = with pkgs.vscode-extensions; [
[
vscodevim.vim vscodevim.vim
jnoortheen.nix-ide jnoortheen.nix-ide
haskell.haskell haskell.haskell
@ -95,8 +94,7 @@ in {
exec rust-analyzer "$@" exec rust-analyzer "$@"
''; '';
}) })
] ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{ {
name = "vscode-autohide"; name = "vscode-autohide";
publisher = "sirmspencer"; publisher = "sirmspencer";
@ -183,8 +181,7 @@ in {
version = builtins.readFile (pkgs.runCommand "firenvim-version" { } '' version = builtins.readFile (pkgs.runCommand "firenvim-version" { } ''
${pkgs.jq}/bin/jq -j .version < ${inputs.firenvim}/package.json > $out ${pkgs.jq}/bin/jq -j .version < ${inputs.firenvim}/package.json > $out
''); '');
} })
)
vim-gitgutter vim-gitgutter
]; ];
extraConfig = '' extraConfig = ''

View File

@ -1,11 +1,6 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let cfg = config.de2;
pkgs,
...
}:
with lib; let
cfg = config.de2;
in { in {
options.de2.enable = mkEnableOption "Enable de2 system stuff"; options.de2.enable = mkEnableOption "Enable de2 system stuff";
@ -31,17 +26,13 @@ in {
services.power-profiles-daemon.enable = lib.mkDefault false; services.power-profiles-daemon.enable = lib.mkDefault false;
# for KDE connect # for KDE connect
networking.firewall.allowedTCPPortRanges = [ networking.firewall.allowedTCPPortRanges = [{
{
from = 1714; from = 1714;
to = 1764; to = 1764;
} }];
]; networking.firewall.allowedUDPPortRanges = [{
networking.firewall.allowedUDPPortRanges = [
{
from = 1714; from = 1714;
to = 1764; to = 1764;
} }];
];
}; };
} }

View File

@ -1,11 +1,6 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let cfg = config.de3;
pkgs,
...
}:
with lib; let
cfg = config.de3;
in { in {
options.de3.enable = mkEnableOption "Enable de3 system stuff"; options.de3.enable = mkEnableOption "Enable de3 system stuff";
@ -32,17 +27,13 @@ in {
services.power-profiles-daemon.enable = lib.mkDefault false; services.power-profiles-daemon.enable = lib.mkDefault false;
# for KDE connect # for KDE connect
networking.firewall.allowedTCPPortRanges = [ networking.firewall.allowedTCPPortRanges = [{
{
from = 1714; from = 1714;
to = 1764; to = 1764;
} }];
]; networking.firewall.allowedUDPPortRanges = [{
networking.firewall.allowedUDPPortRanges = [
{
from = 1714; from = 1714;
to = 1764; to = 1764;
} }];
];
}; };
} }

View File

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }:
{ {
config,
lib,
pkgs,
...
}: {
imports = [ imports = [
./ezwg.nix ./ezwg.nix
./kiosk.nix ./kiosk.nix

View File

@ -1,15 +1,9 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let cfg = config.services.ezpassthru;
pkgs,
...
}:
with lib; let
cfg = config.services.ezpassthru;
in { in {
options.services.ezpassthru = { options.services.ezpassthru = {
enable = enable = mkEnableOption
mkEnableOption
"Enable simple VM PCI passthrough config (NOTE: this is only for ppl with a primary AMD/Intel, and a non-primary NVidia)"; "Enable simple VM PCI passthrough config (NOTE: this is only for ppl with a primary AMD/Intel, and a non-primary NVidia)";
PCIs = mkOption { PCIs = mkOption {

View File

@ -1,11 +1,6 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let cfg = config.services.ezpw;
pkgs,
...
}:
with lib; let
cfg = config.services.ezpw;
in { in {
options.services.ezpw = { options.services.ezpw = {
enable = mkEnableOption "Enable pipewire"; enable = mkEnableOption "Enable pipewire";
@ -18,7 +13,8 @@ in {
usbSoundcard = mkOption { usbSoundcard = mkOption {
type = types.bool; type = types.bool;
description = "Doubles the audio rate for alsa outputs in low latency mode"; description =
"Doubles the audio rate for alsa outputs in low latency mode";
default = false; default = false;
}; };
@ -42,10 +38,9 @@ in {
}; };
}; };
config = let config =
qr = "${toString cfg.quantum}/${toString cfg.rate}"; let qr = "${toString cfg.quantum}/${toString cfg.rate}";
in in mkIf cfg.enable {
mkIf cfg.enable {
hardware.pulseaudio.enable = lib.mkDefault false; hardware.pulseaudio.enable = lib.mkDefault false;
sound.enable = lib.mkDefault false; sound.enable = lib.mkDefault false;
@ -134,24 +129,16 @@ in {
}; };
media-session.config.alsa-monitor = mkIf cfg.lowLatency { media-session.config.alsa-monitor = mkIf cfg.lowLatency {
rules = [ rules = [{
{
matches = [{ node.name = "alsa_output.*"; }]; matches = [{ node.name = "alsa_output.*"; }];
actions = { actions = {
update-props = { update-props = {
"audio.format" = "S32LE"; "audio.format" = "S32LE";
"audio.rate" = "audio.rate" = cfg.rate * (if cfg.usbSoundcard then 2 else 1);
cfg.rate
* (
if cfg.usbSoundcard
then 2
else 1
);
"api.alsa.period-size" = cfg.periodSize; "api.alsa.period-size" = cfg.periodSize;
}; };
}; };
} }];
];
}; };
media-session.config.bluez-monitor = { media-session.config.bluez-monitor = {
@ -164,7 +151,8 @@ in {
actions = { actions = {
update-props = { update-props = {
"bluez5.auto-connect" = [ "hsp_hs" "hfp_hf" "a2dp_sink" ]; "bluez5.auto-connect" = [ "hsp_hs" "hfp_hf" "a2dp_sink" ];
"bluez5.hw-volume" = ["hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink"]; "bluez5.hw-volume" =
[ "hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink" ];
"bluez5.autoswitch-profile" = true; "bluez5.autoswitch-profile" = true;
}; };
}; };
@ -181,21 +169,18 @@ in {
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs;
[
# pactl is required for pipewire-pulse # pactl is required for pipewire-pulse
pulseaudio pulseaudio
]; ];
environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" = mkIf cfg.lowLatency { environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" =
mkIf cfg.lowLatency {
text = '' text = ''
alsa_monitor.properties = { alsa_monitor.properties = {
["audio.rate"] = ${ ["audio.rate"] = ${
toString (cfg.rate toString (cfg.rate * (if cfg.usbSoundcard then 2 else 1))
* (
if cfg.usbSoundcard
then 2
else 1
))
}, },
["audio.format"] = "S32LE", ["audio.format"] = "S32LE",
["api.alsa.headroom"] = 512, ["api.alsa.headroom"] = 512,

View File

@ -1,10 +1,6 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let
pkgs,
...
}:
with lib; let
cfg = config.services.ezwg; cfg = config.services.ezwg;
peerNameReplacement = lib.replaceChars [ "/" "-" " " "+" "=" ] [ peerNameReplacement = lib.replaceChars [ "/" "-" " " "+" "=" ] [
@ -15,8 +11,10 @@ with lib; let
"\\x3d" "\\x3d"
]; ];
ranges = serverIPs: let ranges = serverIPs:
generateRangesScript = builtins.toFile "exclusionary-wildcard-ranges-generator.py" '' let
generateRangesScript =
builtins.toFile "exclusionary-wildcard-ranges-generator.py" ''
import ipaddress import ipaddress
serverNetworks = [${map (ip: "ip_network('${ip}/32')") serverIPs}] serverNetworks = [${map (ip: "ip_network('${ip}/32')") serverIPs}]
ranges = [ipaddress.ip_network('0.0.0.0/0')] ranges = [ipaddress.ip_network('0.0.0.0/0')]
@ -30,8 +28,10 @@ with lib; let
in in
lib.splitString ":" (builtins.readFile "${rangesOutput}"); lib.splitString ":" (builtins.readFile "${rangesOutput}");
subnet = vlanIP: vlanSize: let subnet = vlanIP: vlanSize:
generateSubnetScript = builtins.toFile "subnet-without-host-bits-generator.py" '' let
generateSubnetScript =
builtins.toFile "subnet-without-host-bits-generator.py" ''
import ipaddress import ipaddress
n1 = ipaddress.ip_network('${vlanIP}/${toString vlanSize}', False) n1 = ipaddress.ip_network('${vlanIP}/${toString vlanSize}', False)
print(n1, end="") print(n1, end="")
@ -88,7 +88,8 @@ with lib; let
description = "The IP to use on the wg VLAN"; description = "The IP to use on the wg VLAN";
}; };
}; };
in { in
{
options.services.ezwg = { options.services.ezwg = {
enable = mkEnableOption "Enable simple Wireguard connection"; enable = mkEnableOption "Enable simple Wireguard connection";
instances = mkOption { instances = mkOption {
@ -101,51 +102,40 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.checkReversePath = false; networking.firewall.checkReversePath = false;
systemd.paths = systemd.paths = mapAttrs'
mapAttrs'
(instName: inst: { (instName: inst: {
name = "wireguard-${instName}"; name = "wireguard-${instName}";
value = value = if inst.autoStart then { } else { wantedBy = mkForce [ ]; };
if inst.autoStart
then {}
else {wantedBy = mkForce [];};
}) })
cfg.instances; cfg.instances;
systemd.services = lib.listToAttrs (flatten (mapAttrsToList systemd.services = lib.listToAttrs (flatten (mapAttrsToList
(instName: inst: (instName: inst:
[ [{
{
name = "wireguard-${instName}"; name = "wireguard-${instName}";
value = value = if inst.autoStart then { } else { wantedBy = mkForce [ ]; };
if inst.autoStart }] ++ map
then {}
else {wantedBy = mkForce [];};
}
]
++ map
(server: { (server: {
name = "wireguard-${instName}-peer${peerNameReplacement server.publicKey}"; name =
value = "wireguard-${instName}-peer${peerNameReplacement server.publicKey}";
if inst.autoStart value = if inst.autoStart then { } else { wantedBy = mkForce [ ]; };
then {}
else {wantedBy = mkForce [];};
}) })
inst.servers) inst.servers)
cfg.instances)); cfg.instances));
networking.wireguard.interfaces = networking.wireguard.interfaces = mapAttrs
mapAttrs (instName: inst:
(instName: inst: let let
allowedIPs = allowedIPs =
if inst.proxy if inst.proxy then
then ranges (map (s: s.ip) inst.servers) ranges (map (s: s.ip) inst.servers)
else [(subnet inst.vlanIP inst.vlanSize)]; else
in { [ (subnet inst.vlanIP inst.vlanSize) ];
in
{
ips = [ "${inst.vlanIP}/${toString inst.vlanSize}" ]; ips = [ "${inst.vlanIP}/${toString inst.vlanSize}" ];
privateKeyFile = inst.privateKeyFile; privateKeyFile = inst.privateKeyFile;
peers = peers = map
map
(server: { (server: {
inherit allowedIPs; inherit allowedIPs;
publicKey = server.publicKey; publicKey = server.publicKey;
@ -155,5 +145,6 @@ in {
inst.servers; inst.servers;
}) })
cfg.instances; cfg.instances;
}; };
} }

View File

@ -1,23 +1,17 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let
pkgs,
...
}:
with lib; let
cfg = config.fuckingprint; cfg = config.fuckingprint;
fixPlatforms = p: fixPlatforms = p:
p.overrideAttrs (super: p.overrideAttrs (super:
super super // {
// { meta = super.meta // {
meta =
super.meta
// {
platforms = super.meta.platforms ++ [ "x86_64-linux" ]; platforms = super.meta.platforms ++ [ "x86_64-linux" ];
}; };
}); });
in { in
{
options.fuckingprint.enable = mkEnableOption "Make my fucking printer work"; options.fuckingprint.enable = mkEnableOption "Make my fucking printer work";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@ -1,11 +1,6 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let cfg = config.services.kiosk;
pkgs,
...
}:
with lib; let
cfg = config.services.kiosk;
in { in {
options.services.kiosk = { options.services.kiosk = {
enable = mkEnableOption "Enable simple kiosk display"; enable = mkEnableOption "Enable simple kiosk display";
@ -65,14 +60,10 @@ in {
}; };
}; };
displayManager.xserverArgs = displayManager.xserverArgs = if cfg.cursor then [ ] else [ "-nocursor" ];
if cfg.cursor
then []
else ["-nocursor"];
displayManager.defaultSession = "kiosk+ratpoison"; displayManager.defaultSession = "kiosk+ratpoison";
desktopManager.session = [ desktopManager.session = [{
{
name = "kiosk"; name = "kiosk";
start = '' start = ''
# dont blank the screen after 5min # dont blank the screen after 5min
@ -83,8 +74,7 @@ in {
${cfg.session} ${cfg.session}
''; '';
} }];
];
}; };
}; };
} }

View File

@ -1,11 +1,6 @@
{ { config, lib, pkgs, ... }:
config, with lib;
lib, let cfg = config.workstation;
pkgs,
...
}:
with lib; let
cfg = config.workstation;
in { in {
options.workstation = { options.workstation = {
enable = mkEnableOption "make my computer work"; enable = mkEnableOption "make my computer work";
@ -180,18 +175,14 @@ in {
"lp" "lp"
]; ];
subUidRanges = [ subUidRanges = [{
{
startUid = 100000; startUid = 100000;
count = 65536; count = 65536;
} }];
]; subGidRanges = [{
subGidRanges = [
{
startGid = 100000; startGid = 100000;
count = 65536; count = 65536;
} }];
];
}; };
# brightness # brightness

View File

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
users.users.chekkie = { users.users.chekkie = {
isNormalUser = true; isNormalUser = true;
useDefaultShell = true; useDefaultShell = true;

View File

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
# config for me # config for me
users.users.glooder = { users.users.glooder = {
isNormalUser = true; isNormalUser = true;

View File

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
nix.trustedUsers = [ "notgne2" ]; nix.trustedUsers = [ "notgne2" ];
users.users.notgne2 = { users.users.notgne2 = {