Compare commits

..

No commits in common. "e1052d75cdec22576870f181158f97a334f6f623" and "298b4806809974fb9ed102f22241b20404cd99c4" have entirely different histories.

16 changed files with 116 additions and 101 deletions

View file

@ -166,27 +166,27 @@
]
},
"locked": {
"lastModified": 1713391096,
"narHash": "sha256-5xkzsy+ILgQlmvDDipL5xqAehnjWBenAQXV4/NLg2dE=",
"lastModified": 1712386041,
"narHash": "sha256-dA82pOMQNnCJMAsPG7AXG35VmCSMZsJHTFlTHizpKWQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f46814ec7cbef9c2aef18ca1cbe89f2bb1e8c394",
"rev": "d6bb9f934f2870e5cbc5b94c79e9db22246141ff",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"ref": "release-23.11",
"repo": "home-manager",
"type": "github"
}
},
"master": {
"locked": {
"lastModified": 1713276496,
"narHash": "sha256-qhImB8hRIRh2eMLqBSlUPKb870s4N8WJNqGfJfhSfMg=",
"lastModified": 1713124637,
"narHash": "sha256-RU0SoHGn2aYXYcnjCBg4/1S+zMZx9tA1dPUE+P2IH9g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e2ce6703871b62a77f5939d5967833b43c928ed0",
"rev": "ec2cb66cbeac92550b324009773b83401a9e2477",
"type": "github"
},
"original": {
@ -265,16 +265,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1713248628,
"narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=",
"lastModified": 1713013257,
"narHash": "sha256-ZEfGB3YCBVggvk0BQIqVY7J8XF/9jxQ68fCca6nib+8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8",
"rev": "90055d5e616bd943795d38808c94dbf0dd35abe8",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
@ -329,6 +329,7 @@
"nixpkgs": "nixpkgs",
"triton-vmtools": "triton-vmtools",
"tritonshell": "tritonshell",
"unstable": "unstable",
"wayland-pipewire-idle-inhibit": "wayland-pipewire-idle-inhibit"
}
},
@ -399,7 +400,7 @@
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
"unstable"
]
},
"locked": {
@ -424,7 +425,7 @@
"devshell": "devshell",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
"unstable"
]
},
"locked": {
@ -442,6 +443,22 @@
"url": "https://git.pub.solar/teutat3s/tritonshell"
}
},
"unstable": {
"locked": {
"lastModified": 1712963716,
"narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "cfd6b5fc90b15709b780a5a1619695a88505a176",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems_2"

View file

@ -6,8 +6,8 @@
inputs = {
# Track channels with commits tested and built by hydra
nixos-22-05.url = "github:nixos/nixpkgs/nixos-22.05";
#nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
master.url = "github:nixos/nixpkgs/master";
fork.url = "github:teutat3s/nixpkgs/fix-element-desktop-screen-sharing-23.11";
@ -18,7 +18,7 @@
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
@ -37,10 +37,10 @@
# PubSolarOS additions
triton-vmtools.url = "git+https://git.pub.solar/pub-solar/infra-vintage?ref=main&dir=vmtools";
triton-vmtools.inputs.nixpkgs.follows = "nixpkgs";
triton-vmtools.inputs.nixpkgs.follows = "unstable";
tritonshell.url = "git+https://git.pub.solar/teutat3s/tritonshell?ref=main";
tritonshell.inputs.nixpkgs.follows = "nixpkgs";
tritonshell.inputs.nixpkgs.follows = "unstable";
wayland-pipewire-idle-inhibit.url = "github:rafaelrc7/wayland-pipewire-idle-inhibit";
wayland-pipewire-idle-inhibit.inputs.nixpkgs.follows = "nixpkgs";

View file

@ -133,7 +133,8 @@
publicKey = "UhPW8jebAPaMYqjJfSFO9QAMhk0E+dq4i6lB4Wjg91Q=";
presharedKeyFile = "/etc/wireguard/wg5.presharedkey";
allowedIPs = [ "192.168.13.0/24" ];
endpoint = "ktjh20jr89gkcqwr.myfritz.net:59538";
#endpoint = "ktjh20jr89gkcqwr.myfritz.net:59538";
endpoint = "[2001:4dd0:af08:5725:9ec7:a6ff:feff:e14d]:51820";
persistentKeepalive = 25;
}
];

View file

@ -13,6 +13,33 @@ with lib; let
backupDir = "${xdg.dataHome}/PaperlessBackup";
consumptionDir = "/home/${psCfg.user.name}/.local/share/scandir";
scan2paperless = with pkgs; writeShellScriptBin "scan2paperless" ''
DEVICE=$1
NUM_PAGES=$2
NAME=$3
if [ -z "''${DEVICE}" ] || [ -z "''${NUM_PAGES}" ] || [ -z "''${NAME}" ]; then
echo "Usage: scan2paperless <device> <num_pages> <name>"
exit 1
fi
tmpDir=$(${coreutils}/bin/mktemp -d)
files=()
for i in $(seq 1 $NUM_PAGES); do
fileName=$(${openssl}/bin/openssl rand -hex 12)
file="$tmpDir/$fileName.jpg"
echo "Start scanning page $i/$NUM_PAGES";
${sane-backends}/bin/scanimage -d $DEVICE --format=jpeg --resolution 300 --progress -o $file
echo "Finished scanning page $i";
files+=($file)
done
pdf="${consumptionDir}/$NAME.pdf"
${python3Packages.img2pdf}/bin/img2pdf --output $pdf ''${files[@]}
echo "PDF written to $pdf"
'';
in {
services.paperless = {
enable = true;
@ -33,6 +60,11 @@ in {
#brscan5.enable = true;
};
users.users."${psCfg.user.name}".packages = with pkgs; [
scan2paperless
python3Packages.img2pdf
];
home-manager.users."${psCfg.user.name}" = {
home.sessionVariables = {
SCANNER_OUTPUT_DIR = consumptionDir;

View file

@ -22,15 +22,14 @@
};
services.blueman.enable = true;
services.pipewire.wireplumber.configPackages = [
# https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/bluetooth.html
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/10-bluez.conf" ''
monitor.bluez.properties = {
bluez5.enable-hw-volume = true
bluez5.enable-msbc = true
bluez5.enable-sbc-xq = true
bluez5.headset-roles = [ hsp_hs hsp_ag hfp_hf hfp_ag ]
environment.etc."wireplumber/bluetooth.lua.d/51-bluez-config.lua" = {
text = ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'')
];
'';
};
}

View file

@ -22,7 +22,7 @@ in {
services.gpg-agent = {
enable = true;
pinentryPackage = lib.mkDefault pkgs.pinentry-gnome3;
pinentryFlavor = lib.mkDefault "gnome3";
verbose = true;
};

View file

@ -30,6 +30,9 @@
multiplier = 3;
};
# When true, bold text is drawn using the bright variant of colors.
draw_bold_text_with_bright_colors = true;
font = {
# The normal (roman) font face to use.
normal = {
@ -65,7 +68,7 @@
};
};
keyboard.bindings = [
key_bindings = [
{
key = "V";
mods = "Control|Super";
@ -169,9 +172,6 @@
# Base16 Burn 256 - alacritty color config
# Benjamin Bädorf
colors = {
# When true, bold text is drawn using the bright variant of colors.
draw_bold_text_with_bright_colors = true;
# Default colors
primary = {
background = "0x1a181a";

View file

@ -6,7 +6,7 @@
}:
with lib; let
psCfg = config.pub-solar;
tomlFormat = pkgs.formats.toml {};
yamlFormat = pkgs.formats.yaml {};
sessionVariables = {
WLR_RENDERER =
if psCfg.graphical.wayland.software-renderer.enable
@ -101,7 +101,7 @@ in {
home-manager.users."${psCfg.user.name}" = {
home.file."xinitrc".source = ./.xinitrc;
xdg.configFile."alacritty/alacritty.toml".source = tomlFormat.generate "alacritty.toml" (import ./alacritty.nix);
xdg.configFile."alacritty/alacritty.yml".source = yamlFormat.generate "alacritty.yml" (import ./alacritty.nix);
xdg.configFile."xmodmap".source = ./.config/xmodmap;
xdg.configFile."user-dirs.dirs".source = ./.config/user-dirs.dirs;
xdg.configFile."user-dirs.locale".source = ./.config/user-dirs.locale;

View file

@ -11,6 +11,7 @@
"brscan5"
"brscan5-etc-files"
"facetimehd-firmware"
"nomad"
"slack"
"veracrypt"
"zoom"
@ -29,10 +30,17 @@
nix = {
# Use default version alias for nix package
package = pkgs.nixVersions.nix_2_21;
package = pkgs.nixVersions.nix_2_20;
gc.automatic = true;
optimise.automatic = true;
registry = {
nixpkgs.flake = flake.inputs.nixpkgs;
unstable.flake = flake.inputs.unstable;
master.flake = flake.inputs.master;
system.flake = flake.self;
};
settings = {
# Improve nix store disk usage
auto-optimise-store = true;

View file

@ -10,7 +10,7 @@ with lib; let
in {
services.avahi.enable = true;
services.avahi.ipv6 = true;
services.avahi.nssmdns4 = true;
services.avahi.nssmdns = true;
services.avahi.publish.enable = true;
services.avahi.publish.userServices = true;

View file

@ -88,6 +88,9 @@ in {
# Specify \q{ferdinandyb/mode-indicator} in the mode-indicator prompt
bleopt prompt_vi_mode_indicator='\q{ferdinandyb/mode-indicator}'
# In case you would like to show "-- NORMAL --" instead of "~"
bleopt keymap_vi_mode_string_nmap=$'\e[1m-- NORMAL --\e[m'
}
blehook/eval-after-load keymap_vi ferdinandyb/set-up-mode-indicator

View file

@ -26,7 +26,14 @@
};
in
{
direnv = unstable.direnv;
element-desktop = fork.element-desktop;
nixVersions = prev.nixVersions // {inherit (unstable.nixVersions) nix_2_20;};
nix-direnv = unstable.nix-direnv;
_1password = unstable._1password;
_1password-cli = unstable._1password-cli;
wayland-pipewire-idle-inhibit = unstable.wayland-pipewire-idle-inhibit;
wlvncc = unstable.wlvncc;
#vimPlugins = prev.vimPlugins // {inherit (unstable.vimPlugins) nvim-lspconfig;};
})
(import ../pkgs)

View file

@ -13,7 +13,6 @@ with prev; {
psos = writeShellScriptBin "psos" (import ./psos.nix final);
psos-docs = import ./psos-docs.nix final;
s = writeShellScriptBin "s" (import ./s.nix final);
scan2paperless = writeShellScriptBin "scan2paperless" (import ./scan2paperless.nix final);
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
swaylock-bg = writeShellScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);

View file

@ -1,59 +0,0 @@
self:
with self; ''
echo "$@"
DUPLEX=,Duplex
removeempty="true"
[[ $1 == "-s" ]] && {
DUPLEX=""
removeempty=false
shift
}
[[ $1 == "-a" ]] && {
DUPLEX=,Duplex
removeempty="true"
shift
}
[[ $1 == "-d" ]] && {
DUPLEX=,Duplex
shift
}
cleanup() {
echo finalizing pdf file.
${img2pdf}/bin/img2pdf --pdfa --output /tmp/scan2paperless_$$.pdf /tmp/scan2paperless_$$_*.png && \
rm -f /tmp/scan2paperless_$$_*.png
scp /tmp/scan2paperless_$$.pdf pub-solar@paperless.faenix.eu:~/.local/share/scandir \
&& rm -f /tmp/scan2paperless_$$* \
|| echo upload failed, retaining file /tmp/scan2paperless_$$.pdf >&2
}
trap 'cleanup; exit 1' EXIT
${sane-backends}/bin/scanimage --device 'brother5:bus1;dev5' --format=png --resolution 300 --batch=/tmp/scan2paperless_$$_%d.png --AutoDeskew=yes --batch-start=10 --source="Automatic Document Feeder(left aligned''${DUPLEX})" -x 210 -y 297
if $removeempty
then
threshold=99
images=( )
values=( )
for f in /tmp/scan2paperless_$$_*.png
do
images[''${#images[@]}]=$f
values[''${#values[@]}]=$(${imagemagick}/bin/convert "$f" -fuzz 02% -fill black +opaque white -fill white -opaque white -format "%[fx:100*mean]" info:)
done
for ((i=0;i<''${#images[@]};i++))
do
if [[ $(echo "''${values[i]} > $threshold" | ${bc}/bin/bc -l) == "1" ]]
then
# bc will output 1 if the comparison is true, 0 otherwise
echo image "''${images[i]}" was found to be mostly white, removing.
rm "''${images[i]}"
fi
done
fi
''

View file

@ -1,4 +1,4 @@
{config, pkgs, ...}: {
{config, ...}: {
pub-solar = {
# These are your personal settings
# The only required settings are `name` and `password`,
@ -15,5 +15,5 @@
];
};
};
home-manager.users.pub-solar.services.gpg-agent.pinentryPackage = pkgs.pinentry-curses;
home-manager.users.pub-solar.services.gpg-agent.pinentryFlavor = "curses";
}

View file

@ -66,16 +66,20 @@ in {
home.packages = with pkgs; [
AusweisApp2
consul
drone-docker-runner
gpu-switch
ifmetric
ipmitool
#keybase-gui
nomad
thunderbird
vault
veracrypt
waypoint
age-plugin-yubikey
#cockroach-bin
obs-studio
scan2paperless
wlvncc
];
programs.bash.initExtra = ''
@ -123,7 +127,11 @@ in {
}
complete -F _tailscale tailscale
complete -C ${pkgs.consul}/bin/consul consul
complete -C ${pkgs.nomad}/bin/nomad nomad
complete -C ${pkgs.vault}/bin/vault vault
complete -C ${flake.inputs.nixos-22-05.legacyPackages.${pkgs.system}.terraform}/bin/terraform terraform
complete -C ${pkgs.waypoint}/bin/waypoint waypoint
complete -C ${pkgs.opentofu}/bin/tofu tofu
'';