reflow with nixpkgs-fmt

This commit is contained in:
Sean Buckley 2020-09-24 01:45:48 -04:00
parent 93453bfc44
commit e3c8b78056
14 changed files with 360 additions and 263 deletions

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;
allowReboot = true; allowReboot = true;
}; };
nix.gc = { nix.gc = {
automatic = true; automatic = true;
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
} }

View file

@ -1,35 +1,35 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
time.timeZone = "US/Eastern"; time.timeZone = "US/Eastern";
boot = { boot = {
zfs.forceImportAll = false; zfs.forceImportAll = false;
zfs.forceImportRoot = false; zfs.forceImportRoot = false;
kernelParams = [ "amdgpu.gpu_recovery=1" "panic=30" ]; kernelParams = [ "amdgpu.gpu_recovery=1" "panic=30" ];
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
environment.variables.NIXPKGS_ALLOW_UNFREE = "1"; environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
systemd.tmpfiles.rules = [ "e /nix/var/log - - - 30d" ]; systemd.tmpfiles.rules = [ "e /nix/var/log - - - 30d" ];
zramSwap = { zramSwap = {
enable = true; enable = true;
algorithm = "zstd"; algorithm = "zstd";
}; };
hardware = { hardware = {
cpu.amd.updateMicrocode = true; cpu.amd.updateMicrocode = true;
cpu.intel.updateMicrocode = true; cpu.intel.updateMicrocode = true;
}; };
services = { services = {
earlyoom.enable = true; earlyoom.enable = true;
avahi = { avahi = {
enable = true; enable = true;
nssmdns = true; nssmdns = true;
publish.enable = true; publish.enable = true;
publish.addresses = true; publish.addresses = true;
};
}; };
};
} }

View file

@ -1,49 +1,70 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pwgen pv tree tmux psmisc ncdu git file sqlite usbutils entr ffmpeg gcc pwgen
python3 hugo openssl wget lm_sensors htop zip unzip dnsutils pv
tcpdump rsync tree
tmux
psmisc
ncdu
git
file
sqlite
usbutils
entr
ffmpeg
gcc
python3
hugo
openssl
wget
lm_sensors
htop
zip
unzip
dnsutils
tcpdump
rsync
(writeScriptBin "nix-roots" "nix-store --gc --print-roots | grep -v ^/proc/") (writeScriptBin "nix-roots" "nix-store --gc --print-roots | grep -v ^/proc/")
(vim_configurable.customize { (vim_configurable.customize {
name="vim"; name = "vim";
vimrcConfig.customRC='' vimrcConfig.customRC = ''
syntax enable syntax enable
filetype plugin indent on filetype plugin indent on
set nowrap ruler scrolloff=9 backspace=start,indent set nowrap ruler scrolloff=9 backspace=start,indent
''; '';
}) })
(writeScriptBin "zfsram" '' (writeScriptBin "zfsram" ''
#!${pkgs.python3}/bin/python #!${pkgs.python3}/bin/python
for ln in open('/proc/spl/kstat/zfs/arcstats').readlines(): for ln in open('/proc/spl/kstat/zfs/arcstats').readlines():
if ln.startswith('size '): if ln.startswith('size '):
print(str(int(ln.split(' ')[-1])/(1024*1024*1024))[:5],'GB') print(str(int(ln.split(' ')[-1])/(1024*1024*1024))[:5],'GB')
'') '')
]; ];
programs.bash.interactiveShellInit = '' programs.bash.interactiveShellInit = ''
stty -ixon stty -ixon
echo $XDG_SESSION_TYPE echo $XDG_SESSION_TYPE
alias p=python3 alias p=python3
alias buildsys='nix build -f "<nixpkgs/nixos>" --no-link system' alias buildsys='nix build -f "<nixpkgs/nixos>" --no-link system'
alias channel=' alias channel='
echo " Local: $(cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision)";\ echo " Local: $(cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision)";\
echo "Remote: $(curl --silent -L https://channels.nixos.org/nixos-unstable/git-revision)" echo "Remote: $(curl --silent -L https://channels.nixos.org/nixos-unstable/git-revision)"
' '
function _update_ps1() { function _update_ps1() {
PS1="\n$(${pkgs.powerline-go}/bin/powerline-go \ PS1="\n$(${pkgs.powerline-go}/bin/powerline-go \
-mode=flat \ -mode=flat \
-colorize-hostname \ -colorize-hostname \
-cwd-mode=dironly \ -cwd-mode=dironly \
-modules=user,host,cwd,nix-shell,git,jobs \ -modules=user,host,cwd,nix-shell,git,jobs \
# -git-assume-unchanged-size 0 \ # -git-assume-unchanged-size 0 \
)$ " )$ "
} }
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
''; '';
} }

View file

