reformat and clean stuff up
This commit is contained in:
parent
b03b8f6328
commit
2b110a13c0
@ -27,12 +27,12 @@
|
|||||||
outputs = { self, nixpkgs, ... }@inputs: {
|
outputs = { self, nixpkgs, ... }@inputs: {
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
ezpassthru = import ./modules/ezpassthru.nix;
|
ezpassthru = import ./modules/ezpassthru.nix;
|
||||||
ezpc = import ./modules/ezpc.nix;
|
|
||||||
ezvahi = import ./modules/ezvahi.nix;
|
ezvahi = import ./modules/ezvahi.nix;
|
||||||
ezwg = import ./modules/ezwg.nix;
|
ezwg = import ./modules/ezwg.nix;
|
||||||
kiosk = import ./modules/kiosk.nix;
|
kiosk = import ./modules/kiosk.nix;
|
||||||
fuckingprint = import ./modules/fuckingprint.nix;
|
fuckingprint = import ./modules/fuckingprint.nix;
|
||||||
workstation = import ./modules/workstation.nix;
|
workstation = import ./modules/workstation.nix;
|
||||||
|
ezpw = import ./modules/ezpw.nix;
|
||||||
all = import ./modules/default.nix;
|
all = import ./modules/default.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ let
|
|||||||
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
|
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
|
||||||
ss = builtins.elemAt s';
|
ss = builtins.elemAt s';
|
||||||
o = if ss 0 == null then 3 else 0;
|
o = if ss 0 == null then 3 else 0;
|
||||||
in {
|
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);
|
||||||
@ -50,11 +51,13 @@ let
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
genTheme = repo: mustache (makeScheme cfg.base16 // {
|
genTheme = repo: mustache
|
||||||
|
(makeScheme cfg.base16 // {
|
||||||
scheme-name = cfg.favColors.name;
|
scheme-name = cfg.favColors.name;
|
||||||
scheme-slug = "idk";
|
scheme-slug = "idk";
|
||||||
scheme-author = "nixos";
|
scheme-author = "nixos";
|
||||||
}) cfg.favColors.name "${repo}/templates/default.mustache";
|
})
|
||||||
|
cfg.favColors.name "${repo}/templates/default.mustache";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.colors = {
|
options.colors = {
|
||||||
|
@ -97,7 +97,7 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
ezDrv =
|
ezDrv =
|
||||||
pkgs.runCommand "ez"
|
pkgs.runCommand "ez-commands"
|
||||||
{ }
|
{ }
|
||||||
(
|
(
|
||||||
''
|
''
|
||||||
@ -121,17 +121,6 @@ let
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
# TODO: why wont this work in an overlay
|
|
||||||
pnpm2nix =
|
|
||||||
pkgs.callPackage
|
|
||||||
(
|
|
||||||
builtins.fetchGit {
|
|
||||||
url = "https://github.com/notgne2/pnpm2nix.git";
|
|
||||||
rev = "d2863404330c6646800a49e73240e29e3265b594";
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{ };
|
|
||||||
|
|
||||||
rofiMenu =
|
rofiMenu =
|
||||||
if cfg.wayland then
|
if cfg.wayland then
|
||||||
"${rofiBin} -show drun -show-icons -run-command 'swaymsg exec -- {cmd}'"
|
"${rofiBin} -show drun -show-icons -run-command 'swaymsg exec -- {cmd}'"
|
||||||
@ -318,14 +307,10 @@ let
|
|||||||
|
|
||||||
menu = rofiMenu;
|
menu = rofiMenu;
|
||||||
|
|
||||||
bars =
|
bars = lib.optional (cfg.babybar || cfg.wayland != true) {
|
||||||
if (cfg.babybar || cfg.wayland != true) then [
|
|
||||||
{
|
|
||||||
position = "top";
|
position = "top";
|
||||||
colors = config.colors.i3BarColors;
|
colors = config.colors.i3BarColors;
|
||||||
}
|
};
|
||||||
] else
|
|
||||||
[ ];
|
|
||||||
|
|
||||||
gaps = {
|
gaps = {
|
||||||
smartGaps = true;
|
smartGaps = true;
|
||||||
@ -364,28 +349,6 @@ let
|
|||||||
programs.chromium = {
|
programs.chromium = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.ungoogled-chromium;
|
package = pkgs.ungoogled-chromium;
|
||||||
extensions = [
|
|
||||||
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin
|
|
||||||
{ id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; } # dark reader
|
|
||||||
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # bitwarden
|
|
||||||
{
|
|
||||||
# chromium web store
|
|
||||||
id = "ocaahdebbfolfmndjeplogmgcagdmblk";
|
|
||||||
crxPath = builtins.fetchurl {
|
|
||||||
name = "chromium-web-store.crx";
|
|
||||||
url = "https://github.com/NeverDecaf/chromium-web-store/releases/download/v1.4.0/Chromium.Web.Store.crx";
|
|
||||||
sha256 = "1bfzd02a9krkapkbj51kxfp4a1q5x2m2pz5kv98ywfcarbivskgs";
|
|
||||||
};
|
|
||||||
version = "1.4.0";
|
|
||||||
}
|
|
||||||
{ id = "lanfdkkpgfjfdikkncbnojekcppdebfp"; } # canvas fingerprint defend
|
|
||||||
{ id = "fhkphphbadjkepgfljndicmgdlndmoke"; } # font fingerprint defend
|
|
||||||
{ id = "olnbjpaejebpnokblkepbphhembdicik"; } # webgl fingerprint defend
|
|
||||||
{ id = "pcbjiidheaempljdefbdplebgdgpjcbe"; } # audio fingerprint defend
|
|
||||||
{ id = "dhdgffkkebhmkfjojejmpbldmpobfkfo"; } # tampermonkey
|
|
||||||
{ id = "dbepggeogbaibhgnhhndojpepiihcmeb"; } # vimium
|
|
||||||
{ id = "npeicpdbkakmehahjeeohfdhnlpdklia"; } # webrtc network limiter
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.lorri.enable = true;
|
services.lorri.enable = true;
|
||||||
@ -412,33 +375,6 @@ let
|
|||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# systemd.user.services.pulseaudio-dlna = {
|
|
||||||
# Unit = {
|
|
||||||
# Description =
|
|
||||||
# "A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux";
|
|
||||||
# After = [ "network.target" "sound.target" ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Service = {
|
|
||||||
# ExecStart = "${pkgs.pulseaudio-dlna}/bin/pulseaudio-dlna --port 10291";
|
|
||||||
# Environment =
|
|
||||||
# let
|
|
||||||
# toolPaths = makeBinPath [ pkgs.pulseaudio pkgs.dbus ];
|
|
||||||
# in
|
|
||||||
# [ "PATH=${toolPaths}" ];
|
|
||||||
# type = "idle";
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Install = { WantedBy = [ "default.target" ]; };
|
|
||||||
# };
|
|
||||||
|
|
||||||
xdg.configFile."fish/functions/humanize_duration.fish".source =
|
|
||||||
pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://raw.githubusercontent.com/fishpkg/fish-humanize-duration/master/humanize_duration.fish";
|
|
||||||
sha256 = "0abjc9dab8sx2lr28dp36vy9c4rd95badiypbkfjyvdxd9nig6zr";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.sessionVariables = { BW_SESSION = cfg.bitwardenSession; };
|
home.sessionVariables = { BW_SESSION = cfg.bitwardenSession; };
|
||||||
|
|
||||||
services.mpd = {
|
services.mpd = {
|
||||||
@ -489,10 +425,25 @@ let
|
|||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs;
|
||||||
|
let
|
||||||
|
steam = pkgs.steam.override { withJava = true; };
|
||||||
|
|
||||||
|
steam-run = steam.run;
|
||||||
|
|
||||||
|
newwine = (pkgs.wineFull.override { wineBuild = "wineWow"; wineRelease = "staging"; });
|
||||||
|
newwinetricks = pkgs.winetricks.override { wine = newwine; };
|
||||||
|
|
||||||
|
oldwine = pkgs.wineWowPackages.full;
|
||||||
|
oldwinetricks = pkgs.winetricks.override { wine = oldwine; };
|
||||||
|
in
|
||||||
[
|
[
|
||||||
|
|
||||||
|
xlibs.xf86inputjoystick
|
||||||
|
oldwine
|
||||||
|
oldwinetricks
|
||||||
|
|
||||||
flameshot
|
flameshot
|
||||||
|
|
||||||
# needed for fish done stuff
|
|
||||||
jq
|
jq
|
||||||
|
|
||||||
ezDrv
|
ezDrv
|
||||||
@ -502,35 +453,47 @@ let
|
|||||||
kitty
|
kitty
|
||||||
pavucontrol
|
pavucontrol
|
||||||
mpv
|
mpv
|
||||||
youtube-dl
|
yt-dlp
|
||||||
xorg.xkill
|
xorg.xkill
|
||||||
maim
|
maim
|
||||||
slop
|
slop
|
||||||
|
|
||||||
ark
|
ark
|
||||||
gwenview
|
|
||||||
notify-osd
|
notify-osd
|
||||||
libnotify
|
libnotify
|
||||||
ffmpeg
|
ffmpeg
|
||||||
id3v2
|
id3v2
|
||||||
imagemagick
|
imagemagick
|
||||||
|
|
||||||
gimp
|
|
||||||
mumble
|
|
||||||
libreoffice
|
|
||||||
mpc_cli
|
mpc_cli
|
||||||
nix-index
|
nix-index
|
||||||
]
|
] ++ (lib.optionals cfg.developer [
|
||||||
++ (
|
|
||||||
if cfg.developer then [
|
|
||||||
openvpn
|
openvpn
|
||||||
gitAndTools.hub
|
gitAndTools.hub
|
||||||
morph
|
|
||||||
nmap
|
nmap
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
] else
|
]) ++ (lib.optionals cfg.gaming [
|
||||||
[ ]
|
xlibs.xf86inputjoystick
|
||||||
);
|
oldwine
|
||||||
|
oldwinetricks
|
||||||
|
]) ++ (lib.optionals (cfg.gaming && !cfg.flatSteam) [
|
||||||
|
steam
|
||||||
|
steam-run
|
||||||
|
(writeScriptBin "steam-run-native" ''
|
||||||
|
#!${pkgs.stdenv.shell}
|
||||||
|
${(steam.override { nativeOnly = true; }).run}/bin/steam-run $@
|
||||||
|
'')
|
||||||
|
]) ++ (lib.optionals (cfg.gaming && cfg.newWine) [
|
||||||
|
(
|
||||||
|
pkgs.runCommand "new-wine-stuff"
|
||||||
|
{ } ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
ln -s ${newwine}/bin/wine $out/bin/new-wine
|
||||||
|
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
|
||||||
|
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
|
||||||
|
''
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
|
||||||
programs.rofi = {
|
programs.rofi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -557,7 +520,7 @@ let
|
|||||||
({
|
({
|
||||||
modules-left = [ "sway/workspaces" "sway/mode" ];
|
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||||
modules-center = [ "clock" "mpd" ];
|
modules-center = [ "clock" "mpd" ];
|
||||||
modules-right = (if cfg.battery then [ "battery" ] else [ ])
|
modules-right = (lib.optional cfg.battery "battery")
|
||||||
++ [ "pulseaudio" "network" "memory" "cpu" "temperature" "tray" ];
|
++ [ "pulseaudio" "network" "memory" "cpu" "temperature" "tray" ];
|
||||||
position = "left";
|
position = "left";
|
||||||
width = 50;
|
width = 50;
|
||||||
@ -698,10 +661,7 @@ let
|
|||||||
pkgs.swayidle
|
pkgs.swayidle
|
||||||
xwayland
|
xwayland
|
||||||
rxvt_unicode
|
rxvt_unicode
|
||||||
dmenu
|
|
||||||
libappindicator-gtk3
|
libappindicator-gtk3
|
||||||
xdg-desktop-portal
|
|
||||||
xdg-desktop-portal-wlr
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
xConfig =
|
xConfig =
|
||||||
@ -802,15 +762,7 @@ let
|
|||||||
vSync = true;
|
vSync = true;
|
||||||
#refreshRate = 144;
|
#refreshRate = 144;
|
||||||
blur = true;
|
blur = true;
|
||||||
package = pkgs.picom.overrideAttrs (
|
package = pkgs.picom;
|
||||||
_: {
|
|
||||||
src = builtins.fetchGit {
|
|
||||||
url = "https://github.com/ibhagwan/picom";
|
|
||||||
ref = "next-rebase";
|
|
||||||
rev = "6d87428f78a46bea295e0a21d23c4b56133aadc3";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
experimentalBackends = true;
|
experimentalBackends = true;
|
||||||
blurExclude = [
|
blurExclude = [
|
||||||
"window_type = 'dock'"
|
"window_type = 'dock'"
|
||||||
@ -851,6 +803,18 @@ in
|
|||||||
options.ezpcusr = {
|
options.ezpcusr = {
|
||||||
enable = mkEnableOption "Enable simple PC user config";
|
enable = mkEnableOption "Enable simple PC user config";
|
||||||
|
|
||||||
|
newWine = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "If you want to include wine-staging as new-wine";
|
||||||
|
};
|
||||||
|
|
||||||
|
flatSteam = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "If you use the flatpak Steam instead of NixOS";
|
||||||
|
};
|
||||||
|
|
||||||
wayland = mkOption {
|
wayland = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Enable wayland config (disabling this is experimental)";
|
description = "Enable wayland config (disabling this is experimental)";
|
||||||
@ -969,12 +933,6 @@ in
|
|||||||
default = false;
|
default = false;
|
||||||
description = "If this PC has a battery";
|
description = "If this PC has a battery";
|
||||||
};
|
};
|
||||||
|
|
||||||
tiling = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "If you are based and redpilled, and want a tiling WM (deprecated)";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (
|
config = mkIf cfg.enable (
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./ezvahi.nix
|
./ezvahi.nix
|
||||||
./ezwg.nix
|
./ezwg.nix
|
||||||
./ezpc.nix
|
|
||||||
./kiosk.nix
|
./kiosk.nix
|
||||||
./ezpassthru.nix
|
./ezpassthru.nix
|
||||||
./fuckingprint.nix
|
./fuckingprint.nix
|
||||||
./workstation.nix
|
./workstation.nix
|
||||||
|
./ezpw.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
208
modules/ezpc.nix
208
modules/ezpc.nix
@ -1,208 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.ezpc;
|
|
||||||
|
|
||||||
mainConfig = {
|
|
||||||
services.thermald.enable = true;
|
|
||||||
|
|
||||||
environment.etc."chromium/policies/managed/policies.json".text = ''
|
|
||||||
{
|
|
||||||
"NewTabPageLocation": "https://wizbos.club/"
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
workstation.enable = true;
|
|
||||||
workstation.user = cfg.user;
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
|
||||||
networking.firewall.allowedUDPPorts = [ 1900 ];
|
|
||||||
|
|
||||||
hardware.pulseaudio.enable = lib.mkDefault false;
|
|
||||||
sound.enable = lib.mkDefault false;
|
|
||||||
|
|
||||||
services.pipewire = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
jack.enable = lib.mkDefault true;
|
|
||||||
alsa.enable = lib.mkDefault true;
|
|
||||||
alsa.support32Bit = lib.mkDefault true;
|
|
||||||
pulse.enable = lib.mkDefault true;
|
|
||||||
media-session.config.bluez-monitor = {
|
|
||||||
properties = {
|
|
||||||
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
|
|
||||||
"bluez5.mdbc-support" = true;
|
|
||||||
};
|
|
||||||
rules = [
|
|
||||||
{
|
|
||||||
actions = {
|
|
||||||
update-props = {
|
|
||||||
"bluez5.auto-connect" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ];
|
|
||||||
"bluez5.hw-volume" =
|
|
||||||
[ "hfp_ag" "hsp_ag" "a2dp_source" "a2dp_sink" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
matches = [{ "device.name" = "~bluez_card.*"; }];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
actions = { update-props = { "node.pause-on-idle" = false; }; };
|
|
||||||
matches = [
|
|
||||||
{ "node.name" = "~bluez_input.*"; }
|
|
||||||
{ "node.name" = "~bluez_output.*"; }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.portal.enable = lib.mkDefault true;
|
|
||||||
xdg.portal.gtkUsePortal = lib.mkDefault true;
|
|
||||||
xdg.portal.extraPortals = lib.mkDefault (with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]);
|
|
||||||
|
|
||||||
# let me use audio and phones
|
|
||||||
programs.adb.enable = cfg.developer;
|
|
||||||
|
|
||||||
# Set some X11 props
|
|
||||||
services.xserver = {
|
|
||||||
enable = lib.mkDefault false;
|
|
||||||
layout = lib.mkDefault "us";
|
|
||||||
libinput.enable = true;
|
|
||||||
};
|
|
||||||
security.pam.services = {
|
|
||||||
swaylock.text = ''
|
|
||||||
auth include login
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
notBatteryConfig = {
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
|
||||||
};
|
|
||||||
batteryConfig = {
|
|
||||||
services.upower = {
|
|
||||||
enable = true;
|
|
||||||
percentageLow = 15;
|
|
||||||
percentageCritical = 10;
|
|
||||||
percentageAction = 5;
|
|
||||||
};
|
|
||||||
services.tlp.enable = true;
|
|
||||||
services.tlp.extraConfig = ''
|
|
||||||
TLP_ENABLE=1
|
|
||||||
CPU_SCALING_GOVERNOR_ON_BAT=powersave
|
|
||||||
CPU_SCALING_GOVERNOR_ON_AC=ondemand
|
|
||||||
CPU_BOOST_ON_BAT=0
|
|
||||||
CPU_BOOST_ON_AC=1
|
|
||||||
CPU_MIN_PERF_ON_BAT=0
|
|
||||||
CPU_MAX_PERF_ON_BAT=30
|
|
||||||
CPU_MIN_PERF_ON_AC=0
|
|
||||||
CPU_MAX_PERF_ON_AC=100
|
|
||||||
CPU_ENERGY_PERF_POLICY_ON_BAT=power
|
|
||||||
CPU_ENERGY_PERF_POLICY_ON_AC=ondemand
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
gamingConfig = {
|
|
||||||
environment.systemPackages =
|
|
||||||
let
|
|
||||||
steam = pkgs.steam.override { withJava = true; };
|
|
||||||
|
|
||||||
steam-run = steam.run;
|
|
||||||
|
|
||||||
newwine = (pkgs.wineFull.override { wineBuild = "wineWow"; wineRelease = "staging"; });
|
|
||||||
newwinetricks = pkgs.winetricks.override { wine = newwine; };
|
|
||||||
|
|
||||||
oldwine = (pkgs.wineFull.override { wineBuild = "wineWow"; });
|
|
||||||
oldwinetricks = pkgs.winetricks.override { wine = oldwine; };
|
|
||||||
in
|
|
||||||
with pkgs; ([
|
|
||||||
xlibs.xf86inputjoystick
|
|
||||||
oldwine
|
|
||||||
oldwinetricks
|
|
||||||
] ++ (if !cfg.flatSteam then [
|
|
||||||
steam
|
|
||||||
steam-run
|
|
||||||
(writeScriptBin "steam-run-native" ''
|
|
||||||
#!${pkgs.stdenv.shell}
|
|
||||||
${(steam.override { nativeOnly = true; }).run}/bin/steam-run $@
|
|
||||||
'')
|
|
||||||
] else [
|
|
||||||
# steam-run-native
|
|
||||||
]) ++ (
|
|
||||||
if cfg.newWine then [
|
|
||||||
(
|
|
||||||
pkgs.runCommand "new-wine-stuff"
|
|
||||||
{ } ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
ln -s ${newwine}/bin/wine $out/bin/new-wine
|
|
||||||
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
|
|
||||||
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
|
|
||||||
''
|
|
||||||
)
|
|
||||||
] else [ ]
|
|
||||||
));
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.ezpc = {
|
|
||||||
enable = mkEnableOption "Enable simple PC config";
|
|
||||||
|
|
||||||
battery = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "If this device has a battery";
|
|
||||||
};
|
|
||||||
|
|
||||||
portals = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "use weird new hipster portal shit";
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
description = "The main user of this PC";
|
|
||||||
};
|
|
||||||
|
|
||||||
gaming = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "If this PC is used for gaming";
|
|
||||||
};
|
|
||||||
|
|
||||||
flatSteam = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "If you use the flatpak Steam instead of NixOS";
|
|
||||||
};
|
|
||||||
|
|
||||||
print = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "If this PC should support printing/scanning";
|
|
||||||
};
|
|
||||||
|
|
||||||
developer = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Should enable advanced shit for developers";
|
|
||||||
};
|
|
||||||
|
|
||||||
bluetooth = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "If this PC has bluetooth support";
|
|
||||||
};
|
|
||||||
|
|
||||||
newWine = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "If you want to include wine-staging as new-wine";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (
|
|
||||||
mkMerge [
|
|
||||||
mainConfig
|
|
||||||
(mkIf cfg.gaming gamingConfig)
|
|
||||||
(mkIf cfg.battery batteryConfig)
|
|
||||||
(mkIf (cfg.battery != true) notBatteryConfig)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
54
modules/ezpw.nix
Normal file
54
modules/ezpw.nix
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.ezpw;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.ezpw = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption
|
||||||
|
"Enable pipewire";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
hardware.pulseaudio.enable = lib.mkDefault false;
|
||||||
|
sound.enable = lib.mkDefault false;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
jack.enable = lib.mkDefault true;
|
||||||
|
alsa.enable = lib.mkDefault true;
|
||||||
|
alsa.support32Bit = lib.mkDefault true;
|
||||||
|
pulse.enable = lib.mkDefault true;
|
||||||
|
media-session.config.bluez-monitor = {
|
||||||
|
properties = {
|
||||||
|
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
|
||||||
|
"bluez5.mdbc-support" = true;
|
||||||
|
};
|
||||||
|
rules = [
|
||||||
|
{
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
"bluez5.auto-connect" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ];
|
||||||
|
"bluez5.hw-volume" =
|
||||||
|
[ "hfp_ag" "hsp_ag" "a2dp_source" "a2dp_sink" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
matches = [{ "device.name" = "~bluez_card.*"; }];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
actions = { update-props = { "node.pause-on-idle" = false; }; };
|
||||||
|
matches = [
|
||||||
|
{ "node.name" = "~bluez_input.*"; }
|
||||||
|
{ "node.name" = "~bluez_output.*"; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.portal.enable = lib.mkDefault true;
|
||||||
|
xdg.portal.gtkUsePortal = lib.mkDefault true;
|
||||||
|
xdg.portal.extraPortals = lib.mkDefault (with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]);
|
||||||
|
};
|
||||||
|
}
|
@ -11,13 +11,58 @@ in
|
|||||||
type = types.str;
|
type = types.str;
|
||||||
description = "The main user of this PC";
|
description = "The main user of this PC";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
battery = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "If this device has a battery";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# support gay men (and video)
|
services.ezpw.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
security.pam.services = {
|
||||||
|
swaylock.text = ''
|
||||||
|
auth include login
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.thermald.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
# Don't kill the battery
|
||||||
|
services.upower = {
|
||||||
|
enable = lib.mkDefault cfg.battery;
|
||||||
|
percentageLow = 15;
|
||||||
|
percentageCritical = 10;
|
||||||
|
percentageAction = 5;
|
||||||
|
criticalPowerAction = "Hibernate";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Make battery usage sane
|
||||||
|
services.tlp = {
|
||||||
|
enable = lib.mkDefault cfg.battery;
|
||||||
|
extraConfig = ''
|
||||||
|
TLP_ENABLE=1
|
||||||
|
CPU_SCALING_GOVERNOR_ON_BAT=powersave
|
||||||
|
CPU_SCALING_GOVERNOR_ON_AC=ondemand
|
||||||
|
CPU_BOOST_ON_BAT=0
|
||||||
|
CPU_BOOST_ON_AC=1
|
||||||
|
CPU_MIN_PERF_ON_BAT=0
|
||||||
|
CPU_MAX_PERF_ON_BAT=30
|
||||||
|
CPU_MIN_PERF_ON_AC=0
|
||||||
|
CPU_MAX_PERF_ON_AC=100
|
||||||
|
CPU_ENERGY_PERF_POLICY_ON_BAT=power
|
||||||
|
CPU_ENERGY_PERF_POLICY_ON_AC=ondemand
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Video support
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
# Fix steam
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
|
# Other drivers
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
intel-media-driver
|
intel-media-driver
|
||||||
vaapiIntel
|
vaapiIntel
|
||||||
@ -25,9 +70,12 @@ in
|
|||||||
libvdpau-va-gl
|
libvdpau-va-gl
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
hardware.steam-hardware.enable = true;
|
|
||||||
hardware.uinput.enable = true;
|
# Support for steam hardware
|
||||||
fonts.fontconfig.cache32Bit = true;
|
hardware.steam-hardware.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
# Needed for lots of controller stuff
|
||||||
|
hardware.uinput.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# proton esync
|
# proton esync
|
||||||
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
|
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
|
||||||
@ -58,16 +106,19 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# fuck alsa
|
|
||||||
nixpkgs.config.pulseaudio = true;
|
|
||||||
|
|
||||||
# brightness
|
# brightness
|
||||||
programs.light.enable = true;
|
programs.light.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# make fonts not fucked up
|
# make fonts not fucked up
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = lib.mkDefault true;
|
||||||
fonts.enableDefaultFonts = true;
|
fonts.enableDefaultFonts = lib.mkDefault true;
|
||||||
services.xserver.dpi = lib.mkDefault 96;
|
# Important for steam
|
||||||
|
fonts.fontconfig.cache32Bit = lib.mkDefault true;
|
||||||
|
services.xserver = {
|
||||||
|
dpi = lib.mkDefault 96;
|
||||||
|
layout = lib.mkDefault "us";
|
||||||
|
libinput.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
# this helps with some compatibility
|
# this helps with some compatibility
|
||||||
hardware.pulseaudio.daemon.config = {
|
hardware.pulseaudio.daemon.config = {
|
||||||
@ -86,8 +137,11 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Used for upnp or something?
|
||||||
|
networking.firewall.allowedUDPPorts = [ 1900 ];
|
||||||
|
|
||||||
# Shit breaks without this lol
|
# Shit breaks without this lol
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# better default swap
|
# better default swap
|
||||||
boot.kernel.sysctl = { "vm.swappiness" = lib.mkDefault 45; };
|
boot.kernel.sysctl = { "vm.swappiness" = lib.mkDefault 45; };
|
||||||
@ -98,22 +152,20 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
# self explanatory
|
# self explanatory
|
||||||
fuckingprint.enable = true;
|
fuckingprint.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Enable sound.
|
# Pulseaudio is off by defaultm but if you want it, make it work right
|
||||||
sound.enable = lib.mkOverride 1100 true;
|
|
||||||
hardware.pulseaudio.enable = lib.mkOverride 1100 true;
|
|
||||||
hardware.pulseaudio.support32Bit = lib.mkDefault true;
|
hardware.pulseaudio.support32Bit = lib.mkDefault true;
|
||||||
hardware.pulseaudio.zeroconf.discovery.enable = lib.mkDefault true;
|
hardware.pulseaudio.zeroconf.discovery.enable = lib.mkDefault true;
|
||||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||||||
|
hardware.pulseaudio.extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||||||
hardware.pulseaudio.extraConfig = ''
|
hardware.pulseaudio.extraConfig = ''
|
||||||
load-module module-dbus-protocol
|
load-module module-dbus-protocol
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# bluetooth
|
# bluetooth
|
||||||
services.blueman.enable = true;
|
services.blueman.enable = lib.mkDefault true;
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = lib.mkDefault true;
|
||||||
hardware.pulseaudio.extraModules = [ pkgs.pulseaudio-modules-bt ];
|
|
||||||
hardware.bluetooth.settings.General.Enable = "Source,Sink,Media,Socket";
|
hardware.bluetooth.settings.General.Enable = "Source,Sink,Media,Socket";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user