Configurations, hotkeys, etc
This commit is contained in:
parent
bca25a36fc
commit
05440c39a2
4
README.md
Normal file
4
README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Nix config
|
||||
|
||||
## Don't make it public!
|
||||
- hwp2021pizzazz not public
|
98
flake.lock
98
flake.lock
|
@ -1,33 +1,15 @@
|
|||
{
|
||||
"nodes": {
|
||||
"cachix": {
|
||||
"locked": {
|
||||
"lastModified": 1621718065,
|
||||
"narHash": "sha256-2xw+iyUzV3blVq0EQjL2Qhzpp3r9uCLzYQns4nW7m7Y=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ac60476ed94fd5424d9f3410c438825f793a8cbb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-20.09",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1621794721,
|
||||
"narHash": "sha256-JXfTSZUu9EVbT9D/MFsx0cXfa8bw1NFCzIxZ7gO73Uo=",
|
||||
"lastModified": 1622014903,
|
||||
"narHash": "sha256-tEXRBi5aMprNLbzMb6YmTy3cO9smvqC2udKyRo6rj2o=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "90493027e33ba9eb3f50dc1da365d0e4ca31bf14",
|
||||
"rev": "b840707a87f6a35a5c24ea6edf8846741d924616",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -36,22 +18,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"libglvnd": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1619809792,
|
||||
"narHash": "sha256-5gcPRyUISQZm/rme2eNcMeiywaVOChjrEqG2+UY1Uz4=",
|
||||
"owner": "NVIDIA",
|
||||
"repo": "libglvnd",
|
||||
"rev": "0f0d49f0f3707f26f68bc44f4cd83144f5f4de86",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NVIDIA",
|
||||
"repo": "libglvnd",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1620983891,
|
||||
|
@ -69,50 +35,29 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1621863927,
|
||||
"narHash": "sha256-5B3oDdtDsxxVvZjZOOYe7tQ9wH8HDGwfwzMqNNeglDE=",
|
||||
"lastModified": 1622059058,
|
||||
"narHash": "sha256-t1/ZMtyxClVSfcV4Pt5C1YpkeJ/UwFF3oitLD7Ch/UA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "05d9b4d61965f51e9740644a3ffc6b6a0c0b2eb8",
|
||||
"rev": "84aa23742f6c72501f9cc209f29c438766f5352d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "master",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-wayland": {
|
||||
"inputs": {
|
||||
"cachix": "cachix",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1621932488,
|
||||
"narHash": "sha256-rtVK/+XTvTYYgI8ciaMXCO2cuY6ZvWaWxd8R+xZfl04=",
|
||||
"owner": "colemickens",
|
||||
"repo": "nixpkgs-wayland",
|
||||
"rev": "bc4bb082b3b1e47552b317d8c54a0f6e5d0b8a52",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "colemickens",
|
||||
"repo": "nixpkgs-wayland",
|
||||
"type": "github"
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1621840840,
|
||||
"narHash": "sha256-o6h6+d5ZwrFmOTe+ma9s1Z9kyHsCW1C84IA8RZ9/fIU=",
|
||||
"owner": "nixos",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ea7d4aa9b8225abd6147339f0d56675d6f1f0fd1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
|
@ -121,27 +66,8 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"libglvnd": "libglvnd",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-wayland": "nixpkgs-wayland",
|
||||
"sway": "sway"
|
||||
}
|
||||
},
|
||||
"sway": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1621241334,
|
||||
"narHash": "sha256-C+6g5B58dTWxbb2zY2oqzgwbU9IDZ6F9mQujr+1pwSw=",
|
||||
"owner": "swaywm",
|
||||
"repo": "sway",
|
||||
"rev": "12e223e7973f7d7132d95c6302328067dec732ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "swaywm",
|
||||
"repo": "sway",
|
||||
"type": "github"
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
46
flake.nix
46
flake.nix
|
@ -1,28 +1,26 @@
|
|||
{
|
||||
description = "Malte Tammena's system configuration";
|
||||
|
||||
inputs.nixpkgs = { url = "github:NixOS/nixpkgs/master"; };
|
||||
inputs.nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; };
|
||||
inputs.nixos-hardware = {
|
||||
url = "github:NixOS/nixos-hardware";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
inputs.home-manager = {
|
||||
url = "github:nix-community/home-manager/";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
inputs.nixpkgs-wayland = {
|
||||
url = "github:colemickens/nixpkgs-wayland";
|
||||
};
|
||||
inputs.sway = {
|
||||
url = "github:swaywm/sway";
|
||||
flake = false;
|
||||
};
|
||||
inputs.libglvnd = {
|
||||
url = "github:NVIDIA/libglvnd";
|
||||
flake = false;
|
||||
};
|
||||
#inputs.nixpkgs-wayland = {
|
||||
# url = "github:colemickens/nixpkgs-wayland";
|
||||
#};
|
||||
#inputs.sway = {
|
||||
# url = "github:swaywm/sway";
|
||||
# flake = false;
|
||||
#};
|
||||
#inputs.libglvnd = {
|
||||
# url = "github:NVIDIA/libglvnd";
|
||||
# flake = false;
|
||||
#};
|
||||
|
||||
outputs = { self, nixpkgs, nixos-hardware, home-manager, nixpkgs-wayland, ... }@inputs:
|
||||
outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
username = "malte";
|
||||
|
@ -43,7 +41,6 @@
|
|||
offload.enable = true;
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
intelBusId = "PCI:0:2:0";
|
||||
|
||||
};
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
@ -97,23 +94,6 @@
|
|||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
services.dbus.packages = [ pkgs.gnome3.dconf ];
|
||||
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
|
||||
nix = {
|
||||
# add binary caches
|
||||
binaryCachePublicKeys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||
];
|
||||
binaryCaches = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nixpkgs-wayland.cachix.org"
|
||||
];
|
||||
};
|
||||
|
||||
#nixpkgs.overlays = [ nixpkgs-wayland.overlay ];
|
||||
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
|
@ -24,36 +24,39 @@ in {
|
|||
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
tdesktop
|
||||
hledger
|
||||
(script "hwp2021pizzazz" ./scripts/uni/hwp2021pizzazz.py)
|
||||
discord-canary
|
||||
feh
|
||||
firefox
|
||||
ponymix
|
||||
gimp
|
||||
gnome3.nautilus
|
||||
gnome3.sushi
|
||||
hicolor-icon-theme
|
||||
nixfmt
|
||||
qt5ct
|
||||
wl-clipboard
|
||||
libnotify
|
||||
discord-canary
|
||||
qucs-s
|
||||
libreoffice
|
||||
logisim
|
||||
feh
|
||||
hledger
|
||||
htop
|
||||
mosh
|
||||
pavucontrol
|
||||
rtorrent
|
||||
screenfetch
|
||||
vlc
|
||||
wev
|
||||
youtube-dl
|
||||
gimp
|
||||
inkscape
|
||||
kbdlight
|
||||
libnotify
|
||||
libreoffice
|
||||
logisim
|
||||
mosh
|
||||
nixfmt
|
||||
patchelf
|
||||
pavucontrol
|
||||
ponymix
|
||||
qt5ct
|
||||
qucs
|
||||
qucs-s
|
||||
rtorrent
|
||||
screenfetch
|
||||
tdesktop
|
||||
unison
|
||||
(script "hwp2021pizzazz" ./scripts/uni/hwp2021pizzazz.py)
|
||||
vlc
|
||||
wev
|
||||
wl-clipboard
|
||||
xdg_utils
|
||||
xournalpp
|
||||
youtube-dl
|
||||
];
|
||||
|
||||
keyboard = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i python -p python39
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i python -p python39 p7zip
|
||||
|
||||
# Execute in a directory of your choice, like this:
|
||||
# > hwp2021pizzazz.py downloaded_all_submissions_from_moodle.zip
|
||||
|
@ -34,7 +34,6 @@ import os
|
|||
import pathlib
|
||||
import subprocess
|
||||
import shutil
|
||||
import patoolib
|
||||
|
||||
def run(*args, cwd=None):
|
||||
res = subprocess.run(list(args), cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
@ -77,7 +76,8 @@ def unzip_main(main_file):
|
|||
|
||||
|
||||
def extract_archive(src, dst):
|
||||
patoolib.extract_archive(src, outdir=dst)
|
||||
shutil.unpack_archive(src, dst)
|
||||
#patoolib.extract_archive(src, outdir=dst)
|
||||
|
||||
|
||||
def print_submission_info():
|
||||
|
@ -142,9 +142,21 @@ def copy_pdfs_for_correction():
|
|||
if len(pdfs) == 1:
|
||||
shutil.copy(pdfs[0], os.path.join(sub_path, CORRECT_PDF))
|
||||
|
||||
def extractfiles(zipname, output_dir):
|
||||
"""Extract files with 7z utils."""
|
||||
res = subprocess.run(["7z", "x", "-aoa", "-bd", zipname, f"-o{output_dir}"], stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
|
||||
return(res)
|
||||
|
||||
|
||||
def register_extensions():
|
||||
"""Register additionnal archive formats supported by 7zip in shutil."""
|
||||
shutil.register_unpack_format('rar', ['.rar', '.RAR'], extractfiles)
|
||||
shutil.register_unpack_format('7z', ['.7z', '.7Z'], extractfiles)
|
||||
|
||||
|
||||
if not os.path.exists(TARGET):
|
||||
if len(sys.argv) >= 2:
|
||||
register_extensions()
|
||||
main_file = sys.argv[1]
|
||||
unzip_main(main_file)
|
||||
delete_garbage_dirs()
|
||||
|
|
|
@ -11,17 +11,23 @@ let
|
|||
bemenu = (import ./bemenu.nix) pkgs;
|
||||
grim = "${pkgs.grim}/bin/grim";
|
||||
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||
slurp = "${pkgs.slurp}/bin/slurp";
|
||||
screenshot-path = "/home/malte/Pictures/screenshot/screenshot.png";
|
||||
wf-recorder = "${pkgs.wf-recorder}/bin/wf-recorder";
|
||||
slurp = "${pkgs.slurp}/bin/slurp -db '#000000AA' -c '#EBDBB2' -w1";
|
||||
fuser = "${pkgs.psmisc}/bin/fuser";
|
||||
screenshot-path = "/home/malte/Pictures/screenshots/screenshot.png";
|
||||
screencast-path = "/home/malte/Videos/screencasts/screencast.mp4";
|
||||
|
||||
screenshot-all = ''
|
||||
${grim} ${screenshot-path} && ${wl-copy} < ${screenshot-path}
|
||||
'';
|
||||
${grim} ${screenshot-path} && ${wl-copy} < ${screenshot-path}'';
|
||||
|
||||
screenshot-region = ''
|
||||
${grim} -g "$(${slurp} -db '#000000AA' -c '#81A1C1AA' -w2)" ${screenshot-path} && \
|
||||
${wl-copy} < ${screenshot-path}
|
||||
'';
|
||||
${grim} -g "$(${slurp})" ${screenshot-path} && ${wl-copy} < ${screenshot-path}'';
|
||||
|
||||
screencast-all = ''${wf-recorder} -a -f ${screencast-path}'';
|
||||
|
||||
screencast-region = ''${wf-recorder} -a -g "$$(${slurp})" -f ${screencast-path}'';
|
||||
|
||||
screencast-stop = ''killall -s SIGINT wf-recorder && ${wl-copy} < ${screencast-path}'';
|
||||
|
||||
in {
|
||||
imports = [ ./gammastep.nix ./waybar.nix ./gtk.nix ./qt.nix ./pass.nix ./mako.nix ];
|
||||
|
@ -31,8 +37,10 @@ in {
|
|||
home.packages = with pkgs; [
|
||||
numix-cursor-theme
|
||||
pkgs.grim
|
||||
wl-clipboard
|
||||
pkgs.slurp
|
||||
pkgs.wf-recorder
|
||||
psmisc
|
||||
wl-clipboard
|
||||
];
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
|
@ -119,17 +127,25 @@ in {
|
|||
"XF86AudioLowerVolume" =
|
||||
"exec ${pkgs.ponymix}/bin/ponymix decrease 5%";
|
||||
"XF86AudioMute" = "exec ${pkgs.ponymix}/bin/ponymix toggle";
|
||||
"XF86AudioMicMute" = "exec ${pkgs.ponymix}/bin/ponymix --input toggle";
|
||||
# Additional menus
|
||||
"${mod}+p" = "exec passmenu-bemenu";
|
||||
# Screenshots
|
||||
"${mod}+Ctrl+s" = "exec ${screenshot-all}";
|
||||
"${mod}+Ctrl+Shift+s" = "exec ${screenshot-region}";
|
||||
# Screencasts
|
||||
"${mod}+Ctrl+r" = "exec ${screencast-all}; mode recording";
|
||||
"${mod}+Ctrl+Shift+r" = "exec ${screencast-region}; mode recording";
|
||||
};
|
||||
|
||||
gaps = { smartBorders = "on"; };
|
||||
|
||||
assigns = {
|
||||
|
||||
"5" = [
|
||||
# University stuff to make my life easy
|
||||
{ title = "Korrektur.pdf . Xournal++"; }
|
||||
{ title = ".*HWP Betreuung/Skript.pdf"; }
|
||||
];
|
||||
};
|
||||
|
||||
fonts = {
|
||||
|
@ -137,6 +153,14 @@ in {
|
|||
size = 9.0;
|
||||
};
|
||||
|
||||
modes = let
|
||||
mod = config.wayland.windowManager.sway.config.modifier;
|
||||
in {
|
||||
recording = {
|
||||
"${mod}+Escape" = "exec ${screencast-stop}; mode default";
|
||||
};
|
||||
};
|
||||
|
||||
input = {
|
||||
# Build into the Thinkpad
|
||||
"1:1:AT_Translated_Set_2_keyboard" = {
|
||||
|
|
57
overlays/patool.nix
Normal file
57
overlays/patool.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, p7zip,
|
||||
unzip, cabextract, zip, zopfli, lzip, zpaq, gnutar, gnugrep, diffutils, file,
|
||||
gzip, bzip2, xz}:
|
||||
|
||||
# unrar is unfree, as well as 7z with unrar support, not including it (patool doesn't support unar)
|
||||
|
||||
let
|
||||
compression-utilities = [
|
||||
p7zip
|
||||
unzip
|
||||
gnutar
|
||||
cabextract
|
||||
zip
|
||||
zopfli
|
||||
lzip
|
||||
zpaq
|
||||
gzip
|
||||
gnugrep
|
||||
diffutils
|
||||
bzip2
|
||||
file
|
||||
xz
|
||||
];
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
pname = "patool";
|
||||
version = "1.12";
|
||||
|
||||
#pypi doesn't have test data
|
||||
src = fetchFromGitHub {
|
||||
owner = "wummel";
|
||||
repo = pname;
|
||||
rev = "upstream/${version}";
|
||||
sha256 = "0v4r77sm3yzh7y1whfwxmp01cchd82jbhvbg9zsyd2yb944imzjy";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace patoolib/util.py \
|
||||
--replace "path = None" 'path = append_to_path(os.environ["PATH"], "${lib.makeBinPath compression-utilities}")'
|
||||
'';
|
||||
|
||||
checkInputs = [ pytestCheckHook ] ++ compression-utilities;
|
||||
|
||||
disabledTests = [
|
||||
"test_unzip"
|
||||
"test_unzip_file"
|
||||
"test_zip"
|
||||
"test_zip_file"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "portable archive file manager";
|
||||
homepage = "https://wummel.github.io/patool/";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [ marius851000 ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue