Skip to content

Instantly share code, notes, and snippets.

View NickCao's full-sized avatar
😋

Nick Cao NickCao

😋
View GitHub Profile
@NickCao
NickCao / xorg.py
Created July 2, 2023 08:49
xorg.py
import requests
import json
import pandas as pd
from bs4 import BeautifulSoup
from packaging import version
allversions = []
for component in [
"individual/app",
@NickCao
NickCao / riscv-gnu-toolchain.nix
Created December 8, 2022 06:59
riscv-gnu-toolchain.nix
{ lib
, stdenv
, fetchFromGitHub
, util-linux
, git
, cacert
, autoconf
, automake
, curl
, python3
@NickCao
NickCao / qt.patch
Created November 22, 2022 05:40
qt.patch
diff --git a/pkgs/applications/misc/gpxsee/default.nix b/pkgs/applications/misc/gpxsee/default.nix
index b9a357cd02d..60b8213e333 100644
--- a/pkgs/applications/misc/gpxsee/default.nix
+++ b/pkgs/applications/misc/gpxsee/default.nix
@@ -48,8 +48,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ qmake qttools wrapQtAppsHook ];
- # NOTE: translations are only working with the qt5 build, so qt6 is English only for now
- preConfigure = lib.optionalString isQt5 ''
@NickCao
NickCao / flake.nix
Created November 13, 2022 07:07
LUKS and udevadm cleanup
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
outputs = { self, nixpkgs }: with nixpkgs.legacyPackages.x86_64-linux;{
packages.x86_64-linux.default = nixosTest {
name = "luks-udev";
nodes.machine = { pkgs, lib, ... }: {
virtualisation = {
emptyDiskImages = [ 512 ];
useBootLoader = true;
useEFIBoot = true;
@NickCao
NickCao / flake.nix
Created September 26, 2022 07:40
CosmicTagger
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
flake-utils.url = "github:numtide/flake-utils";
mach-nix = {
url = "github:DavHau/mach-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
@NickCao
NickCao / casacore.nix
Created August 5, 2022 07:57
casacore
{ lib
, stdenv
, fetchFromGitHub
, cmake
, gfortran
, flex
, bison
, readline
, blas
, fftw
#! /usr/bin/env nix-shell
#! nix-shell -i perl -p perl perlPackages.LWPUserAgent perlPackages.LWPProtocolHttps
use strict;
use JSON::PP;
use LWP::UserAgent;
my $evalId = $ARGV[0] or die "Usage: $0 EVAL-ID\n";
sub fetch {
let
pkgs = import <nixpkgs> {};
inherit (pkgs) lib;
src = pkgs.fetchgit {
url = "https://gitlab.com/NickCao/RAIT";
rev = "e84e803641ec3a2dce5670275ea8d5497608f483";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = false;
sha256 = "sha256-vaRPmHrom4GEOuAdILzFpttc4vwcRVQWhLNalCco2qE=";
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "autocfg"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "cfg-if"
@NickCao
NickCao / non-root-nix-boostrap.md
Last active May 26, 2023 19:47
bootstrap nix as non-root

stage 0 (on seed machine)

build nix-static

nix build --impure --expr '(builtins.getFlake "github:NixOS/nix").packages.x86_64-linux.nix-static.overrideAttrs (_: { postPatch = "sed -i /setrlimit/d src/libstore/build/local-derivation-goal.cc src/libutil/util.cc"; })'
# copy `result/bin/nix` to target machine

stage 1 (on target machine)

build nix with custom store path

export NIX_PREFIX="$HOME/nix"