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,11 +1,7 @@
{ config, pkgs, lib, options, ... }:
{ {
config, imports = [ ./modules ];
pkgs,
lib,
options,
...
}: {
imports = [./modules];
config = { config = {
services.haveged.enable = lib.mkDefault true; services.haveged.enable = lib.mkDefault true;
@ -38,7 +34,7 @@
daemonIOSchedPriority = lib.mkDefault 7; daemonIOSchedPriority = lib.mkDefault 7;
daemonIOSchedClass = lib.mkDefault "idle"; daemonIOSchedClass = lib.mkDefault "idle";
daemonCPUSchedPolicy = lib.mkDefault "idle"; daemonCPUSchedPolicy = lib.mkDefault "idle";
trustedUsers = ["root" "builder" "@wheel"]; trustedUsers = [ "root" "builder" "@wheel" ];
extraOptions = '' extraOptions = ''
builders-use-substitutes = true builders-use-substitutes = true
@ -104,7 +100,7 @@
# Use a firewall # Use a firewall
networking.firewall.enable = lib.mkDefault true; networking.firewall.enable = lib.mkDefault true;
networking.firewall.allowPing = true; networking.firewall.allowPing = true;
networking.firewall.allowedTCPPorts = lib.mkDefault [22]; networking.firewall.allowedTCPPorts = lib.mkDefault [ 22 ];
programs.fish.enable = lib.mkDefault true; programs.fish.enable = lib.mkDefault true;
users.defaultUserShell = lib.mkOverride 900 pkgs.fish; users.defaultUserShell = lib.mkOverride 900 pkgs.fish;

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,10 +1,8 @@
inputs: { inputs:
config, { config, lib, pkgs, ... }:
lib,
pkgs, {
... imports = [ (import ./modules inputs) ];
}: {
imports = [(import ./modules inputs)];
programs.direnv = { programs.direnv = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
@ -54,7 +52,7 @@ inputs: {
notify-desktop notify-desktop
]; ];
home.sessionVariables = {TERM = "xterm-256color";}; home.sessionVariables = { TERM = "xterm-256color"; };
programs.fish = { programs.fish = {
enable = true; enable = true;
@ -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,81 +1,62 @@
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:
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c; let
ss = builtins.elemAt s'; s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
o = ss = builtins.elemAt s';
if ss 0 == null o = if ss 0 == null then 3 else 0;
then 3 in
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); };
};
hexToRgb = c: builtins.mapAttrs (_: calc) (splitHex c); hexToRgb = c: builtins.mapAttrs (_: calc) (splitHex c);
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 {
name = "base16-generated"; # TODO add template name
inherit src; name = "base16-generated";
data = pkgs.writeText "base16-generated-data" (builtins.toJSON scheme); inherit src;
phases = ["buildPhase"]; data = pkgs.writeText "base16-generated-data" (builtins.toJSON scheme);
buildPhase = "${pkgs.mustache-go}/bin/mustache $data $src > $out"; phases = [ "buildPhase" ];
}; 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,262 +125,259 @@ in {
}; };
}; };
config = let config =
colorsJson = builtins.toFile "colors.json" (builtins.toJSON cfg.base16); let
themeHashOut = pkgs.runCommand "theme-hash" {} '' colorsJson = builtins.toFile "colors.json" (builtins.toJSON cfg.base16);
cat ${colorsJson} | ${pkgs.coreutils}/bin/sha256sum | ${pkgs.coreutils}/bin/head -c 8 > $out themeHashOut = pkgs.runCommand "theme-hash" { } ''
''; cat ${colorsJson} | ${pkgs.coreutils}/bin/sha256sum | ${pkgs.coreutils}/bin/head -c 8 > $out
themeHash = builtins.readFile themeHashOut; '';
themeHash = builtins.readFile themeHashOut;
i3config = { i3config = {
config = { config = {
colors = { colors = {
background = "#${cfg.base16.base07}"; background = "#${cfg.base16.base07}";
focused = { focused = {
border = "#${cfg.base16.base05}"; border = "#${cfg.base16.base05}";
background = "#${cfg.base16.base0D}"; background = "#${cfg.base16.base0D}";
text = "#${cfg.base16.base00}"; text = "#${cfg.base16.base00}";
indicator = "#${cfg.base16.base0D}"; indicator = "#${cfg.base16.base0D}";
childBorder = "#${cfg.base16.base0D}"; childBorder = "#${cfg.base16.base0D}";
};
focusedInactive = {
border = "#${cfg.base16.base01}";
background = "#${cfg.base16.base01}";
text = "#${cfg.base16.base05}";
indicator = "#${cfg.base16.base03}";
childBorder = "#${cfg.base16.base01}";
};
unfocused = {
border = "#${cfg.base16.base01}";
background = "#${cfg.base16.base00}";
text = "#${cfg.base16.base05}";
indicator = "#${cfg.base16.base01}";
childBorder = "#${cfg.base16.base01}";
};
urgent = {
border = "#${cfg.base16.base08}";
background = "#${cfg.base16.base08}";
text = "#${cfg.base16.base00}";
indicator = "#${cfg.base16.base08}";
childBorder = "#${cfg.base16.base08}";
};
placeholder = {
border = "#${cfg.base16.base00}";
background = "#${cfg.base16.base00}";
text = "#${cfg.base16.base05}";
indicator = "#${cfg.base16.base00}";
childBorder = "#${cfg.base16.base00}";
};
};
};
};
elementTheme = {
name = "colors-${themeHash}";
is_dark = true;
colors = {
# "accent-color" = "#${cfg.base16.base02}";
# "primary-color" = "#${cfg.base16.base08}";
# "warning-color" = "#${cfg.base16.base0F}";
# "sidebar-color" = "#${cfg.base16.base01}";
# "roomlist-background-color" = "#${cfg.base16.base00}";
# "roomlist-text-color" = "#${cfg.base16.base05}";
# "roomlist-text-secondary-color" = "${cfg.base16.base06}";
# "roomlist-highlights-color" = "#${cfg.base16.base02}";
# "roomlist-separator-color" = "#${cfg.base16.base05}";
# "timeline-background-color" = "#${cfg.base16.base00}";
# "timeline-text-color" = "#${cfg.base16.base07}";
# "timeline-text-secondary-color" = "#${cfg.base16.base05}";
# "timeline-highlights-color" = "#${cfg.base16.base02}";
# "reaction-row-button-selected-bg-color" = "#${cfg.base16.base0B}";
"accent-color" = "#${cfg.base16.base02}";
"accent" = "#${cfg.base16.base02}";
"primary-color" = "#${cfg.base16.base0B}";
"warning-color" = "#${cfg.base16.base08}";
"alert" = "#${cfg.base16.base08}";
"sidebar-color" = "#${cfg.base16.base00}";
"roomlist-background-color" = "#${cfg.base16.base01}";
"roomlist-text-color" = "#${cfg.base16.base05}";
"roomlist-text-secondary-color" = "${cfg.base16.base09}";
"roomlist-highlights-color" = "#${cfg.base16.base08}";
"roomlist-separator-color" = "#${cfg.base16.base05}";
"timeline-background-color" = "#${cfg.base16.base00}";
"timeline-text-color" = "#${cfg.base16.base05}";
"secondary-content" = "#${cfg.base16.base05}";
"tertiary-content" = "#${cfg.base16.base05}";
"timeline-text-secondary-color" = "#${cfg.base16.base06}";
"timeline-highlights-color" = "#${cfg.base16.base03}";
"reaction-row-button-selected-bg-color" = "#${cfg.base16.base04}";
"menu-selected-color" = "#${cfg.base16.base04}";
"focus-bg-color" = "#${cfg.base16.base04}";
"room-highlight-color" = "#${cfg.base16.base04}";
"other-user-pill-bg-color" = "#${cfg.base16.base04}";
"togglesw-off-color" = "#${cfg.base16.base04}";
"username-colors" = ["#${cfg.base16.base08}" "#${cfg.base16.base09}" "#${cfg.base16.base0A}" "#${cfg.base16.base0B}" "#${cfg.base16.base0C}" "#${cfg.base16.base0D}" "#${cfg.base16.base0E}" "#${cfg.base16.base0F}"];
# "avatar-background-colors" = [ "#${cfg.base16.base03}" "#${cfg.base16.base04}" "#${cfg.base16.base05}" ];
};
};
elementConfig = {
settingDefaults.custom_themes = [elementTheme];
settingDefaults.theme = "${elementTheme.name}";
default_theme = "${elementTheme.name}";
showLabsSettings = true;
show_labs_settings = true;
};
base16FromImageSrc = pkgs.runCommand "auto-image-base16" {} ''
${schemer2}/bin/schemer2 -format img::colors -in ${cfg.baseColors} -out colors.txt && ${pkgs.python3}/bin/python3 ${inputs.auto-base16-theme}/AutoBase16Theme.py ${inputs.auto-base16-theme}/templates/base16-template.yaml auto-image-base16.yaml
${pkgs.yaml2json}/bin/yaml2json < auto-image-base16.yaml > $out
'';
base16FromImage = lib.filterAttrs (k: v: k != "scheme" && k != "author") (builtins.fromJSON (builtins.readFile base16FromImageSrc));
in
mkMerge [
(mkIf cfg.enable {
# Read only utility attributes
ezcolors.base16 =
if builtins.typeOf cfg.baseColors == "set"
then cfg.baseColors
else base16FromImage;
ezcolors.base16Rgb = builtins.mapAttrs (n: c: hexToRgb c) cfg.base16;
ezcolors.base16Split = builtins.mapAttrs (n: c: splitHex c) cfg.base16;
# Element
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
# And in case you want to do something with the generated theme yourself
xdg.configFile."Riot/theme.json".text = builtins.toJSON elementTheme;
xdg.configFile."Element/theme.json".text = builtins.toJSON elementTheme;
# Mako
programs.mako = {
backgroundColor = "#${cfg.base16.base00}";
textColor = "#${cfg.base16.base07}";
borderColor = "#${cfg.base16.base08}";
progressColor = "over #${cfg.base16.base0D}";
};
# I3/sway
wayland.windowManager.sway = i3config;
xsession.windowManager.i3 = i3config;
# Dunst
services.dunst = {
settings = {
global = {
frame_color = "#${cfg.base16.base09}";
separator_color = "#${cfg.base16.base05}";
}; };
focusedInactive = {
urgency_low = { border = "#${cfg.base16.base01}";
background = "#${cfg.base16.base01}"; background = "#${cfg.base16.base01}";
foreground = "#${cfg.base16.base03}"; text = "#${cfg.base16.base05}";
indicator = "#${cfg.base16.base03}";
childBorder = "#${cfg.base16.base01}";
}; };
unfocused = {
urgency_normal = { border = "#${cfg.base16.base01}";
background = "#${cfg.base16.base02}"; background = "#${cfg.base16.base00}";
foreground = "#${cfg.base16.base05}"; text = "#${cfg.base16.base05}";
indicator = "#${cfg.base16.base01}";
childBorder = "#${cfg.base16.base01}";
}; };
urgent = {
urgency_critical = { border = "#${cfg.base16.base08}";
background = "#${cfg.base16.base08}"; background = "#${cfg.base16.base08}";
foreground = "#${cfg.base16.base06}"; text = "#${cfg.base16.base00}";
indicator = "#${cfg.base16.base08}";
childBorder = "#${cfg.base16.base08}";
};
placeholder = {
border = "#${cfg.base16.base00}";
background = "#${cfg.base16.base00}";
text = "#${cfg.base16.base05}";
indicator = "#${cfg.base16.base00}";
childBorder = "#${cfg.base16.base00}";
}; };
}; };
}; };
};
# Rofi elementTheme = {
programs.rofi.theme = "${genTheme inputs.base16-rofi}"; name = "colors-${themeHash}";
is_dark = true;
colors = {
# "accent-color" = "#${cfg.base16.base02}";
# "primary-color" = "#${cfg.base16.base08}";
# "warning-color" = "#${cfg.base16.base0F}";
# Kitty # "sidebar-color" = "#${cfg.base16.base01}";
programs.kitty.extraConfig = '' # "roomlist-background-color" = "#${cfg.base16.base00}";
include ${genTheme inputs.base16-kitty} # "roomlist-text-color" = "#${cfg.base16.base05}";
''; # "roomlist-text-secondary-color" = "${cfg.base16.base06}";
# "roomlist-highlights-color" = "#${cfg.base16.base02}";
# "roomlist-separator-color" = "#${cfg.base16.base05}";
# Kermit # "timeline-background-color" = "#${cfg.base16.base00}";
programs.kermit.extraConfig = builtins.readFile (genTheme inputs.base16-kermit); # "timeline-text-color" = "#${cfg.base16.base07}";
# "timeline-text-secondary-color" = "#${cfg.base16.base05}";
# "timeline-highlights-color" = "#${cfg.base16.base02}";
# "reaction-row-button-selected-bg-color" = "#${cfg.base16.base0B}";
# neovim "accent-color" = "#${cfg.base16.base02}";
xdg.configFile."nvim/colors/base16.vim".source = "${genTheme inputs.base16-vim}"; "accent" = "#${cfg.base16.base02}";
programs.neovim.extraConfig = '' "primary-color" = "#${cfg.base16.base0B}";
colorscheme base16 "warning-color" = "#${cfg.base16.base08}";
set termguicolors "alert" = "#${cfg.base16.base08}";
'';
# GTK "sidebar-color" = "#${cfg.base16.base00}";
gtk = { "roomlist-background-color" = "#${cfg.base16.base01}";
enable = true; "roomlist-text-color" = "#${cfg.base16.base05}";
theme = let "roomlist-text-secondary-color" = "${cfg.base16.base09}";
"roomlist-highlights-color" = "#${cfg.base16.base08}";
"roomlist-separator-color" = "#${cfg.base16.base05}";
"timeline-background-color" = "#${cfg.base16.base00}";
"timeline-text-color" = "#${cfg.base16.base05}";
"secondary-content" = "#${cfg.base16.base05}";
"tertiary-content" = "#${cfg.base16.base05}";
"timeline-text-secondary-color" = "#${cfg.base16.base06}";
"timeline-highlights-color" = "#${cfg.base16.base03}";
"reaction-row-button-selected-bg-color" = "#${cfg.base16.base04}";
"menu-selected-color" = "#${cfg.base16.base04}";
"focus-bg-color" = "#${cfg.base16.base04}";
"room-highlight-color" = "#${cfg.base16.base04}";
"other-user-pill-bg-color" = "#${cfg.base16.base04}";
"togglesw-off-color" = "#${cfg.base16.base04}";
"username-colors" = [ "#${cfg.base16.base08}" "#${cfg.base16.base09}" "#${cfg.base16.base0A}" "#${cfg.base16.base0B}" "#${cfg.base16.base0C}" "#${cfg.base16.base0D}" "#${cfg.base16.base0E}" "#${cfg.base16.base0F}" ];
# "avatar-background-colors" = [ "#${cfg.base16.base03}" "#${cfg.base16.base04}" "#${cfg.base16.base05}" ];
};
};
elementConfig = {
settingDefaults.custom_themes = [ elementTheme ];
settingDefaults.theme = "${elementTheme.name}";
default_theme = "${elementTheme.name}";
showLabsSettings = true;
show_labs_settings = true;
};
base16FromImageSrc = pkgs.runCommand "auto-image-base16" { } ''
${schemer2}/bin/schemer2 -format img::colors -in ${cfg.baseColors} -out colors.txt && ${pkgs.python3}/bin/python3 ${inputs.auto-base16-theme}/AutoBase16Theme.py ${inputs.auto-base16-theme}/templates/base16-template.yaml auto-image-base16.yaml
${pkgs.yaml2json}/bin/yaml2json < auto-image-base16.yaml > $out
'';
base16FromImage = lib.filterAttrs (k: v: k != "scheme" && k != "author") (builtins.fromJSON (builtins.readFile base16FromImageSrc));
in
mkMerge [(mkIf cfg.enable {
# Read only utility attributes
ezcolors.base16 = if builtins.typeOf cfg.baseColors == "set" then cfg.baseColors else base16FromImage;
ezcolors.base16Rgb = builtins.mapAttrs (n: c: hexToRgb c) cfg.base16;
ezcolors.base16Split = builtins.mapAttrs (n: c: splitHex c) cfg.base16;
# Element
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
# And in case you want to do something with the generated theme yourself
xdg.configFile."Riot/theme.json".text = builtins.toJSON elementTheme;
xdg.configFile."Element/theme.json".text = builtins.toJSON elementTheme;
# Mako
programs.mako = {
backgroundColor = "#${cfg.base16.base00}";
textColor = "#${cfg.base16.base07}";
borderColor = "#${cfg.base16.base08}";
progressColor = "over #${cfg.base16.base0D}";
};
# I3/sway
wayland.windowManager.sway = i3config;
xsession.windowManager.i3 = i3config;
# Dunst
services.dunst = {
settings = {
global = {
frame_color = "#${cfg.base16.base09}";
separator_color = "#${cfg.base16.base05}";
};
urgency_low = {
background = "#${cfg.base16.base01}";
foreground = "#${cfg.base16.base03}";
};
urgency_normal = {
background = "#${cfg.base16.base02}";
foreground = "#${cfg.base16.base05}";
};
urgency_critical = {
background = "#${cfg.base16.base08}";
foreground = "#${cfg.base16.base06}";
};
};
};
# Rofi
programs.rofi.theme = "${genTheme inputs.base16-rofi}";
# Kitty
programs.kitty.extraConfig = ''
include ${genTheme inputs.base16-kitty}
'';
# Kermit
programs.kermit.extraConfig = builtins.readFile (genTheme inputs.base16-kermit);
# neovim
xdg.configFile."nvim/colors/base16.vim".source = "${genTheme inputs.base16-vim}";
programs.neovim.extraConfig = ''
colorscheme base16
set termguicolors
'';
# GTK
gtk = {
enable = true;
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";
kind = "dark"; kind = "dark";
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;
}; };
}; };
xdg.configFile."geary/user-style.css".text = '' xdg.configFile."geary/user-style.css".text = ''
:root, *:not(a) { :root, *:not(a) {
background-color: #${cfg.base16.base00} !important; background-color: #${cfg.base16.base00} !important;
color: #${cfg.base16.base05} !important; color: #${cfg.base16.base05} !important;
} }
''; '';
systemd.user.sessionVariables.GTK_THEME = "Generated"; systemd.user.sessionVariables.GTK_THEME = "Generated";
home.sessionVariables.GTK_THEME = "Generated"; home.sessionVariables.GTK_THEME = "Generated";
# Codium/VSCODE # Codium/VSCODE
programs.vscode.userSettings = { programs.vscode.userSettings = {
"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 { ".vscode-oss/extensions/base16-1.0.0/themes/nix-colors.json".source = genTheme inputs.base16-vscode;
".vscode-oss/extensions/base16-1.0.0/themes/nix-colors.json".source = genTheme inputs.base16-vscode; ".vscode-oss/extensions/base16-1.0.0/package.json".text = builtins.toJSON {
".vscode-oss/extensions/base16-1.0.0/package.json".text = builtins.toJSON { name = "nix colors";
name = "nix colors"; displayName = "Automatic Nix-generated base16 colors";
displayName = "Automatic Nix-generated base16 colors"; version = "1.0.0";
version = "1.0.0"; publisher = "colors";
publisher = "colors"; author = {
author = { name = "ezpc usr";
name = "ezpc usr"; email = "usr@ezpc";
email = "usr@ezpc";
};
engines.vscode = "^1.11.1";
categories = "Themes";
contributes.themes = [
{
label = "nix colors";
uiTheme = "vs-dark";
path = "./themes/nix-colors.json";
}
];
}; };
} engines.vscode = "^1.11.1";
) categories = "Themes";
]; contributes.themes = [
}) {
(mkIf (cfg.enable && cfg.plasma) { label = "nix colors";
uiTheme = "vs-dark";
path = "./themes/nix-colors.json";
}
];
};
}
)
];
}) (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 = {
ColorScheme = "Generated"; ColorScheme = "Generated";
Name = "Generated"; Name = "Generated";
@ -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";
@ -35,11 +33,64 @@ in {
''); '');
}; };
Install = rec { Install = rec {
WantedBy = ["graphical-session.target"]; WantedBy = [ "graphical-session.target" ];
}; };
}; };
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 = {
@ -108,21 +151,22 @@ in {
$DRY_RUN_CMD rm -f ~/.config/gtk-3.0/gtk.css $DRY_RUN_CMD rm -f ~/.config/gtk-3.0/gtk.css
$DRY_RUN_CMD rm -f ~/.config/gtk-4.0/gtk.css $DRY_RUN_CMD rm -f ~/.config/gtk-4.0/gtk.css
''; '';
before = ["checkLinkTargets"]; before = [ "checkLinkTargets" ];
after = []; after = [ ];
}; };
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?
@ -216,7 +257,7 @@ in {
}; };
"org/gnome/shell" = { "org/gnome/shell" = {
disable-user-extensions = false; disable-user-extensions = false;
disabled-extensions = [""]; disabled-extensions = [ "" ];
enabled-extensions = [ enabled-extensions = [
"pop-shell@system76.com" "pop-shell@system76.com"
"rrc@ogarcia.me" "rrc@ogarcia.me"
@ -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,82 +327,80 @@ in {
enabled = true; enabled = true;
}; };
"org/gnome/desktop/wm/keybindings" = let "org/gnome/desktop/wm/keybindings" =
workspaceAttrsList = lib.flatten (map let
(n: [ workspaceAttrsList = lib.flatten (map
(lib.nameValuePair "move-to-workspace-${n}" ["<Shift><Super>${n}"]) (n: [
(lib.nameValuePair "switch-to-workspace-${n}" ["<Super>${n}"]) (lib.nameValuePair "move-to-workspace-${n}" [ "<Shift><Super>${n}" ])
]) (lib.nameValuePair "switch-to-workspace-${n}" [ "<Super>${n}" ])
(map (n: toString n) (lib.range 1 9))); ])
in (map (n: toString n) (lib.range 1 9)));
lib.listToAttrs workspaceAttrsList in
// { lib.listToAttrs workspaceAttrsList // {
minimize = ["<Super>comma"]; minimize = [ "<Super>comma" ];
maximize = [""]; maximize = [ "" ];
unmaximize = [""]; unmaximize = [ "" ];
move-to-monitor-up = [""]; move-to-monitor-up = [ "" ];
move-to-monitor-down = [""]; move-to-monitor-down = [ "" ];
move-to-monitor-left = [""]; move-to-monitor-left = [ "" ];
move-to-monitor-right = [""]; move-to-monitor-right = [ "" ];
move-to-workspace-down = [""]; move-to-workspace-down = [ "" ];
move-to-workspace-up = [""]; move-to-workspace-up = [ "" ];
switch-to-workspace-down = ["<Primary><Super>Down" "<Primary><Super>j"]; switch-to-workspace-down = [ "<Primary><Super>Down" "<Primary><Super>j" ];
switch-to-workspace-up = ["<Primary><Super>Up" "<Primary><Super>k"]; switch-to-workspace-up = [ "<Primary><Super>Up" "<Primary><Super>k" ];
toggle-maximized = ["<Super>m"]; toggle-maximized = [ "<Super>m" ];
close = ["<Super>q"]; close = [ "<Super>q" ];
cycle-windows = [""]; cycle-windows = [ "" ];
panel-run-dialog = ["<Super>d"]; panel-run-dialog = [ "<Super>d" ];
move-to-workspace-right = [""]; move-to-workspace-right = [ "" ];
move-to-workspace-left = [""]; move-to-workspace-left = [ "" ];
switch-to-workspace-right = [""]; switch-to-workspace-right = [ "" ];
switch-to-workspace-left = [""]; switch-to-workspace-left = [ "" ];
# And deal with the remaining alt keys, screw alt keys # And deal with the remaining alt keys, screw alt keys
cycle-windows-backward = [""]; cycle-windows-backward = [ "" ];
activate-window-menu = [""]; activate-window-menu = [ "" ];
cycle-panels = [""]; cycle-panels = [ "" ];
cycle-panels-backward = [""]; cycle-panels-backward = [ "" ];
switch-panels = [""]; switch-panels = [ "" ];
switch-panels-backward = [""]; switch-panels-backward = [ "" ];
switch-applications = ["<Super>Tab"]; switch-applications = [ "<Super>Tab" ];
switch-applications-backward = ["<Shift><Super>Tab"]; switch-applications-backward = [ "<Shift><Super>Tab" ];
cycle-group = [""]; cycle-group = [ "" ];
cycle-group-backward = [""]; cycle-group-backward = [ "" ];
switch-group = [""]; switch-group = [ "" ];
switch-group-backward = [""]; switch-group-backward = [ "" ];
begin-resize = [""]; begin-resize = [ "" ];
begin-move = [""]; begin-move = [ "" ];
}; };
"org/gnome/mutter/keybindings" = { "org/gnome/mutter/keybindings" = {
toggle-tiled-left = [""]; toggle-tiled-left = [ "" ];
toggle-tiled-right = [""]; toggle-tiled-right = [ "" ];
}; };
"org/gnome/mutter/wayland/keybindings" = { "org/gnome/mutter/wayland/keybindings" = {
restore-shortcuts = [""]; restore-shortcuts = [ "" ];
};
"org/gnome/shell/keybindings" = lib.listToAttrs (map (n: lib.nameValuePair "switch-to-application-${toString n}" [ "" ]) (lib.range 1 9)) // {
open-application-menu = [ "" ];
toggle-message-tray = [ "<Super>v" ];
toggle-overview = [ "" ];
}; };
"org/gnome/shell/keybindings" =
lib.listToAttrs (map (n: lib.nameValuePair "switch-to-application-${toString n}" [""]) (lib.range 1 9))
// {
open-application-menu = [""];
toggle-message-tray = ["<Super>v"];
toggle-overview = [""];
};
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {
play = ["<Super>backslash"]; play = [ "<Super>backslash" ];
next = ["<Super>bracketright"]; next = [ "<Super>bracketright" ];
previous = ["<Super>bracketleft"]; previous = [ "<Super>bracketleft" ];
volume-down = ["<Super>minus"]; volume-down = [ "<Super>minus" ];
volume-up = ["<Super>equal"]; volume-up = [ "<Super>equal" ];
screensaver = ["<Super>Escape"]; screensaver = [ "<Super>Escape" ];
home = ["<Super>f"]; home = [ "<Super>f" ];
email = ["<Super>e"]; email = [ "<Super>e" ];
www = ["<Super>b"]; www = [ "<Super>b" ];
rotate-video-lock-static = [""]; rotate-video-lock-static = [ "" ];
screenshot-clip = ["Print"]; screenshot-clip = [ "Print" ];
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>t"; binding = "<Super>t";

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";
}; };
@ -133,21 +133,21 @@ in {
shortcuts = { shortcuts = {
"org.kde.krunner.desktop"."_launch" = ["Meta+D" "Search" "Alt+Space"]; "org.kde.krunner.desktop"."_launch" = ["Meta+D" "Search" "Alt+Space"];
"org.kde.plasma.emojier.desktop"."_launch" = []; "org.kde.plasma.emojier.desktop"."_launch" = [ ];
plasmashell = { plasmashell = {
"activate task manager entry 1" = []; "activate task manager entry 1" = [ ];
"activate task manager entry 2" = []; "activate task manager entry 2" = [ ];
"activate task manager entry 3" = []; "activate task manager entry 3" = [ ];
"activate task manager entry 4" = []; "activate task manager entry 4" = [ ];
"activate task manager entry 5" = []; "activate task manager entry 5" = [ ];
"activate task manager entry 6" = []; "activate task manager entry 6" = [ ];
"activate task manager entry 7" = []; "activate task manager entry 7" = [ ];
"activate task manager entry 8" = []; "activate task manager entry 8" = [ ];
"activate task manager entry 9" = []; "activate task manager entry 9" = [ ];
"activate task manager entry 10" = []; "activate task manager entry 10" = [ ];
"next activity" = []; "next activity" = [ ];
"manage activities" = []; "manage activities" = [ ];
}; };
kwin = { kwin = {
@ -183,11 +183,11 @@ in {
view_zoom_out = "Meta+_"; view_zoom_out = "Meta+_";
"Window to Next Screen" = "Meta+>"; "Window to Next Screen" = "Meta+>";
"Window to Previous Screen" = "Meta+<"; "Window to Previous Screen" ="Meta+<";
"Switch to Next Screen" = "Meta+."; "Switch to Next Screen" = "Meta+.";
"Switch to Previous Screen" = "Meta+,"; "Switch to Previous Screen" ="Meta+,";
"Show Desktop" = []; "Show Desktop" = [ ];
"Window On All Desktops" = "Meta+A"; "Window On All Desktops" = "Meta+A";
}; };
@ -220,21 +220,21 @@ in {
push_window_to_master = "Meta+M"; push_window_to_master = "Meta+M";
move_window_to_next_pos = []; move_window_to_next_pos = [ ];
move_window_to_prev_pos = []; move_window_to_prev_pos = [ ];
decrease_master_win_count = []; decrease_master_win_count = [ ];
increase_master_win_count = []; increase_master_win_count = [ ];
rotate = []; rotate = [ ];
rotate_part = []; rotate_part = [ ];
rotate_reverse = []; rotate_reverse = [ ];
toggle_float_layout = []; toggle_float_layout = [ ];
toggle_monocle_layout = []; toggle_monocle_layout = [ ];
toggle_quarter_layout = []; toggle_quarter_layout = [ ];
toggle_spiral_layout = []; toggle_spiral_layout = [ ];
toggle_spread_layout = []; toggle_spread_layout = [ ];
toggle_stair_layout = []; toggle_stair_layout = [ ];
toggle_three_column_layout = []; toggle_three_column_layout = [ ];
toggle_tile_layout = []; toggle_tile_layout = [ ];
}; };
}; };
}; };
@ -247,11 +247,65 @@ in {
''); '');
}; };
Install = rec { Install = rec {
WantedBy = ["graphical-session.target"]; WantedBy = [ "graphical-session.target" ];
}; };
}; };
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,12 +1,10 @@
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" ])
(import ./ezpcusr.nix inputs) (import ./ezpcusr.nix inputs)
(import ./colors.nix inputs) (import ./colors.nix inputs)

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,42 +57,41 @@ 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 ln -s ${getscrloc} $out/bin/getscrloc
ln -s ${getscrloc} $out/bin/getscrloc 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 ''
+ ( ln -s ${cfg.uploadScript} $out/bin/upload_file
if cfg.uploadScript != null
then ''
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 {
@ -107,18 +102,18 @@ in {
outputOptions = mkOption { outputOptions = mkOption {
description = "Additional output options"; description = "Additional output options";
default = {}; default = { };
type = types.attrsOf (types.attrsOf types.str); type = types.attrsOf (types.attrsOf types.str);
}; };
waybarConfig = mkOption { waybarConfig = mkOption {
description = "Waybar config"; description = "Waybar config";
default = {}; default = { };
}; };
screensaver = mkOption { screensaver = mkOption {
description = "ezpcusr screensaver"; description = "ezpcusr screensaver";
default = {}; default = { };
type = types.submodule { type = types.submodule {
options = { options = {
enable = mkOption { enable = mkOption {
@ -142,7 +137,7 @@ in {
favIcons = mkOption { favIcons = mkOption {
description = "Your favourite icons pack"; description = "Your favourite icons pack";
default = {}; default = { };
type = types.submodule { type = types.submodule {
options = { options = {
name = mkOption { name = mkOption {
@ -199,76 +194,64 @@ in {
modifier = lib.mkDefault "Mod4"; modifier = lib.mkDefault "Mod4";
keybindings = let keybindings =
# ugly stupid way of doing things but im lazy let
bwRofi = pkgs.writeScript "bw-rofi" '' # ugly stupid way of doing things but im lazy
#!${pkgs.bash}/bin/bash bwRofi = pkgs.writeScript "bw-rofi" ''
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items) #!${pkgs.bash}/bin/bash
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"') LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i) CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1) NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1)
NTH=$(expr $NUMBER - 1) NTH=$(expr $NUMBER - 1)
echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].login.password" | ${pkgs.wl-clipboard}/bin/wl-copy echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].login.password" | ${pkgs.wl-clipboard}/bin/wl-copy
''; '';
# very ugly stupid way of doing things but im still lazy # very ugly stupid way of doing things but im still lazy
bwRofiOtp = pkgs.writeScript "bw-rofi-otp" '' bwRofiOtp = pkgs.writeScript "bw-rofi-otp" ''
#!${pkgs.bash}/bin/bash #!${pkgs.bash}/bin/bash
LIST=$(${pkgs.bitwarden-cli}/bin/bw list items) LIST=$(${pkgs.bitwarden-cli}/bin/bw list items)
USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"') USERLIST=$(echo "$LIST" | ${pkgs.jq}/bin/jq -r '.[] | "\(.name) - \(.login.username)"')
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i) CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1) NUMBER=$(echo "$USERLIST" | grep -n "^$CHOSEN$" | cut -d':' -f1)
NTH=$(expr $NUMBER - 1) NTH=$(expr $NUMBER - 1)
ID=$(echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].id") ID=$(echo "$LIST" | ${pkgs.jq}/bin/jq -j -r ".[$NTH].id")
${pkgs.bitwarden-cli}/bin/bw get totp $ID | ${pkgs.wl-clipboard}/bin/wl-copy ${pkgs.bitwarden-cli}/bin/bw get totp $ID | ${pkgs.wl-clipboard}/bin/wl-copy
''; '';
emojiRofi = pkgs.writeScript "rofi-emoji" '' emojiRofi = pkgs.writeScript "rofi-emoji" ''
line=$(${pkgs.coreutils}/bin/cat ${toString ../data/emojis.txt} | ${pkgs.rofi}/bin/rofi -dmenu -i) line=$(${pkgs.coreutils}/bin/cat ${toString ../data/emojis.txt} | ${pkgs.rofi}/bin/rofi -dmenu -i)
${pkgs.coreutils}/bin/echo ''${line::1} | ${pkgs.wl-clipboard}/bin/wl-copy ${pkgs.coreutils}/bin/echo ''${line::1} | ${pkgs.wl-clipboard}/bin/wl-copy
''; '';
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)}"; (lib.lists.range 11 (10 * (builtins.length alphabet) + 10))
value = "${
if move
then "move container to "
else ""
}workspace ${toString n}";
}
)
(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,58 +296,66 @@ 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" =
ripMusicAdvanced = pkgs.writeShellScript "rip-music-advanced.sh" '' let
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current) ripMusicAdvanced = pkgs.writeShellScript "rip-music-advanced.sh" ''
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT) CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
PARAMS=$(${pkgs.rofi}/bin/rofi -dmenu) URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$PARAMS" PARAMS=$(${pkgs.rofi}/bin/rofi -dmenu)
''; echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED" "$PARAMS"
in "exec ${ripMusicAdvanced}"; '';
"${modifier}+Ctrl+m" = let in
ripMusic = pkgs.writeShellScript "rip-music.sh" '' "exec ${ripMusicAdvanced}";
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current) "${modifier}+Ctrl+m" =
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT) let
ripMusic = pkgs.writeShellScript "rip-music.sh" ''
CURRENT=$(${pkgs.mpc_cli}/bin/mpc -f '%file%' current)
URLIFIED=$(${pkgs.gnused}/bin/sed 's/youtube:video:/https:\/\/youtube.com\/watch?v=/'<<<$CURRENT)
DL_OUT=$(echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED") DL_OUT=$(echo y | ${inputs.mudl.defaultPackage.${pkgs.system}}/bin/mudl "$URLIFIED")
if echo "$DL_OUT" | ${pkgs.gnugrep}/bin/grep -qE 'Album: $'; then if echo "$DL_OUT" | ${pkgs.gnugrep}/bin/grep -qE 'Album: $'; then
${pkgs.libnotify}/bin/notify-send mudl 'Album name required' ${pkgs.libnotify}/bin/notify-send mudl 'Album name required'
ALBUM=$(${pkgs.rofi}/bin/rofi -dmenu) ALBUM=$(${pkgs.rofi}/bin/rofi -dmenu)
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" =
musicRofi = pkgs.writeShellScript "music-rofi" '' let
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) musicRofi = pkgs.writeShellScript "music-rofi" ''
[ ! -z "$SONGN" ] && ${pkgs.mpc_cli}/bin/mpc play "$SONGN" 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"
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" =
mopidySearch = pkgs.writeShellScript "mopidy-search.sh" '' let
QUERY=$(${pkgs.rofi}/bin/rofi -dmenu) mopidySearch = pkgs.writeShellScript "mopidy-search.sh" ''
[ -z "$QUERY" ] && exit QUERY=$(${pkgs.rofi}/bin/rofi -dmenu)
RESULTS=$(${pkgs.mpc_cli}/bin/mpc search -f '%file% / %artist% - %title%' any "$QUERY") [ -z "$QUERY" ] && exit
USERLIST=$(echo "$RESULTS" | ${pkgs.gawk}/bin/awk -F' / ' '{print $2}') RESULTS=$(${pkgs.mpc_cli}/bin/mpc search -f '%file% / %artist% - %title%' any "$QUERY")
USERLIST=$(echo "$RESULTS" | ${pkgs.gawk}/bin/awk -F' / ' '{print $2}')
CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i) CHOSEN=$(echo "$USERLIST" | ${pkgs.rofi}/bin/rofi -dmenu -i)
[ -z "$CHOSEN" ] && exit [ -z "$CHOSEN" ] && exit
NTH=$(echo "$USERLIST" | ${pkgs.gnugrep}/bin/grep -n "^$CHOSEN$" | cut -d':' -f1) NTH=$(echo "$USERLIST" | ${pkgs.gnugrep}/bin/grep -n "^$CHOSEN$" | cut -d':' -f1)
LINE=$(echo "$RESULTS" | ${pkgs.coreutils}/bin/tail "-n+$NTH" | ${pkgs.coreutils}/bin/head -1) LINE=$(echo "$RESULTS" | ${pkgs.coreutils}/bin/tail "-n+$NTH" | ${pkgs.coreutils}/bin/head -1)
NAME=$(echo "$LINE" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}') NAME=$(echo "$LINE" | ${pkgs.gawk}/bin/awk -F' / ' '{print $1}')
${pkgs.mpc_cli}/bin/mpc add "$NAME" ${pkgs.mpc_cli}/bin/mpc add "$NAME"
PLAYLIST=$(${pkgs.mpc_cli}/bin/mpc -f "%position% / %file%" playlist) PLAYLIST=$(${pkgs.mpc_cli}/bin/mpc -f "%position% / %file%" playlist)
PLAYLIST_ENTRY=$(echo "$PLAYLIST" | ${pkgs.gnugrep}/bin/grep -E "^.* / $NAME$" | head -1) PLAYLIST_ENTRY=$(echo "$PLAYLIST" | ${pkgs.gnugrep}/bin/grep -E "^.* / $NAME$" | head -1)
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}";
@ -376,7 +372,7 @@ in {
menu = "${pkgs.rofi}/bin/rofi -show drun -show-icons -run-command '${pkgs.sway}/bin/swaymsg exec -- {cmd}'"; menu = "${pkgs.rofi}/bin/rofi -show drun -show-icons -run-command '${pkgs.sway}/bin/swaymsg exec -- {cmd}'";
bars = []; bars = [ ];
gaps = { gaps = {
smartGaps = lib.mkDefault true; smartGaps = lib.mkDefault true;
@ -402,107 +398,107 @@ in {
settings = [ settings = [
({ ({
position = "left"; position = "left";
height = null; height = null;
modules-left = ["sway/workspaces" "custom/spacer" "custom/weather-temp" "custom/weather-precip" "custom/weather-wind"]; modules-left = [ "sway/workspaces" "custom/spacer" "custom/weather-temp" "custom/weather-precip" "custom/weather-wind" ];
modules-center = ["clock#1" "clock#2" "custom/spacer" "custom/media" "custom/spacer" "clock#3" "custom/spacer" "clock#4"]; modules-center = [ "clock#1" "clock#2" "custom/spacer" "custom/media" "custom/spacer" "clock#3" "custom/spacer" "clock#4" ];
modules-right = ["pulseaudio" "custom/spacer" "memory" "custom/spacer" "cpu"] ++ lib.optionals cfg.battery ["custom/spacer" "battery"] ++ ["custom/spacer" "tray"]; modules-right = [ "pulseaudio" "custom/spacer" "memory" "custom/spacer" "cpu" ] ++ lib.optionals cfg.battery [ "custom/spacer" "battery" ] ++ [ "custom/spacer" "tray" ];
modules = { modules = {
"custom/spacer" = { "custom/spacer" = {
format = ""; format = "";
rotate = 90; rotate = 90;
tooltip = false; tooltip = false;
};
"custom/weather-temp" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t' || echo ERR";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-precip" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧+%p'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-wind" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬+%w'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/media" = {
rotate = 90;
max-length = 60;
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
exec = "${pkgs.playerctl}/bin/playerctl metadata --format '{{ emoji(status) }} {{ artist }} - {{ title }}' --follow";
};
"sway/workspaces" = {
disable-scroll = true;
};
"clock#1" = {
tooltip = false;
format = "{:%a}";
};
"clock#2" = {
tooltip = false;
format = "{:%m-%d}";
};
"clock#3" = {
tooltip = false;
format = "{:%I:%M %p}";
};
"clock#4" = {
tooltip = false;
timezone = "Etc/UTC";
format = "{:%H:%M} UTC";
};
pulseaudio = {
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphone = "";
default = "";
};
on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol";
};
memory = {
interval = 20;
format = " {}%";
};
cpu = {
interval = 20;
format = " {usage}%";
};
battery = {
states = {
good = 90;
warning = 25;
critical = 10;
};
format = "{icon} {capacity}%";
format-icons = ["" "" "" "" ""];
};
tray = {
icon-size = 18;
spacing = 5;
};
}; };
}
// cfg.waybarConfig) "custom/weather-temp" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=%c+%t' || echo ERR";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://weather.com/weather/today/l/85625'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-precip" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌧+%p'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.lightningmaps.org/'";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/weather-wind" = {
exec = "${pkgs.curl}/bin/curl 'wttr.in/${cfg.location}?format=🌬+%w'";
on-click = "${pkgs.xdg-utils}/bin/xdg-open 'https://www.ventusky.com/";
on-click-right = "${pkgs.xdg-utils}/bin/xdg-open 'https://wttr.in/${cfg.location}'";
interval = 900;
};
"custom/media" = {
rotate = 90;
max-length = 60;
on-click = "${pkgs.playerctl}/bin/playerctl play-pause";
exec = "${pkgs.playerctl}/bin/playerctl metadata --format '{{ emoji(status) }} {{ artist }} - {{ title }}' --follow";
};
"sway/workspaces" = {
disable-scroll = true;
};
"clock#1" = {
tooltip = false;
format = "{:%a}";
};
"clock#2" = {
tooltip = false;
format = "{:%m-%d}";
};
"clock#3" = {
tooltip = false;
format = "{:%I:%M %p}";
};
"clock#4" = {
tooltip = false;
timezone = "Etc/UTC";
format = "{:%H:%M} UTC";
};
pulseaudio = {
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphone = "";
default = "";
};
on-click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol";
};
memory = {
interval = 20;
format = " {}%";
};
cpu = {
interval = 20;
format = " {usage}%";
};
battery = {
states = {
good = 90;
warning = 25;
critical = 10;
};
format = "{icon} {capacity}%";
format-icons = [ "" "" "" "" "" ];
};
tray = {
icon-size = 18;
spacing = 5;
};
};
} // cfg.waybarConfig)
]; ];
style = '' style = ''
@ -585,7 +581,7 @@ in {
programs.mako = { programs.mako = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
maxVisible = lib.mkDefault 6; maxVisible = lib.mkDefault 6;
extraConfig = lib.generators.toKeyValue {} { extraConfig = lib.generators.toKeyValue { } {
on-button-middle = "dismiss-all"; on-button-middle = "dismiss-all";
}; };
}; };
@ -595,8 +591,8 @@ in {
ExecStart = "${pkgs.mako}/bin/mako"; ExecStart = "${pkgs.mako}/bin/mako";
}; };
Install = { Install = {
After = ["sway-session.target"]; After = [ "sway-session.target" ];
WantedBy = ["sway-session.target"]; WantedBy = [ "sway-session.target" ];
}; };
}; };
@ -667,15 +663,17 @@ in {
}; };
}; };
xdg.configFile."neofetch/config.conf".text = let xdg.configFile."neofetch/config.conf".text =
image = builtins.path { let
name = "nixos_circlejerk.png"; image = builtins.path {
path = ../data/nixos_circlejerk.png; name = "nixos_circlejerk.png";
}; path = ../data/nixos_circlejerk.png;
in '' };
image_source="${image}" in
image_backend="kitty" ''
''; image_source="${image}"
image_backend="kitty"
'';
xdg.enable = true; xdg.enable = true;
xdg.userDirs.enable = true; xdg.userDirs.enable = true;

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,58 +33,53 @@ 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 {
}; pathAdd = "${newwine}/bin:" + old.pathAdd;
newwinetricks = pkgs.winetricks.overrideAttrs (old: rec { postInstall = ''
pathAdd = "${newwine}/bin:" + old.pathAdd; sed -i \
postInstall = '' -e '2i PATH="${pathAdd}"' \
sed -i \ "$out/bin/winetricks"
-e '2i PATH="${pathAdd}"' \ '';
"$out/bin/winetricks" });
'';
});
oldwine = pkgs.wineWowPackages.full; oldwine = pkgs.wineWowPackages.full;
oldwinetricks = pkgs.winetricks.overrideAttrs (old: rec { oldwinetricks = pkgs.winetricks.overrideAttrs (old: rec {
pathAdd = "${oldwine}/bin:" + old.pathAdd; pathAdd = "${oldwine}/bin:" + old.pathAdd;
postInstall = '' postInstall = ''
sed -i \ sed -i \
-e '2i PATH="${pathAdd}"' \ -e '2i PATH="${pathAdd}"' \
"$out/bin/winetricks" "$out/bin/winetricks"
''; '';
}); });
in in
with pkgs; with pkgs; [
[ oldwine
oldwine oldwinetricks
oldwinetricks
sc-controller sc-controller
tuxpaint tuxpaint
extremetuxracer extremetuxracer
] ] ++ lib.optionals cfg.newWine [
++ lib.optionals cfg.newWine [ (
( pkgs.runCommand "new-wine-stuff"
pkgs.runCommand "new-wine-stuff" { } ''
{} '' mkdir -p $out/bin
mkdir -p $out/bin ln -s ${newwine}/bin/wine $out/bin/new-wine
ln -s ${newwine}/bin/wine $out/bin/new-wine ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg 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 = {
Description = "User-mode driver and GTK3 based GUI for Steam Controller"; Description = "User-mode driver and GTK3 based GUI for Steam Controller";
After = ["graphical-session-pre.target"]; After = [ "graphical-session-pre.target" ];
PartOf = ["graphical-session.target"]; PartOf = [ "graphical-session.target" ];
}; };
Service = { Service = {
@ -96,36 +89,38 @@ in {
RestartSec = 5; RestartSec = 5;
}; };
Install = {WantedBy = ["graphical-session.target"];}; Install = { WantedBy = [ "graphical-session.target" ]; };
}; };
systemd.user.services.steam = mkIf cfg.steamService { systemd.user.services.steam = mkIf cfg.steamService {
Unit = { Unit = {
Description = "Start Steam gaming platform"; Description = "Start Steam gaming platform";
After = ["graphical-session-pre.target"]; After = [ "graphical-session-pre.target" ];
PartOf = ["graphical-session.target"]; PartOf = [ "graphical-session.target" ];
}; };
Service = { Service = {
Type = "simple"; Type = "simple";
ExecStart = let ExecStart =
steamStart = pkgs.writeShellScript "steam-start" '' let
${pkgs.systemd}/bin/systemctl --user stop scc steamStart = pkgs.writeShellScript "steam-start" ''
# no sleep is needed here because steam is slow as fuck lol ${pkgs.systemd}/bin/systemctl --user stop scc
/run/current-system/sw/bin/steam -fulldesktopres # no sleep is needed here because steam is slow as fuck lol
''; /run/current-system/sw/bin/steam -fulldesktopres
in '';
in
lib.mkIf cfg.scService "${steamStart}"; lib.mkIf cfg.scService "${steamStart}";
ExecStop = let ExecStop =
steamStop = pkgs.writeShellScript "steam-stop" '' let
${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset steamStop = pkgs.writeShellScript "steam-stop" ''
${pkgs.systemd}/bin/systemctl --user start scc ${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset
''; ${pkgs.systemd}/bin/systemctl --user start scc
in '';
in
lib.mkIf cfg.scService "${steamStop}"; lib.mkIf cfg.scService "${steamStop}";
}; };
Install = {WantedBy = ["graphical-session.target"];}; Install = { WantedBy = [ "graphical-session.target" ]; };
}; };
}; };
} }

View File

@ -1,16 +1,14 @@
{ { 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 🐸";
settings = lib.mkOption { settings = lib.mkOption {
default = {}; default = { };
type = with lib.types; attrsOf str; type = with lib.types; attrsOf str;
description = '' description = ''
The settings that Kermit should use. The settings that Kermit should use.
@ -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.extraConfig;
cfg.settings)
+ 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,12 +1,7 @@
{ { 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 ];
programs.htop = { programs.htop = {
enable = true; enable = true;
@ -29,7 +24,7 @@
"Memory" "Memory"
"Uptime" "Uptime"
]; ];
right_meters = ["RightCPUs" "Blank" "CPU"]; right_meters = [ "RightCPUs" "Blank" "CPU" ];
}; };
}; };

View File

@ -1,10 +1,7 @@
{ 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; [
@ -56,12 +56,12 @@ in {
"vim.ignorecase" = true; "vim.ignorecase" = true;
"vim.normalModeKeyBindings" = [ "vim.normalModeKeyBindings" = [
{ {
before = ["<Tab>"]; before = [ "<Tab>" ];
commands = ["workbench.action.nextEditorInGroup"]; commands = [ "workbench.action.nextEditorInGroup" ];
} }
{ {
before = ["<S-Tab>"]; before = [ "<S-Tab>" ];
commands = ["workbench.action.previousEditorInGroup"]; commands = [ "workbench.action.previousEditorInGroup" ];
} }
]; ];
@ -77,63 +77,61 @@ in {
"elmLS.elmReviewPath" = "${pkgs.elmPackages.elm-review}/bin/elm-review"; "elmLS.elmReviewPath" = "${pkgs.elmPackages.elm-review}/bin/elm-review";
"elmLS.elmFormatPath" = "${pkgs.elmPackages.elm-format}/bin/elm-format"; "elmLS.elmFormatPath" = "${pkgs.elmPackages.elm-format}/bin/elm-format";
"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 justusadam.language-haskell
justusadam.language-haskell dhall.dhall-lang
dhall.dhall-lang dhall.vscode-dhall-lsp-server
dhall.vscode-dhall-lsp-server elmtooling.elm-ls-vscode
elmtooling.elm-ls-vscode kamadorueda.alejandra
kamadorueda.alejandra hashicorp.terraform
hashicorp.terraform (rust-lang.rust-analyzer.override {
(rust-lang.rust-analyzer.override { rust-analyzer = pkgs.writeShellScriptBin "rust-analyzer" ''
rust-analyzer = pkgs.writeShellScriptBin "rust-analyzer" '' exec rust-analyzer "$@"
exec rust-analyzer "$@" '';
''; })
}) ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
] {
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ name = "vscode-autohide";
{ publisher = "sirmspencer";
name = "vscode-autohide"; version = "1.0.7";
publisher = "sirmspencer"; sha256 = "sha256-VaG/eTE2BGbHAYgFdS31c47rgLZVjHGK+/U8MSYKDt8=";
version = "1.0.7"; }
sha256 = "sha256-VaG/eTE2BGbHAYgFdS31c47rgLZVjHGK+/U8MSYKDt8="; {
} name = "ide-purescript";
{ publisher = "nwolverson";
name = "ide-purescript"; version = "0.25.11";
publisher = "nwolverson"; sha256 = "sha256-9MgPAVfIdA7frR4EUDqVJB0N/LZY4NQSXtsKhEueNeg=";
version = "0.25.11"; }
sha256 = "sha256-9MgPAVfIdA7frR4EUDqVJB0N/LZY4NQSXtsKhEueNeg="; {
} name = "language-purescript";
{ publisher = "nwolverson";
name = "language-purescript"; version = "0.2.8";
publisher = "nwolverson"; sha256 = "sha256-2uOwCHvnlQQM8s8n7dtvIaMgpW8ROeoUraM02rncH9o=";
version = "0.2.8"; }
sha256 = "sha256-2uOwCHvnlQQM8s8n7dtvIaMgpW8ROeoUraM02rncH9o="; {
} name = "direnv";
{ publisher = "mkhl";
name = "direnv"; version = "0.6.1";
publisher = "mkhl"; sha256 = "sha256-5/Tqpn/7byl+z2ATflgKV1+rhdqj+XMEZNbGwDmGwLQ=";
version = "0.6.1"; }
sha256 = "sha256-5/Tqpn/7byl+z2ATflgKV1+rhdqj+XMEZNbGwDmGwLQ="; {
} name = "vscode-test-explorer";
{ publisher = "hbenl";
name = "vscode-test-explorer"; version = "2.21.1";
publisher = "hbenl"; sha256 = "sha256-fHyePd8fYPt7zPHBGiVmd8fRx+IM3/cSBCyiI/C0VAg=";
version = "2.21.1"; }
sha256 = "sha256-fHyePd8fYPt7zPHBGiVmd8fRx+IM3/cSBCyiI/C0VAg="; {
} name = "test-adapter-converter";
{ publisher = "ms-vscode";
name = "test-adapter-converter"; version = "0.1.6";
publisher = "ms-vscode"; sha256 = "sha256-UC8tUe+JJ3r8nb9SsPlvVXw74W75JWjMifk39JClRF4=";
version = "0.1.6"; }
sha256 = "sha256-UC8tUe+JJ3r8nb9SsPlvVXw74W75JWjMifk39JClRF4="; ];
}
];
}; };
programs.neovim = { programs.neovim = {
@ -180,11 +178,10 @@ in {
pname = "firenvim"; pname = "firenvim";
src = inputs.firenvim; src = inputs.firenvim;
# yes im stupid # yes im stupid
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 = ''
@ -222,7 +219,7 @@ in {
ezfonts.font = { ezfonts.font = {
name = "Anonymice Nerd Font"; name = "Anonymice Nerd Font";
package = pkgs.nerdfonts.override {fonts = ["AnonymousPro"];}; package = pkgs.nerdfonts.override { fonts = [ "AnonymousPro" ]; };
size = 11; size = 11;
}; };
@ -271,6 +268,6 @@ in {
lfs.enable = true; lfs.enable = true;
userName = "notgne2"; userName = "notgne2";
userEmail = "gen2@gen2.space"; userEmail = "gen2@gen2.space";
ignores = [".envrc"]; ignores = [ ".envrc" ];
}; };
} }

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";
@ -18,7 +13,7 @@ in {
i18n.inputMethod = { i18n.inputMethod = {
enabled = "ibus"; enabled = "ibus";
ibus.engines = with pkgs.ibus-engines; [typing-booster uniemoji]; ibus.engines = with pkgs.ibus-engines; [ typing-booster uniemoji ];
}; };
services.xserver = { services.xserver = {
@ -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 = [{
]; from = 1714;
networking.firewall.allowedUDPPortRanges = [ to = 1764;
{ }];
from = 1714;
to = 1764;
}
];
}; };
} }

