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 = "System76 Keyboard Configurator"; | |
inputs = { | |
flake-utils.url = "github:numtide/flake-utils"; | |
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; | |
naersk.url = "github:nix-community/naersk"; | |
}; | |
outputs = { self, nixpkgs, flake-utils, naersk }: |
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 = "nixpkgs"; | |
nuenv.url = "github:DeterminateSystems/nuenv"; | |
}; | |
outputs = { self, nixpkgs, nuenv }: let | |
overlays = [ nuenv.overlays.default ]; | |
systems = [ | |
"x86_64-linux" |
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 --print-build-logs "github:DeterminateSystems/nuenv" | |
# See the result | |
cat result/share/hello.txt |
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
export PATH= | |
for i in $packages; do | |
if [ "$i" = / ]; then i=; fi | |
PATH=$PATH${PATH:+:}$i/bin | |
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
# Parse the __nu_packages environment variable string, where each | |
# package path is separate by a space, and convert to a list | |
let packages = ($env.__nu_packages | split row (char space)) | |
# Convert the list to a colon-separated string | |
let $packagesPath = ( | |
$packages | |
| each { |pkg| $"($pkg)/bin" } | |
| str collect (char esep) | |
) |
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
{ | |
mkNushellDerivation = { | |
nushell, # A Nushell package | |
name, # The name of the derivation | |
src, # The derivation's sources | |
system, # The host system | |
packages ? [], # Same as in stdenv | |
build ? "", # Same as in stdenv | |
}: |
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
Say hello to <name> and add a ! to the end if <exclaim> is set. | |
Usage: | |
> sayHello {flags} <name> | |
Flags: | |
-e, --exclaim - Whether to add a ! at the end | |
-h, --help - Display the help message for this command | |
Parameters: |
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
# Say hello to <name> and add a ! to the end if <exclaim> is set. | |
def sayHello [ | |
name: string, # The person to say hello to | |
--exclaim(-e): bool, # Whether to add a ! at the end | |
] { | |
echo $"Hello, ($name)(if $exclaim { "!" })" | |
} |
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 copy \ | |
--to "s3://my-nix-stuff-bucket?region=ap-southeast-1" \ | |
".#my-package" |
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 copy \ | |
--to ssh-ng://root@"${DROPLET_IP}" \ | |
".#packages.x86_64-linux.ponysay" |
NewerOlder