From 96602259cd3701969d1881ac8b54a52f10efffaa Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:47:05 -0500 Subject: [PATCH] read desc - refactor pinned to be a module using overlays (pkgs.pinned) - refactor dev/jvm.nix to use jb ides as modules - refactor balena etcher to be its own module (its pinned) - pin intellij to an older version for plugin support - move android studio to its own module under dev/ide/jb --- common/pinned.nix | 33 --- common/users/homeModules/dev/ide/default.nix | 4 +- .../homeModules/dev/ide/jb/androidStudio.nix | 8 + .../users/homeModules/dev/ide/jb/default.nix | 3 +- common/users/homeModules/dev/ide/jb/idea.nix | 11 +- common/users/homeModules/dev/jvm.nix | 9 +- common/users/homeModules/etcher.nix | 10 + .../users/homeModules/jetbrains/overlays.nix | 198 +++++++++--------- common/users/homeModules/pinned.nix | 57 +++++ common/users/meyer/home.nix | 10 +- 10 files changed, 192 insertions(+), 151 deletions(-) delete mode 100644 common/pinned.nix create mode 100644 common/users/homeModules/dev/ide/jb/androidStudio.nix create mode 100644 common/users/homeModules/etcher.nix create mode 100644 common/users/homeModules/pinned.nix diff --git a/common/pinned.nix b/common/pinned.nix deleted file mode 100644 index 5b3fbc1..0000000 --- a/common/pinned.nix +++ /dev/null @@ -1,33 +0,0 @@ -# https://lazamar.co.uk/nix-versions/ -{ pkgs, config }: -{ - # 1.89.1 - vscode = (import - (builtins.fetchGit { - # Descriptive name to make the store path easier to identify - name = "my-old-revision"; - url = "https://github.com/NixOS/nixpkgs/"; - ref = "refs/heads/nixpkgs-unstable"; - rev = "0c19708cf035f50d28eb4b2b8e7a79d4dc52f6bb"; - }) - { - system = pkgs.system; - config = { - allowUnfree = true; - }; - }).vscode; - etcher = (import - (builtins.fetchGit { - # Descriptive name to make the store path easier to identify - name = "my-old-revision"; - url = "https://github.com/NixOS/nixpkgs/"; - ref = "refs/heads/nixpkgs-unstable"; - rev = "336eda0d07dc5e2be1f923990ad9fdb6bc8e28e3"; - }) - { - system = pkgs.system; - config = { - permittedInsecurePackages = [ "electron-19.1.9" ]; - }; - }).etcher; -} diff --git a/common/users/homeModules/dev/ide/default.nix b/common/users/homeModules/dev/ide/default.nix index c53d779..f3f9f9b 100644 --- a/common/users/homeModules/dev/ide/default.nix +++ b/common/users/homeModules/dev/ide/default.nix @@ -1,7 +1,9 @@ {pkgs, config, ...}: let - pinned = import ../../../../pinned.nix { inherit pkgs config; }; in { + imports = [ + ../../pinned.nix + ]; home = { packages = with pkgs; [ pinned.vscode diff --git a/common/users/homeModules/dev/ide/jb/androidStudio.nix b/common/users/homeModules/dev/ide/jb/androidStudio.nix new file mode 100644 index 0000000..33c939b --- /dev/null +++ b/common/users/homeModules/dev/ide/jb/androidStudio.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + home = { + packages = with pkgs; [ + android-studio-tools + android-studio + ]; + }; +} diff --git a/common/users/homeModules/dev/ide/jb/default.nix b/common/users/homeModules/dev/ide/jb/default.nix index e2021fb..cea3c0c 100644 --- a/common/users/homeModules/dev/ide/jb/default.nix +++ b/common/users/homeModules/dev/ide/jb/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ ./idea.nix + ./androidStudio.nix ]; -} \ No newline at end of file +} diff --git a/common/users/homeModules/dev/ide/jb/idea.nix b/common/users/homeModules/dev/ide/jb/idea.nix index 356de72..09902df 100644 --- a/common/users/homeModules/dev/ide/jb/idea.nix +++ b/common/users/homeModules/dev/ide/jb/idea.nix @@ -1,7 +1,10 @@ -{pkgs, ...}: { +{ pkgs, ... }: { + imports = [ + ../../../pinned.nix + ]; home = { - packages = with pkgs; [ - jetbrains.idea-ultimate + packages = with pkgs.pinned; [ + idea-ultimate ]; }; -} \ No newline at end of file +} diff --git a/common/users/homeModules/dev/jvm.nix b/common/users/homeModules/dev/jvm.nix index 5bccab8..fe380de 100644 --- a/common/users/homeModules/dev/jvm.nix +++ b/common/users/homeModules/dev/jvm.nix @@ -1,13 +1,12 @@ { pkgs, ... }: { + imports = [ + ./ide/jb/idea.nix + ./ide/jb/androidStudio.nix + ]; home = { packages = with pkgs; [ - android-studio-tools gradle jadx - android-studio - jetbrains.idea-ultimate - # jbeap.idea-ultimate - # jetbrains.pycharm-community ]; }; programs = { diff --git a/common/users/homeModules/etcher.nix b/common/users/homeModules/etcher.nix new file mode 100644 index 0000000..f1f1a7c --- /dev/null +++ b/common/users/homeModules/etcher.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + imports = [ + ./pinned.nix + ]; + home = { + packages = with pkgs.pinned; [ + etcher + ]; + }; +} diff --git a/common/users/homeModules/jetbrains/overlays.nix b/common/users/homeModules/jetbrains/overlays.nix index 32a1a89..cd91544 100644 --- a/common/users/homeModules/jetbrains/overlays.nix +++ b/common/users/homeModules/jetbrains/overlays.nix @@ -6,108 +6,108 @@ }) ( final: pkgs: - let - inherit (pkgs) jetbrains; - globalPlugins = [ - "164" - "17718" - ]; - ja-netfilter = pkgs.ja-netfilter.override { - programName = "jetbrains"; - enabledPlugins = [ - "dns" - "url" - "hideme" - "power" + let + inherit (pkgs) jetbrains; + globalPlugins = [ + "164" + "17718" ]; - pluginConfigs = { - dns = '' - [DNS] - EQUAL,jetbrains.com - EQUAL,plugin.obroom.com - ''; - url = '' - [URL] - PREFIX,https://account.jetbrains.com/lservice/rpc/validateKey.action - ''; - power = '' - [Result] - ; Suit 230914 - EQUAL,75888623192465772084955377951198306702135327313062315225563718470653661793801719178647553532410237467495550800187973529202133466238825354135988657390766050197160093050945611087414688022502220060564716139142356429494315004946432334067127515081383336664162877126600357077796107641437507844835265792365885264118815924123978949395829736969354441202826225673948313261585644898954777409621857150971668073862687253868141869122469331021430401371289707681211947592819675200121184556360932201089199282211738120006888533563163642302207579745484728384486428222208213812291528007428530070242454238203928550683105421062331094750845145505608972009635176965215115688208740845303355991059521804735078574469432870400787428253602342729300042328170420659062588195293985517003844343989763104027328569042852690996233875190439074960872926324787157115483523118473430609411096400697894536993294915535905449630056538884982426205451557516203033628658808550799424730131437543420952769712793044255279152357141856290356977839447381244929084411487482957782888343837193520146442780899122074573307925429597225835206724304378622338028349953089952976438255759582568115277066791679931555627913314296216846420738487344812850701846117667234235837952975099539950423673283,65537,860106576952879101192782278876319243486072481962999610484027161162448933268423045647258145695082284265933019120714643752088997312766689988016808929265129401027490891810902278465065056686129972085119605237470899952751915070244375173428976413406363879128531449407795115913715863867259163957682164040613505040314747660800424242248055421184038777878268502955477482203711835548014501087778959157112423823275878824729132393281517778742463067583320091009916141454657614089600126948087954465055321987012989937065785013284988096504657892738536613208311013047138019418152103262155848541574327484510025594166239784429845180875774012229784878903603491426732347994359380330103328705981064044872334790365894924494923595382470094461546336020961505275530597716457288511366082299255537762891238136381924520749228412559219346777184174219999640906007205260040707839706131662149325151230558316068068139406816080119906833578907759960298749494098180107991752250725928647349597506532778539709852254478061194098069801549845163358315116260915270480057699929968468068015735162890213859113563672040630687357054902747438421559817252127187138838514773245413540030800888215961904267348727206110582505606182944023582459006406137831940959195566364811905585377246353->31872219281407242025505148642475109331663948030010491344733687844358944945421064967310388547820970408352359213697487269225694990179009814674781374751323403257628081559561462351695605167675284372388551941279783515209238245831229026662363729380633136520288327292047232179909791526492877475417113579821717193807584807644097527647305469671333646868883650312280989663788656507661713409911267085806708237966730821529702498972114194166091819277582149433578383639532136271637219758962252614390071122773223025154710411681628917523557526099053858210363406122853294409830276270946292893988830514538950951686480580886602618927728470029090747400687617046511462665469446846624685614084264191213318074804549715573780408305977947238915527798680393538207482620648181504876534152430149355791756374642327623133843473947861771150672096834149014464956451480803326284417202116346454345929350148770746553056995922154382822307758515805142704373984019252210715650875853634697920708113806880196144197384637328982263167395073688501517286678083973976140696077590122053014085412828620051470085033364773099146103525313018873319293728800442101520384088109603555959893639842091339193857485407672132882577840295039058621747654642202620767068924079813640067442975 - EQUAL,4567779103874449240239662079205755693310005494862953689035396528991239683757589293624793159086473078120525402705628668311011890736316009197336637618610678228335893871114776326732074651573599517183986646340269857646364268233297330841971478101796167577290403903951299979151237090006996215332833149647379173998334898565513245453314930221017432024042566544774579402202436449192695033949441775713989000390069186056155554036916655795953904286792217740042538667425813361568996822385856479840230242261144865693876294228019553278637298651584820286962308928945030622629481823105481646878879253938847572671471342492590603058305,65537,24156627931985958051017183040835577271803742470193804806479316178045088981962804168393398987646446251087541768081971475544151551235525470790716604369379805327668466429966167642117961353233058515180243264560201783520956161510523416923017697354365782825500659342029196527776056976223174394946371372849906309277537461992299774200098515526818746947230488275456663264920440977381968978227273889068919338259949793686590492904029279861913225794809675826299753284990778166519152326723946780528965868736869495336993456735232755342913885746267768375682771655854436236934171901662660193080235109535758464079136573948168636773471->986236757547332986472011617696226561292849812918563355472727826767720188564083584387121625107510786855734801053524719833194566624465665316622563244215340671405971599343902468620306327831715457360719532421388780770165778156818229863337344187575566725786793391480600129482653072861971002459947277805295727097226389568776499707662505334062639449916265137796823793276300221537201727072401742985542559596685092673521228140822200236743113743661549252453726123450722876929538747702356573783116366629850199080495560991841329893037291900147497007197055572787780928474439121910577036698817920238800419515637284683828672110 - - [Args] - EQUAL,65537,24773058818499217187577663886010908531303294206336895556072197892590450942803807164562754911175164262596715237551312004078542654996496301487027034803410086499747369353221485073240039340641397198525027728751956658900801359887190562885573922317930300068615009483578963467556425525328780085523172495307229112069939166202511721671904748968934606589702999279663332403655662225374084460291376706916679151764149324177444374590606643838366605181996272409014933080082205048098737253668016260658830645459388519595314928290853199112791333551144805347785109465401055719331231478162870216035573012645710763533896540021550083104281->3,24773058818499217187577663886010908531303294206336895556072197892590450942803807164562754911175164262596715237551312004078542654996496301487027034803410086499747369353221485073240039340641397198525027728751956658900801359887190562885573922317930300068615009483578963467556425525328780085523172495307229112069939166202511721671904748968934606589702999279663332403655662225374084460291376706916679151764149324177444374590606643838366605181996272409014933080082205048098737253668016260658830645459388519595314928290853199112791333551144805347785109465401055719331231478162870216035573012645710763533896540021550083104281 - ''; - }; - }; - - overrides = { - idea-ultimate = rec { - version = "243.19420.21"; - url = "https://download.jetbrains.com/idea/ideaIU-${version}.tar.gz"; - sha256 = "1771e66c234eeae868b220129c5694e8c1eb73d4095c023d3e59b25089ea6ae7"; - }; - }; - - srcOverrideFn = - name: - { - version, - url, - sha256, - plugins ? [ ], - }: - let - versionChangedPkg = jetbrains.${name}.overrideAttrs ( - _: old: rec { - inherit version; - src = pkgs.fetchurl { - inherit url sha256; - }; - buildInputs = - old.buildInputs - ++ (with pkgs; [ - xorg.libX11 - libGL - fontconfig - ]); - } - ); - in - versionChangedPkg; - srcPatched = builtins.mapAttrs srcOverrideFn overrides; - javaAgentJar = "${ja-netfilter}/share/ja-netfilter/ja-netfilter.jar"; - vmopts = '' - --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED - --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED - -javaagent:${javaAgentJar}=jetbrains - ''; - forkingWrapper = - package: wrapperName: - let - exe = lib.getExe package; - wrapperExe = pkgs.writeShellScriptBin wrapperName '' - ${exe} "$@" >/dev/null 2>&1 & - ''; - in - pkgs.symlinkJoin { - name = package.name; - paths = [ - package - wrapperExe + ja-netfilter = pkgs.ja-netfilter.override { + programName = "jetbrains"; + enabledPlugins = [ + "dns" + "url" + "hideme" + "power" ]; - postBuild = '' - ln -s ${exe} $out/bin/${wrapperName}-unwrapped - ''; + pluginConfigs = { + dns = '' + [DNS] + EQUAL,jetbrains.com + EQUAL,plugin.obroom.com + ''; + url = '' + [URL] + PREFIX,https://account.jetbrains.com/lservice/rpc/validateKey.action + ''; + power = '' + [Result] + ; Suit 230914 + EQUAL,75888623192465772084955377951198306702135327313062315225563718470653661793801719178647553532410237467495550800187973529202133466238825354135988657390766050197160093050945611087414688022502220060564716139142356429494315004946432334067127515081383336664162877126600357077796107641437507844835265792365885264118815924123978949395829736969354441202826225673948313261585644898954777409621857150971668073862687253868141869122469331021430401371289707681211947592819675200121184556360932201089199282211738120006888533563163642302207579745484728384486428222208213812291528007428530070242454238203928550683105421062331094750845145505608972009635176965215115688208740845303355991059521804735078574469432870400787428253602342729300042328170420659062588195293985517003844343989763104027328569042852690996233875190439074960872926324787157115483523118473430609411096400697894536993294915535905449630056538884982426205451557516203033628658808550799424730131437543420952769712793044255279152357141856290356977839447381244929084411487482957782888343837193520146442780899122074573307925429597225835206724304378622338028349953089952976438255759582568115277066791679931555627913314296216846420738487344812850701846117667234235837952975099539950423673283,65537,860106576952879101192782278876319243486072481962999610484027161162448933268423045647258145695082284265933019120714643752088997312766689988016808929265129401027490891810902278465065056686129972085119605237470899952751915070244375173428976413406363879128531449407795115913715863867259163957682164040613505040314747660800424242248055421184038777878268502955477482203711835548014501087778959157112423823275878824729132393281517778742463067583320091009916141454657614089600126948087954465055321987012989937065785013284988096504657892738536613208311013047138019418152103262155848541574327484510025594166239784429845180875774012229784878903603491426732347994359380330103328705981064044872334790365894924494923595382470094461546336020961505275530597716457288511366082299255537762891238136381924520749228412559219346777184174219999640906007205260040707839706131662149325151230558316068068139406816080119906833578907759960298749494098180107991752250725928647349597506532778539709852254478061194098069801549845163358315116260915270480057699929968468068015735162890213859113563672040630687357054902747438421559817252127187138838514773245413540030800888215961904267348727206110582505606182944023582459006406137831940959195566364811905585377246353->31872219281407242025505148642475109331663948030010491344733687844358944945421064967310388547820970408352359213697487269225694990179009814674781374751323403257628081559561462351695605167675284372388551941279783515209238245831229026662363729380633136520288327292047232179909791526492877475417113579821717193807584807644097527647305469671333646868883650312280989663788656507661713409911267085806708237966730821529702498972114194166091819277582149433578383639532136271637219758962252614390071122773223025154710411681628917523557526099053858210363406122853294409830276270946292893988830514538950951686480580886602618927728470029090747400687617046511462665469446846624685614084264191213318074804549715573780408305977947238915527798680393538207482620648181504876534152430149355791756374642327623133843473947861771150672096834149014464956451480803326284417202116346454345929350148770746553056995922154382822307758515805142704373984019252210715650875853634697920708113806880196144197384637328982263167395073688501517286678083973976140696077590122053014085412828620051470085033364773099146103525313018873319293728800442101520384088109603555959893639842091339193857485407672132882577840295039058621747654642202620767068924079813640067442975 + EQUAL,4567779103874449240239662079205755693310005494862953689035396528991239683757589293624793159086473078120525402705628668311011890736316009197336637618610678228335893871114776326732074651573599517183986646340269857646364268233297330841971478101796167577290403903951299979151237090006996215332833149647379173998334898565513245453314930221017432024042566544774579402202436449192695033949441775713989000390069186056155554036916655795953904286792217740042538667425813361568996822385856479840230242261144865693876294228019553278637298651584820286962308928945030622629481823105481646878879253938847572671471342492590603058305,65537,24156627931985958051017183040835577271803742470193804806479316178045088981962804168393398987646446251087541768081971475544151551235525470790716604369379805327668466429966167642117961353233058515180243264560201783520956161510523416923017697354365782825500659342029196527776056976223174394946371372849906309277537461992299774200098515526818746947230488275456663264920440977381968978227273889068919338259949793686590492904029279861913225794809675826299753284990778166519152326723946780528965868736869495336993456735232755342913885746267768375682771655854436236934171901662660193080235109535758464079136573948168636773471->986236757547332986472011617696226561292849812918563355472727826767720188564083584387121625107510786855734801053524719833194566624465665316622563244215340671405971599343902468620306327831715457360719532421388780770165778156818229863337344187575566725786793391480600129482653072861971002459947277805295727097226389568776499707662505334062639449916265137796823793276300221537201727072401742985542559596685092673521228140822200236743113743661549252453726123450722876929538747702356573783116366629850199080495560991841329893037291900147497007197055572787780928474439121910577036698817920238800419515637284683828672110 + + [Args] + EQUAL,65537,24773058818499217187577663886010908531303294206336895556072197892590450942803807164562754911175164262596715237551312004078542654996496301487027034803410086499747369353221485073240039340641397198525027728751956658900801359887190562885573922317930300068615009483578963467556425525328780085523172495307229112069939166202511721671904748968934606589702999279663332403655662225374084460291376706916679151764149324177444374590606643838366605181996272409014933080082205048098737253668016260658830645459388519595314928290853199112791333551144805347785109465401055719331231478162870216035573012645710763533896540021550083104281->3,24773058818499217187577663886010908531303294206336895556072197892590450942803807164562754911175164262596715237551312004078542654996496301487027034803410086499747369353221485073240039340641397198525027728751956658900801359887190562885573922317930300068615009483578963467556425525328780085523172495307229112069939166202511721671904748968934606589702999279663332403655662225374084460291376706916679151764149324177444374590606643838366605181996272409014933080082205048098737253668016260658830645459388519595314928290853199112791333551144805347785109465401055719331231478162870216035573012645710763533896540021550083104281 + ''; + }; }; - wrapJetBrains = package: name: forkingWrapper (package.override { inherit vmopts; }) name; - netOverrideFn = name: _: wrapJetBrains srcPatched.${name} name; - netPatched = builtins.mapAttrs netOverrideFn overrides; - in - { - jbeap = netPatched; - } + + overrides = { + idea-ultimate = rec { + version = "243.19420.21"; + url = "https://download.jetbrains.com/idea/ideaIU-${version}.tar.gz"; + sha256 = "1771e66c234eeae868b220129c5694e8c1eb73d4095c023d3e59b25089ea6ae7"; + }; + }; + + srcOverrideFn = + name: + { version + , url + , sha256 + , plugins ? [ ] + , + }: + let + versionChangedPkg = jetbrains.${name}.overrideAttrs ( + _: old: rec { + inherit version; + src = pkgs.fetchurl { + inherit url sha256; + }; + buildInputs = + old.buildInputs + ++ (with pkgs; [ + xorg.libX11 + libGL + fontconfig + ]); + } + ); + in + versionChangedPkg; + srcPatched = builtins.mapAttrs srcOverrideFn overrides; + javaAgentJar = "${ja-netfilter}/share/ja-netfilter/ja-netfilter.jar"; + vmopts = '' + --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED + --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED + -javaagent:${javaAgentJar}=jetbrains + ''; + forkingWrapper = + package: wrapperName: + let + exe = lib.getExe package; + wrapperExe = pkgs.writeShellScriptBin wrapperName '' + ${exe} "$@" >/dev/null 2>&1 & + ''; + in + pkgs.symlinkJoin { + name = package.name; + paths = [ + package + wrapperExe + ]; + postBuild = '' + ln -s ${exe} $out/bin/${wrapperName}-unwrapped + ''; + }; + wrapJetBrains = package: name: forkingWrapper (package.override { inherit vmopts; }) name; + netOverrideFn = name: _: wrapJetBrains srcPatched.${name} name; + netPatched = builtins.mapAttrs netOverrideFn overrides; + in + { + jbeap = netPatched; + } ) ]; diff --git a/common/users/homeModules/pinned.nix b/common/users/homeModules/pinned.nix new file mode 100644 index 0000000..dbacc67 --- /dev/null +++ b/common/users/homeModules/pinned.nix @@ -0,0 +1,57 @@ +{ ... }: +{ + nixpkgs = { + overlays = [ + # self: super: + # pkgs: _: + (pkgs: _: + let + defaultOpts = { + system = pkgs.system; + config = { + allowUnfree = true; + }; + }; + in + { + # extend packages here + pinned = { + # 1.89.1 + vscode = (import + (builtins.fetchGit { + # Descriptive name to make the store path easier to identify + name = "pinned-vscode"; + url = "https://github.com/NixOS/nixpkgs/"; + ref = "refs/heads/nixpkgs-unstable"; + rev = "0c19708cf035f50d28eb4b2b8e7a79d4dc52f6bb"; + }) + defaultOpts).vscode; + # removed for having out of date electron + etcher = (import + (builtins.fetchGit { + # Descriptive name to make the store path easier to identify + name = "pinned-etcher"; + url = "https://github.com/NixOS/nixpkgs/"; + ref = "refs/heads/nixpkgs-unstable"; + rev = "336eda0d07dc5e2be1f923990ad9fdb6bc8e28e3"; + }) + { + system = pkgs.system; + config = { + permittedInsecurePackages = [ "electron-19.1.9" ]; + }; + }).etcher; + # support non-updated plugins + idea-ultimate = (import + (builtins.fetchGit { + name = "pinned-idea-ultimate"; + url = "https://github.com/NixOS/nixpkgs/"; + ref = "refs/heads/nixpkgs-unstable"; + rev = "05bbf675397d5366259409139039af8077d695ce"; + }) + defaultOpts).jetbrains.idea-ultimate; + }; + }) + ]; + }; +} diff --git a/common/users/meyer/home.nix b/common/users/meyer/home.nix index b90b9e8..d2fef8b 100644 --- a/common/users/meyer/home.nix +++ b/common/users/meyer/home.nix @@ -3,9 +3,7 @@ pkgs, inputs, ... -}: let - pinned = import ../../pinned.nix { inherit pkgs config; }; -in { +}: { nixpkgs.config.allowInsecurePredicate = (pkg: true); nixpkgs.config.allowUnfreePredicate = (pkg: true); @@ -23,6 +21,7 @@ in { ../homeModules/scripts ../homeModules/audio.nix ../homeModules/btop.nix + ../homeModules/etcher.nix ../homeModules/flameshot.nix ../homeModules/frog.nix ../homeModules/gaming.nix @@ -48,11 +47,6 @@ in { # The home.packages option allows you to install Nix packages into your # environment. - home = { - packages = with pkgs; [ - pinned.etcher - ]; - }; home.shellAliases = { sd = ''lsusb | grep Elgato | grep --perl-regexp "(?<=Device 0{0,10})[1-9]+" --only-matching | xargs printf "usb.device_address eq %s" | copy''; };