-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscripts.nix
More file actions
31 lines (28 loc) · 740 Bytes
/
scripts.nix
File metadata and controls
31 lines (28 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ pkgs, ... }:
let
iommuGroups = pkgs.writeScriptBin "iommuGroups"
''
#!${pkgs.bash}/bin/bash
set -e -o pipefail
shopt -s nullglob
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=''${d#*/iommu_groups/*}; n=''${n%%/*}
printf 'IOMMU Group %s ' "$n"
${pkgs.pciutils}/bin/lspci -nns "''${d##*/}"
done;
'';
replace-ssh-agent = pkgs.writeScriptBin "replace-ssh-agent"
''
#!${pkgs.bash}/bin/bash
set -e -o pipefail
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
gpg-connect-agent updatestartuptty /bye
'';
in
{
environment.systemPackages =
[ iommuGroups
replace-ssh-agent
];
}