Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile
@573
573 / readme.md
Created August 25, 2024 21:17
nix haskell tip

<@lxsameer:matrix.org> hey folks, do you know how I can extend the following derivation: drv = pkgs.haskell.pcakages.ghc96.withPackages (p: (with p;[ .....]); with more haskell packages that use the same compiler instance?

(pkgs.haskell.packages.ghc96.override { overrides = hself: hsuper: { ...; } }).withPackages ...;

@573
573 / readme.md
Created August 24, 2024 20:16
nix-instantiate equivalent for nix repl multi line strings

cat multilinetest.nix

{
  test = ''
  fields: ["wanted", "queued"]
  '';
}
@573
573 / readme.md
Last active August 19, 2024 20:08
powershell tip remove folders and contents recursively that are buried deeper than windows path length

had the rare case of a folder created by whatever process folder named cd C:\Users\user\AppData\Local\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\deep\deep\down

which made both takeown /f "C:\Users\user" /S HOSTNAME /u domain\username /r /d J and icacls "C:\Users\user" /setowner "domain\username" /T /C (was trial and error icacls, see at bottom what is the right approach once buried folder is removed) terminate prematurely due to the path length barrier.

cd C:\Users\user\AppData\Local\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\Anwendungsdaten\deep\deep\down
$path = (dir .\subfolder_in_buried_folder\anyfile_therein).FullName
$object = New-Object -ComObject Scripting.FileSystemObject
$output = $object.GetFile($path)
Write-Host "`n`n The short path of this directory is" $output.shortpath.trim("anyfile_therein")
@573
573 / readme.md
Last active August 19, 2024 10:25
permanent Alias with pwsh not powershell
@573
573 / flakeupdate.log
Last active August 13, 2024 07:59
flake update error attachment (discourse)
evaluating file '<nix/derivation-internal.nix>'
using cache entry 'gitRevCount:{"rev":"280d91ed26b605fed9467aac7a12ca9886b3c508"}' -> '{"revCount":1799}'
using cache entry 'gitLastModified:{"rev":"280d91ed26b605fed9467aac7a12ca9886b3c508"}' -> '{"lastModified":1723477346}'
using cache entry 'fetchToStore:{"fingerprint":"280d91ed26b605fed9467aac7a12ca9886b3c508","method":"nar","name":"source","path":"/","store":"/nix/store"}' -> '{"storePath":"k63skmwznv2dffss8y3c4p7zg211hjqk-source"}'
performing daemon worker op: 11
acquiring write lock on '/nix/var/nix/temproots/162469'
performing daemon worker op: 1
using cache entry 'fetchToStore:{"fingerprint":"280d91ed26b605fed9467aac7a12ca9886b3c508","method":"nar","name":"source","path":"/","store":"/nix/store"}' -> 'null', '/nix/store/k63skmwznv2dffss8y3c4p7zg211hjqk-source'
store path cache hit for '/home/nixos/.nix-config/'
performing daemon worker op: 26
@573
573 / readme.md
Last active August 8, 2024 07:41
Powershell tip which

Split-Path -Path (Get-Command git).Path -Parent