@ -1,28 +1,28 @@
{ stdenv, fetchFromGitHub, glib, gettext }: { stdenv, fetchFromGitHub, glib, gettext }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gnome-shell-extension-bottompanel"; pname = "gnome-shell-extension-bottompanel";
version = "1901"; version = "1901";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Thoma5"; owner = "Thoma5";
repo = "gnome-shell-extension-bottompanel"; repo = "gnome-shell-extension-bottompanel";
rev = "3d9573896b122e9ccb02262249ca986f8dad1ebd"; rev = "3d9573896b122e9ccb02262249ca986f8dad1ebd";
sha256 = "0lp25na5plz8vp8zjsikcadgy5hyx59ys2sbd4haagcalyv7jj4q"; sha256 = "0lp25na5plz8vp8zjsikcadgy5hyx59ys2sbd4haagcalyv7jj4q";
}; };
phases = [ "installPhase" ]; phases = [ "installPhase" ];
installPhase = '' installPhase = ''
mkdir -p "$out/share/gnome-shell/extensions" mkdir -p "$out/share/gnome-shell/extensions"
cp -r "$src" "$out/share/gnome-shell/extensions/bottompanel@tmoer93" cp -r "$src" "$out/share/gnome-shell/extensions/bottompanel@tmoer93"
chmod +w "$out/share/gnome-shell/extensions/bottompanel@tmoer93" chmod +w "$out/share/gnome-shell/extensions/bottompanel@tmoer93"
sed -i 's/.*_rightPanelBarrier.*/if(Main.layoutManager._rightPanelBarrier)&/' "$out/share/gnome-shell/extensions/bottompanel@tmoer93/extension.js" sed -i 's/.*_rightPanelBarrier.*/if(Main.layoutManager._rightPanelBarrier)&/' "$out/share/gnome-shell/extensions/bottompanel@tmoer93/extension.js"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Move your GNOME 3 shell panel to the bottom"; description = "Move your GNOME 3 shell panel to the bottom";
homepage = https://github.com/Thoma5/gnome-shell-extension-bottompanel; homepage = https://github.com/Thoma5/gnome-shell-extension-bottompanel;
}; };
} }

View file

@ -1,34 +1,35 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment = { environment = {
gnome3.excludePackages = with pkgs.gnome3; [ epiphany vinagre gnome-software ]; gnome3.excludePackages = with pkgs.gnome3; [ epiphany vinagre gnome-software ];
systemPackages = with pkgs; [ systemPackages = with pkgs; [
numix-icon-theme numix-icon-theme
gnome3.gnome-tweaks gnome3.gnome-tweaks
gnome3.gnome-boxes qemu_kvm gnome3.gnome-boxes
(callPackage ./bottom-panel.nix {}) qemu_kvm
(writeScriptBin "red" '' (callPackage ./bottom-panel.nix { })
x="$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)" (writeScriptBin "red" ''
[ "$x" = "true" ] && x=false || x=true x="$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)"
echo "Nightlight: $x" [ "$x" = "true" ] && x=false || x=true
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled $x echo "Nightlight: $x"
'') gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled $x
] ++ (with pkgs.gnomeExtensions; [ '')
appindicator ] ++ (with pkgs.gnomeExtensions; [
dash-to-panel appindicator
drop-down-terminal dash-to-panel
sound-output-device-chooser drop-down-terminal
]); sound-output-device-chooser
}; ]);
};
services.xserver = { services.xserver = {
enable = true; enable = true;
libinput.enable = true; libinput.enable = true;
displayManager.gdm.enable = true; displayManager.gdm.enable = true;
desktopManager.gnome3.enable = true; desktopManager.gnome3.enable = true;
desktopManager.xterm.enable = false; desktopManager.xterm.enable = false;
displayManager.sessionCommands = '' displayManager.sessionCommands = ''
${./settings.sh} ${./settings.sh}
''; '';
}; };
} }

View file

@ -1,49 +1,49 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
firefox firefox
brave brave
gimp gimp
mpv mpv
libreoffice libreoffice
tdesktop tdesktop
steam steam
pavucontrol pavucontrol
gnome3.dconf-editor gnome3.dconf-editor
glxinfo glxinfo
steam-run steam-run
discord discord
(vscode-with-extensions.override { (vscode-with-extensions.override {
vscode = vscodium; vscode = vscodium;
vscodeExtensions = with pkgs.vscode-extensions; [ vscodeExtensions = with pkgs.vscode-extensions; [
bbenoist.Nix bbenoist.Nix
ms-python.python ms-python.python
ms-vscode.cpptools ms-vscode.cpptools
ms-azuretools.vscode-docker ms-azuretools.vscode-docker
]; ];
}) })
]; ];
# environment.systemPackages = with pkgs; [ retroarch ]; # environment.systemPackages = with pkgs; [ retroarch ];
# nixpkgs.config.retroarch = { # nixpkgs.config.retroarch = {
# enableParallelN64 = true; # enableParallelN64 = true;
# enableNestopia = true; # enableNestopia = true;
# enableHiganSFC = true; # enableHiganSFC = true;
# }; # };
services.xserver.deviceSection = '' services.xserver.deviceSection = ''
Option "VariableRefresh" "true" Option "VariableRefresh" "true"
''; '';
hardware = { hardware = {
pulseaudio.enable = true; pulseaudio.enable = true;
pulseaudio.support32Bit = true; pulseaudio.support32Bit = true;
opengl.driSupport32Bit = true; opengl.driSupport32Bit = true;
}; };
fonts.fonts = [ pkgs.powerline-fonts ]; fonts.fonts = [ pkgs.powerline-fonts ];
boot.loader.timeout = null; boot.loader.timeout = null;
} }

