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, ... }:
{
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
}

View file

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

View file

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

View file

@ -1,28 +1,28 @@
{ stdenv, fetchFromGitHub, glib, gettext }:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-bottompanel";
version = "1901";
pname = "gnome-shell-extension-bottompanel";
version = "1901";
src = fetchFromGitHub {
owner = "Thoma5";
repo = "gnome-shell-extension-bottompanel";
rev = "3d9573896b122e9ccb02262249ca986f8dad1ebd";
sha256 = "0lp25na5plz8vp8zjsikcadgy5hyx59ys2sbd4haagcalyv7jj4q";
};
src = fetchFromGitHub {
owner = "Thoma5";
repo = "gnome-shell-extension-bottompanel";
rev = "3d9573896b122e9ccb02262249ca986f8dad1ebd";
sha256 = "0lp25na5plz8vp8zjsikcadgy5hyx59ys2sbd4haagcalyv7jj4q";
};
phases = [ "installPhase" ];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p "$out/share/gnome-shell/extensions"
cp -r "$src" "$out/share/gnome-shell/extensions/bottompanel@tmoer93"
installPhase = ''
mkdir -p "$out/share/gnome-shell/extensions"
cp -r "$src" "$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"
'';
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"
'';
meta = with stdenv.lib; {
description = "Move your GNOME 3 shell panel to the bottom";
homepage = https://github.com/Thoma5/gnome-shell-extension-bottompanel;
};
meta = with stdenv.lib; {
description = "Move your GNOME 3 shell panel to the bottom";
homepage = https://github.com/Thoma5/gnome-shell-extension-bottompanel;
};
}

View file

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

View file

@ -1,49 +1,49 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
firefox
brave
gimp
mpv
libreoffice
tdesktop
steam
pavucontrol
gnome3.dconf-editor
glxinfo
steam-run
discord
environment.systemPackages = with pkgs; [
firefox
brave
gimp
mpv
libreoffice
tdesktop
steam
pavucontrol
gnome3.dconf-editor
glxinfo
steam-run
discord
(vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with pkgs.vscode-extensions; [
bbenoist.Nix
ms-python.python
ms-vscode.cpptools
ms-azuretools.vscode-docker
];
})
(vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with pkgs.vscode-extensions; [
bbenoist.Nix
ms-python.python
ms-vscode.cpptools
ms-azuretools.vscode-docker
];
})
];
];
# environment.systemPackages = with pkgs; [ retroarch ];
# nixpkgs.config.retroarch = {
# enableParallelN64 = true;
# enableNestopia = true;
# enableHiganSFC = true;
# };
# environment.systemPackages = with pkgs; [ retroarch ];
# nixpkgs.config.retroarch = {
# enableParallelN64 = true;
# enableNestopia = true;
# enableHiganSFC = true;
# };
services.xserver.deviceSection = ''
Option "VariableRefresh" "true"
'';
services.xserver.deviceSection = ''
Option "VariableRefresh" "true"
'';
hardware = {
pulseaudio.enable = true;
pulseaudio.support32Bit = true;
opengl.driSupport32Bit = true;
};
hardware = {
pulseaudio.enable = true;
pulseaudio.support32Bit = 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, ... }:
{
services.xserver.displayManager.sessionCommands = ''
xinput list | cut -d= -f2 | cut -f1 | xargs -i xinput set-prop {} 'libinput Scroll Distance Scale' 2 1
'';
services.xserver.displayManager.sessionCommands = ''
xinput list | cut -d= -f2 | cut -f1 | xargs -i xinput set-prop {} 'libinput Scroll Distance Scale' 2 1
'';
nixpkgs.overlays = [(self: super: {
xorg = super.xorg.overrideScope' (selfB: superB: {
inherit (super.xorg) xlibsWrapper;
xf86inputlibinput = superB.xf86inputlibinput.overrideAttrs (attr: {
patches = [ ./b7b5c5ef5f34802fc5f57e68493afaea5db7cdb4.diff ];
});
nixpkgs.overlays = [
(self: super: {
xorg = super.xorg.overrideScope' (selfB: superB: {
inherit (super.xorg) xlibsWrapper;
xf86inputlibinput = superB.xf86inputlibinput.overrideAttrs (attr: {
patches = [ ./b7b5c5ef5f34802fc5f57e68493afaea5db7cdb4.diff ];
});
})];
});
})
];
}

