diff --git a/pkgs/k3s-killall.nix b/pkgs/k3s-killall.nix new file mode 100644 index 0000000..10cf086 --- /dev/null +++ b/pkgs/k3s-killall.nix @@ -0,0 +1 @@ +import ./k3s-killall diff --git a/pkgs/k3s-killall/.gitignore b/pkgs/k3s-killall/.gitignore new file mode 100644 index 0000000..60651a8 --- /dev/null +++ b/pkgs/k3s-killall/.gitignore @@ -0,0 +1,4 @@ +.* +\#* +*~ +!.gitignore diff --git a/pkgs/k3s-killall/LICENSE b/pkgs/k3s-killall/LICENSE new file mode 100644 index 0000000..21bc460 --- /dev/null +++ b/pkgs/k3s-killall/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 James Andariese + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/pkgs/k3s-killall/README.md b/pkgs/k3s-killall/README.md new file mode 100644 index 0000000..46d9bf9 --- /dev/null +++ b/pkgs/k3s-killall/README.md @@ -0,0 +1,26 @@ +# `juicefs` + +A nix flake involving juicefs. + +## Usage + +After [configuring your nix install to work with flakes][EnableFlakes]: + +```bash +nix run github:kryptkitty/juicefs# +``` + +or + +```bash +nix run github:kryptkitty/juicefs#juicefs +``` + +or, if you don't have nix and don't know if you want it yet, here's a docker command that will do the same + +```bash +docker run -ti nixos/nix nix run github:kryptkitty/juicefs# --extra-experimental-features nix-command --extra-experimental-features flakes +``` + + +[EnableFlakes]: https://nixos.wiki/wiki/Flakes#Enable_flakes diff --git a/pkgs/k3s-killall/default.nix b/pkgs/k3s-killall/default.nix new file mode 100644 index 0000000..47bef2c --- /dev/null +++ b/pkgs/k3s-killall/default.nix @@ -0,0 +1,28 @@ +{pkgs ? import "${import }" {}, ...}: + +with builtins; +with pkgs.lib; +let + shq = escapeShellArg; + installSh = fetchurl { + url = "https://raw.githubusercontent.com/k3s-io/k3s/master/install.sh"; + sha256 = "0f26m5yqwpg8kvwyy2sqsd9kzzyf9jbffplqrsfk4mmwr25r2kvh"; + }; +in + +pkgs.runCommand "k3s-killall" { + name = "k3s-killall"; + version = "0f26m5yqwpg8kvwyy2sqsd9kzzyf9jbffplqrsfk4mmwr25r2kvh"; +} '' + set -x + set -e + mkdir -p $out/bin + cat ${shq installSh} | awk ' + /create_killall[(][)] [{]/ {ka=1;} + ka && /^#!.*sh/ {p=1;} + ka && once && p && /EOF/ {p=0;once=0;} + once && p {print;} + BEGIN { once = 1;} + ' > $out/bin/k3s-killall + chmod +x $out/bin/k3s-killall +'' diff --git a/pkgs/k3s-killall/flake.lock b/pkgs/k3s-killall/flake.lock new file mode 100644 index 0000000..31b79d2 --- /dev/null +++ b/pkgs/k3s-killall/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1665259268, + "narHash": "sha256-ONFhHBLv5nZKhwV/F2GOH16197PbvpyWhoO0AOyktkU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c5924154f000e6306030300592f4282949b2db6c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/k3s-killall/flake.nix b/pkgs/k3s-killall/flake.nix new file mode 100644 index 0000000..7f74173 --- /dev/null +++ b/pkgs/k3s-killall/flake.nix @@ -0,0 +1,23 @@ +# to use this file as a template, search for EDIT and modify the associated variable as needed + +{ + # EDIT: package/flake description to be shared + description = "k3s-killall packaged as a flake"; + + # EDIT: set desired nixpkgs release to track + inputs.nixpkgs.url = "nixpkgs/nixos-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = ({ self, nixpkgs, flake-utils}: + (flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + # EDIT: bring in all the packages we're exposing + packages = pkgs.callPackage ./default.nix { inherit pkgs; }; + + # EDIT: set the default package when running the flake as `nix run repo#` + defaultPackage = packages.k3s-killall; + in { inherit packages defaultPackage; } + )) + ); +} diff --git a/pkgs/k3s-killall/poop/oijwef b/pkgs/k3s-killall/poop/oijwef new file mode 100644 index 0000000..1b7ad98 --- /dev/null +++ b/pkgs/k3s-killall/poop/oijwef @@ -0,0 +1,7 @@ +awk ' + /create_killall[(][)] [{]/ {ka=1;} + ka && /^#!.*sh/ {p=1;} + ka && once && p && /EOF/ {p=0;once=0;} + once && p {print;} + BEGIN { once = 1;} +'