View File

@ -1,18 +1,13 @@
{ { 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";
config = mkIf cfg.enable { config = mkIf cfg.enable {
i18n.inputMethod = { i18n.inputMethod = {
enabled = "ibus"; enabled = "ibus";
ibus.engines = with pkgs.ibus-engines; [typing-booster uniemoji]; ibus.engines = with pkgs.ibus-engines; [ typing-booster uniemoji ];
}; };
xdg.portal.enable = lib.mkDefault true; xdg.portal.enable = lib.mkDefault true;
@ -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 = [{
]; from = 1714;
networking.firewall.allowedUDPPortRanges = [ to = 1764;
{ }];
from = 1714;
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 {
@ -32,11 +26,11 @@ in {
"vfio" "vfio"
]; ];
boot.kernelParams = ["intel_iommu=on" "amd_iommu=on" "pcie_aspm=off"]; boot.kernelParams = [ "intel_iommu=on" "amd_iommu=on" "pcie_aspm=off" ];
boot.extraModprobeConfig = "options vfio-pci ids=${ boot.extraModprobeConfig = "options vfio-pci ids=${
builtins.concatStringsSep "," (builtins.attrNames cfg.PCIs) builtins.concatStringsSep "," (builtins.attrNames cfg.PCIs)
}"; }";
boot.postBootCommands = '' boot.postBootCommands = ''
DEVS="${builtins.concatStringsSep " " (builtins.attrValues cfg.PCIs)}" DEVS="${builtins.concatStringsSep " " (builtins.attrValues cfg.PCIs)}"

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;
@ -76,26 +71,26 @@ in {
"rt.time.soft" = 200000; "rt.time.soft" = 200000;
"rt.time.hard" = 200000; "rt.time.hard" = 200000;
}; };
flags = ["ifexists" "nofail"]; flags = [ "ifexists" "nofail" ];
} }
{name = "libpipewire-module-protocol-native";} { name = "libpipewire-module-protocol-native"; }
{name = "libpipewire-module-profiler";} { name = "libpipewire-module-profiler"; }
{name = "libpipewire-module-metadata";} { name = "libpipewire-module-metadata"; }
{name = "libpipewire-module-spa-device-factory";} { name = "libpipewire-module-spa-device-factory"; }
{name = "libpipewire-module-spa-node-factory";} { name = "libpipewire-module-spa-node-factory"; }
{name = "libpipewire-module-client-node";} { name = "libpipewire-module-client-node"; }
{name = "libpipewire-module-client-device";} { name = "libpipewire-module-client-device"; }
{ {
name = "libpipewire-module-portal"; name = "libpipewire-module-portal";
flags = ["ifexists" "nofail"]; flags = [ "ifexists" "nofail" ];
} }
{ {
name = "libpipewire-module-access"; name = "libpipewire-module-access";
args = {}; args = { };
} }
{name = "libpipewire-module-adapter";} { name = "libpipewire-module-adapter"; }
{name = "libpipewire-module-link-factory";} { name = "libpipewire-module-link-factory"; }
{name = "libpipewire-module-session-manager";} { name = "libpipewire-module-session-manager"; }
]; ];
}; };
@ -109,19 +104,19 @@ in {
"rt.time.soft" = 200000; "rt.time.soft" = 200000;
"rt.time.hard" = 200000; "rt.time.hard" = 200000;
}; };
flags = ["ifexists" "nofail"]; flags = [ "ifexists" "nofail" ];
} }
{name = "libpipewire-module-protocol-native";} { name = "libpipewire-module-protocol-native"; }
{name = "libpipewire-module-client-node";} { name = "libpipewire-module-client-node"; }
{name = "libpipewire-module-adapter";} { name = "libpipewire-module-adapter"; }
{name = "libpipewire-module-metadata";} { name = "libpipewire-module-metadata"; }
{ {
name = "libpipewire-module-protocol-pulse"; name = "libpipewire-module-protocol-pulse";
args = { args = {
"pulse.min.req" = qr; "pulse.min.req" = qr;
"pulse.default.req" = qr; "pulse.default.req" = qr;
"pulse.min.quantum" = qr; "pulse.min.quantum" = qr;
"server.address" = ["unix:native"]; "server.address" = [ "unix:native" ];
}; };
} }
]; ];
@ -134,75 +129,65 @@ 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" = cfg.rate * (if cfg.usbSoundcard then 2 else 1);
"audio.rate" = "api.alsa.period-size" = cfg.periodSize;
cfg.rate
* (
if cfg.usbSoundcard
then 2
else 1
);
"api.alsa.period-size" = cfg.periodSize;
};
}; };
} };
]; }];
}; };
media-session.config.bluez-monitor = { media-session.config.bluez-monitor = {
properties = { properties = {
"bluez5.codecs" = ["sbc" "aac" "ldac" "aptx" "aptx_hd"]; "bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
"bluez5.mdbc-support" = true; "bluez5.mdbc-support" = true;
}; };
rules = [ rules = [
{ {
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;
}; };
}; };
matches = [{"device.name" = "~bluez_card.*";}]; matches = [{ "device.name" = "~bluez_card.*"; }];
} }
{ {
actions = {update-props = {"node.pause-on-idle" = false;};}; actions = { update-props = { "node.pause-on-idle" = false; }; };
matches = [ matches = [
{"node.name" = "~bluez_input.*";} { "node.name" = "~bluez_input.*"; }
{"node.name" = "~bluez_output.*";} { "node.name" = "~bluez_output.*"; }
]; ];
} }
]; ];
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs;
# pactl is required for pipewire-pulse [
pulseaudio # pactl is required for pipewire-pulse
]; pulseaudio
];
environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" = mkIf cfg.lowLatency { environment.etc."wireplumber/main.lua.d/51-alsa-config.lua" =
text = '' mkIf cfg.lowLatency {
alsa_monitor.properties = { text = ''
["audio.rate"] = ${ alsa_monitor.properties = {
toString (cfg.rate ["audio.rate"] = ${
* ( toString (cfg.rate * (if cfg.usbSoundcard then 2 else 1))
if cfg.usbSoundcard },
then 2 ["audio.format"] = "S32LE",
else 1 ["api.alsa.headroom"] = 512,
)) ["api.alsa.period-size"] = ${toString cfg.periodSize}
}, }
["audio.format"] = "S32LE", '';
["api.alsa.headroom"] = 512, };
["api.alsa.period-size"] = ${toString cfg.periodSize}
}
'';
};
environment.etc."wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' environment.etc."wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
bluez_monitor.properties = { bluez_monitor.properties = {

View File

@ -1,13 +1,9 @@
{ { 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 [ "/" "-" " " "+" "=" ] [
"-" "-"
"\\x2d" "\\x2d"
"\\x20" "\\x20"
@ -15,31 +11,35 @@ with lib; let
"\\x3d" "\\x3d"
]; ];
ranges = serverIPs: let ranges = serverIPs:
generateRangesScript = builtins.toFile "exclusionary-wildcard-ranges-generator.py" '' let
import ipaddress generateRangesScript =
serverNetworks = [${map (ip: "ip_network('${ip}/32')") serverIPs}] builtins.toFile "exclusionary-wildcard-ranges-generator.py" ''
ranges = [ipaddress.ip_network('0.0.0.0/0')] import ipaddress
for serverNetwork in serverNetworks: serverNetworks = [${map (ip: "ip_network('${ip}/32')") serverIPs}]
ranges = map(lambda r: list(r.address_exclude(serverNetwork)), ranges) ranges = [ipaddress.ip_network('0.0.0.0/0')]
print(':'.join(ranges)) for serverNetwork in serverNetworks:
''; ranges = map(lambda r: list(r.address_exclude(serverNetwork)), ranges)
rangesOutput = pkgs.runCommand "exclusionary-wildcard-ranges" {} '' print(':'.join(ranges))
${pkgs.python3}/bin/python3 ${generateRangesScript} > $out '';
''; rangesOutput = pkgs.runCommand "exclusionary-wildcard-ranges" { } ''
in ${pkgs.python3}/bin/python3 ${generateRangesScript} > $out
'';
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
import ipaddress generateSubnetScript =
n1 = ipaddress.ip_network('${vlanIP}/${toString vlanSize}', False) builtins.toFile "subnet-without-host-bits-generator.py" ''
print(n1, end="") import ipaddress
''; n1 = ipaddress.ip_network('${vlanIP}/${toString vlanSize}', False)
subnetOutput = pkgs.runCommand "subnet-without-host-bits" {} '' print(n1, end="")
${pkgs.python3}/bin/python3 ${generateSubnetScript} > $out '';
''; subnetOutput = pkgs.runCommand "subnet-without-host-bits" { } ''
in ${pkgs.python3}/bin/python3 ${generateSubnetScript} > $out
'';
in
builtins.readFile "${subnetOutput}"; builtins.readFile "${subnetOutput}";
serverOpts.options = { serverOpts.options = {
@ -61,7 +61,7 @@ with lib; let
instanceOpts.options = { instanceOpts.options = {
servers = mkOption { servers = mkOption {
description = "Configuration of servers to connect to"; description = "Configuration of servers to connect to";
default = {}; default = { };
type = with types; listOf (submodule serverOpts); type = with types; listOf (submodule serverOpts);
}; };
autoStart = mkOption { autoStart = mkOption {
@ -88,12 +88,13 @@ 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 {
description = "Configuration of instances of Wireguard"; description = "Configuration of instances of Wireguard";
default = {}; default = { };
type = with types; attrsOf (submodule instanceOpts); type = with types; attrsOf (submodule instanceOpts);
}; };
}; };
@ -101,59 +102,49 @@ 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 = if inst.autoStart then { } else { wantedBy = mkForce [ ]; };
value = }] ++ map
if inst.autoStart (server: {
then {} name =
else {wantedBy = mkForce [];}; "wireguard-${instName}-peer${peerNameReplacement server.publicKey}";
} value = if inst.autoStart then { } else { wantedBy = mkForce [ ]; };
] })
++ map inst.servers)
(server: {
name = "wireguard-${instName}-peer${peerNameReplacement server.publicKey}";
value =
if inst.autoStart
then {}
else {wantedBy = mkForce [];};
})
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) ];
ips = ["${inst.vlanIP}/${toString inst.vlanSize}"]; in
privateKeyFile = inst.privateKeyFile; {
peers = ips = [ "${inst.vlanIP}/${toString inst.vlanSize}" ];
map privateKeyFile = inst.privateKeyFile;
(server: { peers = map
inherit allowedIPs; (server: {
publicKey = server.publicKey; inherit allowedIPs;
endpoint = "${server.ip}:${toString server.port}"; publicKey = server.publicKey;
persistentKeepalive = 25; endpoint = "${server.ip}:${toString server.port}";
}) persistentKeepalive = 25;
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 = platforms = super.meta.platforms ++ [ "x86_64-linux" ];
super.meta };
// {
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 {
@ -107,6 +101,6 @@ in {
hplipWithPlugin hplipWithPlugin
]; ];
}; };
services.udev.packages = [pkgs.utsushi]; services.udev.packages = [ pkgs.utsushi ];
}; };
} }

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,26 +60,21 @@ 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 xset dpms force on
xset dpms force on xset -dpms
xset -dpms xset s noblank
xset s noblank xset s off
xset s off
${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";
@ -110,7 +105,7 @@ in {
# Optimizes running games # Optimizes running games
programs.gamemode = { programs.gamemode = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
settings = {general.renice = 10;}; settings = { general.renice = 10; };
}; };
# Allows realtime stuff, useful for games, audio etc # Allows realtime stuff, useful for games, audio etc
@ -180,18 +175,14 @@ in {
"lp" "lp"
]; ];
subUidRanges = [ subUidRanges = [{
{ startUid = 100000;
startUid = 100000; count = 65536;
count = 65536; }];
} subGidRanges = [{
]; startGid = 100000;
subGidRanges = [ count = 65536;
{ }];
startGid = 100000;
count = 65536;
}
];
}; };
# brightness # brightness
@ -267,7 +258,7 @@ in {
# Shit breaks without this lol # Shit breaks without this lol
programs.dconf.enable = lib.mkDefault true; programs.dconf.enable = lib.mkDefault true;
services.dbus.packages = with pkgs; [dconf]; services.dbus.packages = with pkgs; [ dconf ];
boot.kernel.sysctl = { boot.kernel.sysctl = {
# better default swap # better default swap

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,10 +1,7 @@
{ config, pkgs, lib, ... }:
{ {
config, nix.trustedUsers = [ "notgne2" ];
pkgs,
lib,
...
}: {
nix.trustedUsers = ["notgne2"];
users.users.notgne2 = { users.users.notgne2 = {
isNormalUser = true; isNormalUser = true;