View file

@ -1,15 +1,17 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.xserver.displayManager.sessionCommands = '' services.xserver.displayManager.sessionCommands = ''
xinput list | cut -d= -f2 | cut -f1 | xargs -i xinput set-prop {} 'libinput Scroll Distance Scale' 2 1 xinput list | cut -d= -f2 | cut -f1 | xargs -i xinput set-prop {} 'libinput Scroll Distance Scale' 2 1
''; '';
nixpkgs.overlays = [(self: super: { nixpkgs.overlays = [
xorg = super.xorg.overrideScope' (selfB: superB: { (self: super: {
inherit (super.xorg) xlibsWrapper; xorg = super.xorg.overrideScope' (selfB: superB: {
xf86inputlibinput = superB.xf86inputlibinput.overrideAttrs (attr: { inherit (super.xorg) xlibsWrapper;
patches = [ ./b7b5c5ef5f34802fc5f57e68493afaea5db7cdb4.diff ]; xf86inputlibinput = superB.xf86inputlibinput.overrideAttrs (attr: {
}); patches = [ ./b7b5c5ef5f34802fc5f57e68493afaea5db7cdb4.diff ];
}); });
})]; });
})
];
} }

View file

@ -1,14 +1,14 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
users.users = { users.users = {
sean = { sean = {
isNormalUser = true; isNormalUser = true;
uid = 1000; uid = 1000;
extraGroups = [ "wheel" "audio" "video" "networkmanager" "dialout" "input" "wireshark" ]; extraGroups = [ "wheel" "audio" "video" "networkmanager" "dialout" "input" "wireshark" ];
};
test = {
isNormalUser = true;
isSystemUser = true;
};
}; };
test = {
isNormalUser = true;
isSystemUser = true;
};
};
} }

View file

@ -1,14 +1,27 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
exiftool burpsuite nmap masscan binutils remmina openvpn socat ghidra-bin exiftool
wfuzz gobuster dirb pwndbg thc-hydra metasploit burpsuite
nmap
masscan
binutils
remmina
openvpn
socat
ghidra-bin
wfuzz
gobuster
dirb
pwndbg
thc-hydra
metasploit
(callPackage ../pkgs/binary-ninja-personal {}) (callPackage ../pkgs/binary-ninja-personal { })
]; ];
programs = { programs = {
wireshark.enable = true; wireshark.enable = true;
wireshark.package = pkgs.wireshark; wireshark.package = pkgs.wireshark;
}; };
} }

View file

@ -1,29 +1,36 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
programs.sway.enable = true; programs.sway.enable = true;
environment.variables.GTK_THEME = "Yaru-dark"; environment.variables.GTK_THEME = "Yaru-dark";
environment.variables.MOZ_ENABLE_WAYLAND = "1"; environment.variables.MOZ_ENABLE_WAYLAND = "1";
environment.etc."xdg/gtk-3.0/settings.ini".text = '' environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings] [Settings]
gtk-theme-name=Yaru-dark gtk-theme-name=Yaru-dark
gtk-icon-theme-name=Numix gtk-icon-theme-name=Numix
''; '';
# hardware.bluetooth.enable = true; # hardware.bluetooth.enable = true;
# services.blueman.enable = true; # services.blueman.enable = true;
services.gvfs.enable = true; services.gvfs.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
numix-icon-theme yaru-theme numix-icon-theme
gnome3.networkmanagerapplet gnome3.file-roller gnome3.adwaita-icon-theme yaru-theme
mate.mate-terminal xfce.thunar i3status xfce.thunar-archive-plugin caffeine-ng gnome3.networkmanagerapplet
wf-recorder gnome3.file-roller
]; gnome3.adwaita-icon-theme
mate.mate-terminal
xfce.thunar
i3status
xfce.thunar-archive-plugin
caffeine-ng
wf-recorder
];
programs.bash.interactiveShellInit = '' [ "$(tty)" = "/dev/tty1" ] && exec sway ''; programs.bash.interactiveShellInit = '' [ "$(tty)" = "/dev/tty1" ] && exec sway '';
} }

