This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Run this script in a folder full of ".url" files, and pipe output to an HTML file. | |
# Example: ./convert_url_files_to_bookmarks.sh > bookmarks.html | |
echo "<!DOCTYPE NETSCAPE-Bookmark-file-1>" | |
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">' | |
echo '<TITLE>Bookmarks</TITLE>' | |
echo '<H1>Bookmarks</H1>' | |
echo '<DL><p>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nix-shell:~/src/cowsay]$ cat flake.nix | |
{ | |
description = "A simple script that runs cowsay"; | |
outputs = { self, nixpkgs }: { | |
defaultPackage.x86_64-linux = self.packages.x86_64-linux.my-script; | |
packages.x86_64-linux.my-script = | |
let |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix-build '<nixpkgs>' -A openscad --option build-use-substitutes false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; | |
}; | |
outputs = { self, nixpkgs }: | |
let | |
myNixpkgs = import nixpkgs { config.allowUnfree = true; system = "x86_64-linux"; }; | |
in | |
{ | |
packages.x86_64-linux.cudaThing = myNixpkgs.python3Packages.tensorflowWithCuda; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo -s | |
parted /dev/vda -- mklabel msdos | |
parted /dev/vda -- mkpart primary 1MiB -2GiB | |
parted /dev/vda -- mkpart primary linux-swap -2GiB 100% | |
mkfs.xfs -L nixos /dev/vda1 | |
mkswap -L swap /dev/vda2 | |
swapon /dev/vda2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix-shell -p hello /path/to/a/local/checkout/of/nixpkgs | |
(i don't think this actually works). | |
however | |
nix-shell -p hello -I nixpkgs=/path/to/a/local/checkout/of/nixpkgs | |
(definity works). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix-build -E "with import <nixpkgs> {}; callPackage ./default.nix {}" | |
#the greatest thing about nix code is there so many ways to exectute it, the worse thing about nix code is that there are so many ways to exectute it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(nixos-container list); do nixos-container start $i && sleep 10; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
Display *display; | |
Window window; | |
XEvent event; | |
int s; |
NewerOlder