Skip to content

Instantly share code, notes, and snippets.

View countoren's full-sized avatar

oren countoren

  • Carlson Software
View GitHub Profile
{
outputs = { self, nixpkgs }:
let system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
# while this works (nix run)
packages.${system}.default = pkgs.writeShellScriptBin "hello" "echo bla";
# this wont build try with nix run
@countoren
countoren / vimrc-with-qljs.nix
Created September 23, 2021 01:24
this is vimrc generated from the the nix expression
" configuration generated by NIX
set nocompatible
filetype indent plugin on | syn on
let g:nix_plugin_locations = {}
let g:nix_plugin_locations['ale'] = "/nix/store/myrl8snydw1rbymc61jqvb1s79l9826m-vimplugin-ale-2021-07-17/share/vim-plugins/ale"
let g:nix_plugin_locations['quick-lint-js'] = "/nix/store/aca6p89mpbkz9bqsfkbxwwxr185c9cnv-vimplugin-quick-lint-js/share/vim-plugins/quick-lint-js"
""While /nix/store/aca6p89mpbkz9bqsfkbxwwxr185c9cnv-vimplugin-quick-lint-js/share/vim-plugins/quick-lint-js contains:
""/nix/store/aca6p89mpbkz9bqsfkbxwwxr185c9cnv-vimplugin-quick-lint-js/share/vim-plugins/quick-lint-js/
function! Tapi_sp(bufnum, arglist)
let winid = bufwinid(a:bufnum)
let path = get(a:arglist, 0, '')
if winid == -1 || empty(path)
return
endif
call win_execute(winid, 'sp ' . path)
endfunction
# can be runned with
# printf '\033]51;["call", "Tapi_sp", ["%s"]]\007' "/somepath/config/" - does not throw error - buffer name : config/
@countoren
countoren / shell.nix
Created April 17, 2020 21:11
shell nix example with vscodeEnv
with import <nixpkgs>{};
let vscodeEnv = (callPackage (fetchFromGitHub {
owner="countoren";
repo="VSCodeEnv";
rev="3992e93fa762b3982c04362da0cd74942350000e";
sha256="050abfl9tikwn51nb4zva3gxxawp1xynwkf1qw4s7jqgdaz06qx27";
}) {}).vscodeEnv;
in
mkShell {
buildInputs = [
@countoren
countoren / shell.nix
Created April 17, 2020 21:11
shell nix example with vscodeEnv
with import <nixpkgs>{};
let vscodeEnv = (callPackage (fetchFromGitHub {
owner="countoren";
repo="VSCodeEnv";
rev="3992e93fa762b3982c04362da0cd74942350000e";
sha256="050abfl9tikwn51nb4zva3gxxawp1xynwkf1qw4s7jqgdaz06qx27";
}) {}).vscodeEnv;
in
mkShell {
buildInputs = [
with import <nixpkgs>{};
runCommand "getfromInternet" { buildInputs = [ curl ];} ''curl www.google.com > $out''
@countoren
countoren / nix rest exmample
Last active January 8, 2020 19:57
for Sr. Jappie
# curl --insecure -b tok -H "Prefer:odata.maxpagesize=1000" 'https://domain:maybePort/b1s/v1/UserQueries' > sql/UserQueries-sql.sql
with import <nixpkgs> {};
let
curlCmd = "${curl}/bin/curl";
serverUrl = "domain:maybePort";
database = "something";
_jq = "${jq}/bin/jq";
_perl = "${perl}/bin/perl";
_awk = "${gawk}/bin/awk";
@countoren
countoren / mkShellWithVSCode.nix
Last active December 13, 2019 15:31
A nix function to bring vscode with extensions into a nix-shell
{ pkgs ? import <nixpkgs> {}
, vscode-personal ? import ./vscode-personal.nix { inherit pkgs; }
}:
with pkgs;
let
les = [
{
name = "csharp";
publisher = "ms-vscode";
hie = (import (fetchFromGitHub {
owner="domenkozar";
repo="hie-nix";
# 0.6.0.0
rev="6794005";
sha256="0pc90ns0xcsa6b630d8kkq5zg8yzszbgd7qmnylkqpa0l58zvnpn";
}) { });
hieWrapper = writeShellScriptBin "hieWrapper" ''
${hie.hie86}/bin/hie "$@"
@countoren
countoren / shell.nix
Created April 2, 2019 03:00
shell nix java
with import <nixpkgs> {};
let
ps1902 = import ./nixpkgs.nix;
jiraSDK = ps1902.callPackage (import ./jiraSDK.nix) {};
nixpkgsUtils = fetchFromGitHub {
owner="countoren";
repo="nixpkgs";
rev="0c0d4c67f335a4a288e2a43197c35780af9ed0e7";
sha256="168dn0c09322djsshcjly14q11i20knsnaxn9jw61rhkd3k1zqzf";
};