View file

@ -1,35 +1,88 @@
{ { stdenv
stdenv, autoPatchelfHook, requireFile, libxkbcommon, makeWrapper, unzip, zlib, glib, , autoPatchelfHook
fontconfig, freetype, dbus, python37, libglvnd, libXext, libX11, libXrender, libXi, , requireFile
libSM, libICE, xkeyboardconfig, nss, libXcomposite, libXcursor, libXdamage, libXtst, , libxkbcommon
alsaLib, libXrandr, krb5, xcbutilwm, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil , makeWrapper
, unzip
, zlib
, glib
, fontconfig
, freetype
, dbus
, python37
, libglvnd
, libXext
, libX11
, libXrender
, libXi
, libSM
, libICE
, xkeyboardconfig
, nss
, libXcomposite
, libXcursor
, libXdamage
, libXtst
, alsaLib
, libXrandr
, krb5
, xcbutilwm
, xcbutilimage
, xcbutilkeysyms
, xcbutilrenderutil
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "binary-ninja-personal"; name = "binary-ninja-personal";
src = requireFile { src = requireFile {
name = "BinaryNinja-personal.zip"; name = "BinaryNinja-personal.zip";
url = "https://binary.ninja"; url = "https://binary.ninja";
sha256 = "5dae72ad0d31f7439cf4232a5324a31857ce4e0e593c85c62520c94ff171b4a2"; sha256 = "5dae72ad0d31f7439cf4232a5324a31857ce4e0e593c85c62520c94ff171b4a2";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
autoPatchelfHook libxkbcommon stdenv.cc.cc.lib zlib glib fontconfig freetype nss autoPatchelfHook
dbus python37 libglvnd libXext libX11 libXrender libXi libSM libICE unzip makeWrapper libxkbcommon
libXcomposite libXcursor libXdamage libXtst alsaLib libXrandr krb5 xcbutilwm xcbutilimage stdenv.cc.cc.lib
xcbutilkeysyms xcbutilrenderutil zlib
]; glib
fontconfig
freetype
nss
dbus
python37
libglvnd
libXext
libX11
libXrender
libXi
libSM
libICE
unzip
makeWrapper
libXcomposite
libXcursor
libXdamage
libXtst
alsaLib
libXrandr
krb5
xcbutilwm
xcbutilimage
xcbutilkeysyms
xcbutilrenderutil
];
dontStrip = true; dontStrip = true;
dontPatchELF = true; dontPatchELF = true;
installPhase = '' installPhase = ''
mkdir -p $out/lib $out/bin $out/share mkdir -p $out/lib $out/bin $out/share
mv $NIX_BUILD_TOP/$sourceRoot $out/lib/binary-ninja mv $NIX_BUILD_TOP/$sourceRoot $out/lib/binary-ninja
ln -s "${src}" "$out/share/BinaryNinja-personal.zip" ln -s "${src}" "$out/share/BinaryNinja-personal.zip"
ln -s "${python37}/lib/libpython3.7m.so.1.0" "$out/lib/binary-ninja/libpython3.7m.so.1" ln -s "${python37}/lib/libpython3.7m.so.1.0" "$out/lib/binary-ninja/libpython3.7m.so.1"
makeWrapper $out/lib/binary-ninja/binaryninja $out/bin/binaryninja \ makeWrapper $out/lib/binary-ninja/binaryninja $out/bin/binaryninja \
--set QT_XKB_CONFIG_ROOT "${xkeyboardconfig}/share/X11/xkb" \ --set QT_XKB_CONFIG_ROOT "${xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${libX11.out}/share/X11/locale" --set QTCOMPOSE "${libX11.out}/share/X11/locale"
''; '';
} }

View file

@ -1,10 +1,10 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
../modules/baseline.nix ../modules/baseline.nix
../modules/cli.nix ../modules/cli.nix
../modules/gnome ../modules/gnome
../modules/graphical.nix ../modules/graphical.nix
../modules/security-tools.nix ../modules/security-tools.nix
]; ];
} }

View file

@ -1,10 +1,10 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
../modules/baseline.nix ../modules/baseline.nix
../modules/cli.nix ../modules/cli.nix
../modules/sway ../modules/sway
../modules/graphical.nix ../modules/graphical.nix
../modules/security-tools.nix ../modules/security-tools.nix
]; ];
} }

View file

@ -1,9 +1,9 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
../modules/auto-update.nix ../modules/auto-update.nix
../modules/baseline.nix ../modules/baseline.nix
../modules/cli.nix ../modules/cli.nix
]; ];
services.openssh.enable = true; services.openssh.enable = true;
} }