nix-build flake:nixpkgs -A hello
nix-build -I nixpkgs=flake:github:NixOS/nixpkgs/nixos-23.05 '<nixpkgs>' -A hello
NIX_PATH=nixpkgs=flake:nixpkgs nix-build '<nixpkgs>' -A hello
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
#let set_image_counter(n: 0) = { | |
counter(figure.where(kind: image)).update(n) | |
} |
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/env bash | |
file=./input.txt | |
sed -i s/eighthree/83/g $file | |
sed -i s/eightwo/82/g $file | |
sed -i s/sevenine/79/g $file | |
sed -i s/fiveight/58/g $file | |
sed -i s/threeight/38/g $file | |
sed -i s/twone/21/g $file |
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
{ | |
description = "A basic rust devshell flake"; | |
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
inputs.flake-utils.url = "github:numtide/flake-utils"; | |
outputs = { self, nixpkgs, flake-utils }: | |
flake-utils.lib.eachDefaultSystem (system: | |
let pkgs = nixpkgs.legacyPackages.${system}; | |
in { | |
devShells.default = |
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
{ | |
description = "A basic flake with a shell"; | |
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
inputs.flake-utils.url = "github:numtide/flake-utils"; | |
outputs = { self, nixpkgs, flake-utils }: | |
flake-utils.lib.eachDefaultSystem (system: | |
let pkgs = nixpkgs.legacyPackages.${system}; | |
in { | |
devShells.default = pkgs.mkShell { |
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
{ | |
description = "F# DevShell"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, flake-utils, ... }@inputs: | |
flake-utils.lib.eachDefaultSystem (system: |
Nix generally assumes run-time dependencies is a subset of the build-time dependencies.
This means many Nix builder functions try to automatically scan the output for runtime dependencies and "rewrite" them for runtime usage.
However shell scripts which are often exported by packages do not get this automatic scanning treatment.
This means you have to use the makeWrapper
package and use either the makeWrapper
or wrapProgram
utility functions.
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
open System | |
// Create a rectangular array of chars | |
let read2DCharArray rowCount colCount = | |
let rows = [| for _ in 1 .. rowCount -> Console.ReadLine() |> Array.ofSeq |] | |
Array2D.init rowCount colCount (fun i j -> rows[i][j]) | |
// Create a jagged array of chars | |
let read2DCharArrayJagged rows = | |
[| for _ in 1 .. rows -> Console.ReadLine() |> Array.ofSeq |] |
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
#------------------------------------# | |
# Get the blurred lock screen effect # | |
# using swaybg, grim and ffmpeg on # | |
# wayland. # | |
#------------------------------------# | |
#!/bin/env bash | |
path=/tmp/tmpbg.png | |
pathout=/tmp/tmpbgblur.png |
NewerOlder