The nixos.org website suggests to use:
sh <(curl -L https://nixos.org/nix/install)For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume| import SwiftUI | |
| import PlaygroundSupport | |
| struct ContentView: View { | |
| @State var text = "" | |
| var body: some View { | |
| SearchBar(text: $text) | |
| } | |
| } |
The nixos.org website suggests to use:
sh <(curl -L https://nixos.org/nix/install)For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume| #!/bin/sh | |
| # make sure you have imagemagick installed: brew install imagemagick | |
| # your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file | |
| # put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons | |
| x=my_icon.png | |
| y=${x%.*} | |
| # delete the export directory so we start clean |
| import Foundation | |
| enum TargetEnum: Codable { | |
| case first(SomeObject) | |
| case second(OtherObject) | |
| enum CodingKeys: CodingKey { | |
| case type | |
| } |
| extension Result { | |
| public func `catch`(_ handler: () throws -> Success) -> Result<Success, Error> { | |
| flatMapError { _ in | |
| .init { try handler() } | |
| } | |
| } | |
| public func `catch`(_ handler: (Failure) throws -> Success) -> Result<Success, Error> { | |
| flatMapError { error in | |
| .init { try handler(error) } |
| // | |
| // GeometryReaderStack.swift | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
| // of the Software, and to permit persons to whom the Software is furnished to do so, | |
| // subject to the following conditions: | |
| // |
For this to work you need swift-sh installed.
#!/usr/bin/env swift-sh
import ArgumentParser // apple/swift-argument-parser
import HummingbirdFoundation // hummingbird-project/hummingbird
struct WebServer: ParsableCommand {
@Option(name: .shortAndLong)
var port: Int = 8001
| // TODO: Depend on https://github.com/21GramConsulting/Beton instead |