View file

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

View file

@ -1,14 +1,27 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
exiftool burpsuite nmap masscan binutils remmina openvpn socat ghidra-bin
wfuzz gobuster dirb pwndbg thc-hydra metasploit
environment.systemPackages = with pkgs; [
exiftool
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 = {
wireshark.enable = true;
wireshark.package = pkgs.wireshark;
};
programs = {
wireshark.enable = true;
wireshark.package = pkgs.wireshark;
};
}

View file

@ -1,29 +1,36 @@
{ config, pkgs, ... }:
{
programs.sway.enable = true;
programs.sway.enable = true;
environment.variables.GTK_THEME = "Yaru-dark";
environment.variables.MOZ_ENABLE_WAYLAND = "1";
environment.variables.GTK_THEME = "Yaru-dark";
environment.variables.MOZ_ENABLE_WAYLAND = "1";
environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Yaru-dark
gtk-icon-theme-name=Numix
'';
environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Yaru-dark
gtk-icon-theme-name=Numix
'';
# hardware.bluetooth.enable = true;
# services.blueman.enable = true;
services.gvfs.enable = true;
programs.dconf.enable = true;
networking.networkmanager.enable = true;
# hardware.bluetooth.enable = true;
# services.blueman.enable = true;
services.gvfs.enable = true;
programs.dconf.enable = true;
networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [
numix-icon-theme yaru-theme
gnome3.networkmanagerapplet gnome3.file-roller gnome3.adwaita-icon-theme
mate.mate-terminal xfce.thunar i3status xfce.thunar-archive-plugin caffeine-ng
wf-recorder
];
environment.systemPackages = with pkgs; [
numix-icon-theme
yaru-theme
gnome3.networkmanagerapplet
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, autoPatchelfHook, requireFile, libxkbcommon, 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
, autoPatchelfHook
, requireFile
, libxkbcommon
, 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 {
name = "binary-ninja-personal";
name = "binary-ninja-personal";
src = requireFile {
name = "BinaryNinja-personal.zip";
url = "https://binary.ninja";
sha256 = "5dae72ad0d31f7439cf4232a5324a31857ce4e0e593c85c62520c94ff171b4a2";
};
src = requireFile {
name = "BinaryNinja-personal.zip";
url = "https://binary.ninja";
sha256 = "5dae72ad0d31f7439cf4232a5324a31857ce4e0e593c85c62520c94ff171b4a2";
};
nativeBuildInputs = [
autoPatchelfHook libxkbcommon stdenv.cc.cc.lib 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
];
nativeBuildInputs = [
autoPatchelfHook
libxkbcommon
stdenv.cc.cc.lib
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;
dontPatchELF = true;
dontStrip = true;
dontPatchELF = true;
installPhase = ''
mkdir -p $out/lib $out/bin $out/share
mv $NIX_BUILD_TOP/$sourceRoot $out/lib/binary-ninja
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"
makeWrapper $out/lib/binary-ninja/binaryninja $out/bin/binaryninja \
--set QT_XKB_CONFIG_ROOT "${xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${libX11.out}/share/X11/locale"
'';
installPhase = ''
mkdir -p $out/lib $out/bin $out/share
mv $NIX_BUILD_TOP/$sourceRoot $out/lib/binary-ninja
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"
makeWrapper $out/lib/binary-ninja/binaryninja $out/bin/binaryninja \
--set QT_XKB_CONFIG_ROOT "${xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${libX11.out}/share/X11/locale"
'';
}

View file

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

View file

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

View file

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