├── .envrc ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── README.md ├── flake.lock ├── flake.nix ├── hello-c ├── .gitignore ├── Makefile ├── default.nix └── hello.c ├── hello-cobol ├── .gitignore ├── Makefile ├── default.nix └── hello.cbl ├── hello-go ├── default.nix ├── go.mod └── hello.go ├── hello-poetry ├── .gitignore ├── default.nix ├── hello_poetry │ └── __init__.py ├── poetry.lock └── pyproject.toml ├── hello-rust ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── default.nix └── src │ └── main.rs ├── hello-setuptools ├── .gitignore ├── default.nix ├── hello_setuptools │ └── __init__.py ├── pyproject.toml └── setup.py ├── hello-shell └── default.nix └── scripts ├── release-key.gpg └── setup-nix.sh /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | 3 | eval "$shellHook" 4 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | jobs: 8 | flake-check: 9 | runs-on: ${{ matrix.system }} 10 | strategy: 11 | matrix: 12 | system: 13 | - macos-latest 14 | - ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | - uses: cachix/install-nix-action@v17 18 | with: 19 | extra_nix_config: | 20 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 21 | experimental-features = nix-command flakes 22 | - uses: cachix/cachix-action@v10 23 | with: 24 | name: nix-workshop 25 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 26 | - name: parse 27 | run: nix-instantiate --json --parse ./**/*.nix 28 | - name: flake-check 29 | run: | 30 | [ '${{ github.ref }}' == 'refs/heads/main' ] && cachix watch-store nix-workshop & 31 | nix flake check -L 32 | build-shell: 33 | runs-on: ${{ matrix.system }} 34 | strategy: 35 | matrix: 36 | system: 37 | - macos-latest 38 | - ubuntu-latest 39 | steps: 40 | - uses: actions/checkout@v3 41 | - uses: cachix/install-nix-action@v17 42 | with: 43 | extra_nix_config: | 44 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 45 | experimental-features = nix-command flakes 46 | - uses: cachix/cachix-action@v10 47 | with: 48 | name: nix-workshop 49 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 50 | - name: build-shell 51 | run: | 52 | SYSTEM="$(nix eval --impure --expr 'builtins.currentSystem')" 53 | [ '${{ github.ref }}' == 'refs/heads/main' ] && cachix watch-store nix-workshop & 54 | nix build -L --keep-going \ 55 | .\#devShells."$SYSTEM".default.inputDerivation 56 | build-packages: 57 | runs-on: ${{ matrix.system }} 58 | strategy: 59 | matrix: 60 | system: 61 | - macos-latest 62 | - ubuntu-latest 63 | steps: 64 | - uses: actions/checkout@v3 65 | - uses: cachix/install-nix-action@v17 66 | with: 67 | extra_nix_config: | 68 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 69 | experimental-features = nix-command flakes 70 | - uses: cachix/cachix-action@v10 71 | with: 72 | name: nix-workshop 73 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 74 | - name: build-packages 75 | run: | 76 | SYSTEM="$(nix eval --impure --expr 'builtins.currentSystem')" 77 | [ '${{ github.ref }}' == 'refs/heads/main' ] && cachix watch-store nix-workshop & 78 | nix build -L --keep-going .\#packages."$SYSTEM".default 79 | run-docker: 80 | runs-on: ubuntu-latest 81 | steps: 82 | - uses: actions/checkout@v3 83 | - uses: cachix/install-nix-action@v17 84 | with: 85 | extra_nix_config: | 86 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 87 | experimental-features = nix-command flakes 88 | - uses: cachix/cachix-action@v10 89 | with: 90 | name: nix-workshop 91 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 92 | - name: run-docker 93 | run: | 94 | SYSTEM="$(nix eval --impure --expr 'builtins.currentSystem')" 95 | [ '${{ github.ref }}' == 'refs/heads/main' ] && cachix watch-store nix-workshop & 96 | nix build -L --keep-going .\#packages."$SYSTEM".hello-docker 97 | docker load -i result | cut -f 2- -d ':' | xargs docker run 98 | check-all: 99 | runs-on: ubuntu-latest 100 | if: always() 101 | needs: 102 | - flake-check 103 | - build-shell 104 | - build-packages 105 | - run-docker 106 | steps: 107 | - uses: re-actors/alls-green@v1.1.0 108 | with: 109 | jobs: ${{ toJSON(needs) }} 110 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | ,* 3 | .*.swp 4 | .*.swo 5 | .DS_Store 6 | ### Nix ### 7 | *.drv 8 | .direnv 9 | result 10 | result-* 11 | /.pre-commit-config.yaml 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nix-workshop 2 | 3 | This aims to show how you can package a simple `Hello world!` program in every 4 | programming language with Nix. 5 | 6 | Please contribute your language of choice! 7 | 8 | ## Languages 9 | 10 | * [C](./hello-c) 11 | * [Cobol](./hello-cobol) 12 | * [Go](./hello-go) 13 | * [Python (poetry)](./hello-poetry) 14 | * [Python (setuptools)](./hello-setuptools) 15 | * [Rust](./hello-rust) 16 | * [Shell](./hello-shell) 17 | 18 | ## Usage 19 | 20 | ### Building 21 | 22 | In order to build a specific `hello` program, you can use `nix build 23 | .#hello-whatever`, for example: 24 | 25 | ```console 26 | $ nix build -L .#hello-cobol 27 | hello-cobol> unpacking sources 28 | hello-cobol> unpacking source archive /nix/store/z5vgi7ykf5rrz5j5cv3k2x7q3zsm2svq-source 29 | hello-cobol> source root is source 30 | hello-cobol> patching sources 31 | hello-cobol> updateAutotoolsGnuConfigScriptsPhase 32 | hello-cobol> configuring 33 | hello-cobol> no configure script, doing nothing 34 | hello-cobol> building 35 | hello-cobol> build flags: SHELL=/nix/store/gzcbs0pkzsv1q3rngvf4i53z3vv7vxl4-bash-5.1-p16/bin/bash PREFIX=/nix/store/9miyav5d5ky5y4603rsxss3yvsd7s2bp-hello-cobol-0.1.0 36 | hello-cobol> mkdir -p build 37 | hello-cobol> cobc -x -o build/hello-cobol hello.cbl 38 | hello-cobol> installing 39 | hello-cobol> install flags: SHELL=/nix/store/gzcbs0pkzsv1q3rngvf4i53z3vv7vxl4-bash-5.1-p16/bin/bash PREFIX=/nix/store/9miyav5d5ky5y4603rsxss3yvsd7s2bp-hello-cobol-0.1.0 install 40 | hello-cobol> mkdir -p /nix/store/9miyav5d5ky5y4603rsxss3yvsd7s2bp-hello-cobol-0.1.0/bin/ 41 | hello-cobol> install -m 755 build/hello-cobol /nix/store/9miyav5d5ky5y4603rsxss3yvsd7s2bp-hello-cobol-0.1.0/bin/ 42 | hello-cobol> post-installation fixup 43 | hello-cobol> strip is /nix/store/2jsaz8bif2shdfgbmxf1wydz4azdzzd0-clang-wrapper-11.1.0/bin/strip 44 | hello-cobol> stripping (with command strip and flags -S) in /nix/store/9miyav5d5ky5y4603rsxss3yvsd7s2bp-hello-cobol-0.1.0/bin 45 | hello-cobol> patching script interpreter paths in /nix/store/9miyav5d5ky5y4603rsxss3yvsd7s2bp-hello-cobol-0.1.0 46 | ``` 47 | *hint: the `-L` makes build logs show up* 48 | 49 | ### Running 50 | 51 | Once you've built a package, a `result` symlink will show up in your CWD, 52 | pointing to the package's location in the nix store. You can use it to run your 53 | program: 54 | 55 | ```console 56 | $ ./result/bin/hello-cobol 57 | Hello, Cobol world! 58 | ``` 59 | 60 | You can build and run a program in one go by using `nix run`: 61 | 62 | ```console 63 | $ nix run .#hello-rust 64 | Hello, Rust world! 65 | ``` 66 | 67 | ### Docker 68 | 69 | We have a special package, `hello-docker`, which demonstrates how we can 70 | generate a docker image with all our `hello-program`s. Running `hello-docker` is 71 | a little more involved, here's how you do it: 72 | 73 | ```console 74 | $ nix build -L .#hello-docker 75 | docker-image-hello-docker.tar.gz> Adding layer... 76 | docker-image-hello-docker.tar.gz> tar: Removing leading `/' from member names 77 | docker-image-hello-docker.tar.gz> Adding meta... 78 | docker-image-hello-docker.tar.gz> Cooking the image... 79 | docker-image-hello-docker.tar.gz> Finished. 80 | 81 | $ docker load -i result 82 | Loaded image: hello-docker:9qf3i2r0xr790zjrf403b6psmv1xvqr3 83 | 84 | $ docker run hello-docker:9qf3i2r0xr790zjrf403b6psmv1xvqr3 85 | Hello, C world! 86 | Hello, Cobol world! 87 | Hello, Go World! 88 | Hello, Poetry world! 89 | Hello, Rust world! 90 | Hello, Setuptools world! 91 | Hello, shell world! 92 | ``` 93 | 94 | ### All 95 | 96 | If you wish to run all `hello-program`s without using Docker, you can use the 97 | `hello-all` aggregate. It's just a shell script that call each `hello-program` 98 | for you: 99 | 100 | ```console 101 | $ nix run .#hello-all 102 | Hello, C world! 103 | Hello, Cobol world! 104 | Hello, Go World! 105 | Hello, Poetry world! 106 | Hello, Rust world! 107 | Hello, Setuptools world! 108 | Hello, shell world! 109 | ``` 110 | 111 | ## Contributing 112 | 113 | 1. `mkdir hello-$lang && cd hello-$lang` 114 | 2. Implement a program that prints `Hello, $lang world!` 115 | 3. Package it with a `default.nix` 116 | 4. Add it to `packages` in `flake.nix` 117 | 5. Update the README list 118 | 119 | If you need any help, you can open an issue here, or reach out to @lovesegfault. 120 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "locked": { 5 | "lastModified": 1656928814, 6 | "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", 7 | "owner": "numtide", 8 | "repo": "flake-utils", 9 | "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "numtide", 14 | "repo": "flake-utils", 15 | "type": "github" 16 | } 17 | }, 18 | "nixpkgs": { 19 | "locked": { 20 | "lastModified": 1658380158, 21 | "narHash": "sha256-DBunkegKWlxPZiOcw3/SNIFg93amkdGIy2g0y/jDpHg=", 22 | "owner": "NixOS", 23 | "repo": "nixpkgs", 24 | "rev": "a65b5b3f5504b8b89c196aba733bdf2b0bd13c16", 25 | "type": "github" 26 | }, 27 | "original": { 28 | "owner": "NixOS", 29 | "ref": "nixos-unstable", 30 | "repo": "nixpkgs", 31 | "type": "github" 32 | } 33 | }, 34 | "poetry2nix": { 35 | "inputs": { 36 | "flake-utils": [ 37 | "flake-utils" 38 | ], 39 | "nixpkgs": [ 40 | "nixpkgs" 41 | ] 42 | }, 43 | "locked": { 44 | "lastModified": 1657626303, 45 | "narHash": "sha256-O/JJ0hSBCmlx0oP8QGAlRrWn0BvlC5cj7/EZ0CCWHTU=", 46 | "owner": "nix-community", 47 | "repo": "poetry2nix", 48 | "rev": "920ba682377d5c0d87945c5eb6141ab8447ca509", 49 | "type": "github" 50 | }, 51 | "original": { 52 | "owner": "nix-community", 53 | "repo": "poetry2nix", 54 | "type": "github" 55 | } 56 | }, 57 | "pre-commit-hooks": { 58 | "inputs": { 59 | "flake-utils": [ 60 | "flake-utils" 61 | ], 62 | "nixpkgs": [ 63 | "nixpkgs" 64 | ] 65 | }, 66 | "locked": { 67 | "lastModified": 1656169028, 68 | "narHash": "sha256-y9DRauokIeVHM7d29lwT8A+0YoGUBXV3H0VErxQeA8s=", 69 | "owner": "cachix", 70 | "repo": "pre-commit-hooks.nix", 71 | "rev": "db3bd555d3a3ceab208bed48f983ccaa6a71a25e", 72 | "type": "github" 73 | }, 74 | "original": { 75 | "owner": "cachix", 76 | "repo": "pre-commit-hooks.nix", 77 | "type": "github" 78 | } 79 | }, 80 | "root": { 81 | "inputs": { 82 | "flake-utils": "flake-utils", 83 | "nixpkgs": "nixpkgs", 84 | "poetry2nix": "poetry2nix", 85 | "pre-commit-hooks": "pre-commit-hooks" 86 | } 87 | } 88 | }, 89 | "root": "root", 90 | "version": 7 91 | } 92 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | flake-utils.url = "github:numtide/flake-utils"; 4 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 5 | poetry2nix = { 6 | url = "github:nix-community/poetry2nix"; 7 | inputs.nixpkgs.follows = "nixpkgs"; 8 | inputs.flake-utils.follows = "flake-utils"; 9 | }; 10 | pre-commit-hooks = { 11 | url = "github:cachix/pre-commit-hooks.nix"; 12 | inputs.nixpkgs.follows = "nixpkgs"; 13 | inputs.flake-utils.follows = "flake-utils"; 14 | }; 15 | }; 16 | 17 | outputs = { self, flake-utils, nixpkgs, poetry2nix, pre-commit-hooks }: 18 | let 19 | supportedSystems = [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ]; 20 | in 21 | flake-utils.lib.eachSystem supportedSystems (system: 22 | let 23 | pkgs = import nixpkgs { 24 | inherit system; 25 | overlays = [ 26 | poetry2nix.overlay 27 | ]; 28 | }; 29 | inherit (pkgs) lib; 30 | 31 | helloPkgs = { 32 | hello-c = pkgs.callPackage ./hello-c { }; 33 | hello-cobol = pkgs.callPackage ./hello-cobol { }; 34 | hello-go = pkgs.callPackage ./hello-go { }; 35 | hello-poetry = pkgs.callPackage ./hello-poetry { }; 36 | hello-rust = pkgs.callPackage ./hello-rust { }; 37 | hello-shell = pkgs.callPackage ./hello-shell { }; 38 | hello-setuptools = pkgs.python3Packages.callPackage ./hello-setuptools { }; 39 | }; 40 | in 41 | { 42 | apps = { default = self.apps.${system}.hello-all; } 43 | // lib.mapAttrs 44 | (_: v: { type = "app"; program = lib.getExe v; }) 45 | (helloPkgs // { inherit (self.packages.${system}) hello-all; }); 46 | 47 | packages = { 48 | default = pkgs.symlinkJoin { 49 | name = "nix-workshop"; 50 | paths = [ self.packages.${system}.hello-all ] ++ (lib.attrValues helloPkgs); 51 | }; 52 | hello-all = pkgs.writeShellApplication { 53 | name = "hello-all"; 54 | runtimeInputs = lib.attrValues helloPkgs; 55 | text = lib.concatStringsSep "\n" (map lib.getExe (lib.attrValues helloPkgs)); 56 | }; 57 | hello-docker = pkgs.dockerTools.buildImage { 58 | name = "hello-docker"; 59 | copyToRoot = pkgs.buildEnv { 60 | name = "hello-root"; 61 | paths = [ self.packages.${system}.default ]; 62 | pathsToLink = [ "/bin" ]; 63 | }; 64 | config.Cmd = [ "/bin/hello-all" ]; 65 | }; 66 | } // helloPkgs; 67 | 68 | devShells.default = pkgs.mkShell { 69 | name = "nix-workshop"; 70 | 71 | inputsFrom = (lib.attrValues helloPkgs) 72 | ++ (lib.attrValues self.checks.${system}); 73 | 74 | nativeBuildInputs = with pkgs; [ 75 | # GHA 76 | act 77 | # C 78 | clang-tools 79 | cppcheck 80 | # Nix 81 | nix-linter 82 | nix-tree 83 | nixpkgs-fmt 84 | rnix-lsp 85 | # Python 86 | pyright 87 | # Rust 88 | cargo-edit 89 | cargo-fuzz 90 | rust-analyzer 91 | # Shell 92 | shellcheck 93 | shfmt 94 | # Generic 95 | graphviz 96 | ]; 97 | 98 | buildInputs = with pkgs; [ ]; 99 | }; 100 | 101 | checks.pre-commit-check = pre-commit-hooks.lib.${system}.run { 102 | src = lib.cleanSource ./.; 103 | hooks = { 104 | nix-linter.enable = true; 105 | nixpkgs-fmt.enable = true; 106 | statix.enable = true; 107 | actionlint = { 108 | enable = true; 109 | files = "^.github/workflows/"; 110 | types = [ "yaml" ]; 111 | entry = lib.getExe pkgs.actionlint; 112 | }; 113 | }; 114 | }; 115 | }); 116 | } 117 | -------------------------------------------------------------------------------- /hello-c/.gitignore: -------------------------------------------------------------------------------- 1 | ### C ### 2 | # Prerequisites 3 | *.d 4 | 5 | # Object files 6 | *.o 7 | *.ko 8 | *.obj 9 | *.elf 10 | 11 | # Linker output 12 | *.ilk 13 | *.map 14 | *.exp 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | 26 | # Shared objects (inc. Windows DLLs) 27 | *.dll 28 | *.so 29 | *.so.* 30 | *.dylib 31 | 32 | # Executables 33 | *.exe 34 | *.out 35 | *.app 36 | *.i*86 37 | *.x86_64 38 | *.hex 39 | 40 | # Debug files 41 | *.dSYM/ 42 | *.su 43 | *.idb 44 | *.pdb 45 | 46 | # Kernel Module Compile Results 47 | *.mod* 48 | *.cmd 49 | .tmp_versions/ 50 | modules.order 51 | Module.symvers 52 | Mkfile.old 53 | dkms.conf 54 | -------------------------------------------------------------------------------- /hello-c/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX ?= ./install 2 | 3 | build: hello.c 4 | mkdir -p build 5 | cc -o build/hello-c hello.c 6 | 7 | .PHONY: clean 8 | clean: 9 | rm -rf build 10 | rm -rf $(DESTDIR)$(PREFIX) 11 | 12 | .PHONY: install 13 | install: build 14 | mkdir -p $(DESTDIR)$(PREFIX)/bin/ 15 | install -m 755 build/hello-c $(DESTDIR)$(PREFIX)/bin/ 16 | -------------------------------------------------------------------------------- /hello-c/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, lib }: 2 | stdenv.mkDerivation { 3 | pname = "hello-c"; 4 | version = "0.1.0"; 5 | 6 | src = lib.cleanSource ./.; 7 | 8 | makeFlags = [ "PREFIX=${placeholder "out"}" ]; 9 | } 10 | -------------------------------------------------------------------------------- /hello-c/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) { printf("Hello, C world!\n"); } 4 | -------------------------------------------------------------------------------- /hello-cobol/.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /install/ 3 | 4 | -------------------------------------------------------------------------------- /hello-cobol/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX ?= ./install 2 | 3 | build: hello.cbl 4 | mkdir -p build 5 | cobc -x -o build/hello-cobol hello.cbl 6 | 7 | .PHONY: clean 8 | clean: 9 | rm -rf build 10 | rm -rf $(DESTDIR)$(PREFIX) 11 | 12 | .PHONY: install 13 | install: build 14 | mkdir -p $(DESTDIR)$(PREFIX)/bin/ 15 | install -m 755 build/hello-cobol $(DESTDIR)$(PREFIX)/bin/ 16 | 17 | -------------------------------------------------------------------------------- /hello-cobol/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, gnu-cobol, lib }: 2 | 3 | stdenv.mkDerivation { 4 | pname = "hello-cobol"; 5 | version = "0.1.0"; 6 | 7 | src = lib.cleanSource ./.; 8 | 9 | nativeBuildInputs = [ gnu-cobol.bin gnu-cobol.dev ]; 10 | 11 | buildInputs = [ gnu-cobol.lib ]; 12 | 13 | makeFlags = [ "PREFIX=${placeholder "out"}" ]; 14 | 15 | # disable stackprotector on aarch64-darwin for now 16 | hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ]; 17 | } 18 | -------------------------------------------------------------------------------- /hello-cobol/hello.cbl: -------------------------------------------------------------------------------- 1 | IDENTIFICATION DIVISION. 2 | PROGRAM-ID. Hello. 3 | 4 | ENVIRONMENT DIVISION. 5 | 6 | DATA DIVISION. 7 | WORKING-STORAGE SECTION. 8 | 01 ArgLen PIC 9(4). 9 | 01 Name PIC X(32). 10 | 11 | PROCEDURE DIVISION. 12 | 13 | ACCEPT ArgLen FROM ARGUMENT-NUMBER. 14 | IF ArgLen = 0 THEN 15 | MOVE "Cobol world" TO Name 16 | ELSE 17 | ACCEPT Name FROM ARGUMENT-VALUE 18 | END-IF 19 | 20 | DISPLAY "Hello, " FUNCTION TRIM(Name) "!". 21 | 22 | EXIT PROGRAM. 23 | 24 | -------------------------------------------------------------------------------- /hello-go/default.nix: -------------------------------------------------------------------------------- 1 | { buildGoModule, lib }: 2 | 3 | buildGoModule { 4 | name = "hello-go"; 5 | version = "0.1.0"; 6 | 7 | src = lib.cleanSource ./.; 8 | 9 | vendorSha256 = null; 10 | } 11 | -------------------------------------------------------------------------------- /hello-go/go.mod: -------------------------------------------------------------------------------- 1 | module nix-workshop/hello-go 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /hello-go/hello.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("Hello, Go World!") 7 | } 8 | -------------------------------------------------------------------------------- /hello-poetry/.gitignore: -------------------------------------------------------------------------------- 1 | ### Python ### 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | cover/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | .pybuilder/ 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | # For a library or package, you might want to ignore these files since the code is 88 | # intended to run in multiple environments; otherwise, check them in: 89 | # .python-version 90 | 91 | # pipenv 92 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 93 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 94 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 95 | # install all needed dependencies. 96 | #Pipfile.lock 97 | 98 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 99 | __pypackages__/ 100 | 101 | # Celery stuff 102 | celerybeat-schedule 103 | celerybeat.pid 104 | 105 | # SageMath parsed files 106 | *.sage.py 107 | 108 | # Environments 109 | .env 110 | .venv 111 | env/ 112 | venv/ 113 | ENV/ 114 | env.bak/ 115 | venv.bak/ 116 | 117 | # Spyder project settings 118 | .spyderproject 119 | .spyproject 120 | 121 | # Rope project settings 122 | .ropeproject 123 | 124 | # mkdocs documentation 125 | /site 126 | 127 | # mypy 128 | .mypy_cache/ 129 | .dmypy.json 130 | dmypy.json 131 | 132 | # Pyre type checker 133 | .pyre/ 134 | 135 | # pytype static type analyzer 136 | .pytype/ 137 | 138 | # Cython debug symbols 139 | cython_debug/ 140 | -------------------------------------------------------------------------------- /hello-poetry/default.nix: -------------------------------------------------------------------------------- 1 | { poetry2nix }: 2 | poetry2nix.mkPoetryApplication { 3 | projectDir = ./.; 4 | } 5 | -------------------------------------------------------------------------------- /hello-poetry/hello_poetry/__init__.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | print("Hello, Poetry world!") 3 | -------------------------------------------------------------------------------- /hello-poetry/poetry.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "atomicwrites" 3 | version = "1.4.0" 4 | description = "Atomic file writes." 5 | category = "dev" 6 | optional = false 7 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 8 | 9 | [[package]] 10 | name = "attrs" 11 | version = "21.4.0" 12 | description = "Classes Without Boilerplate" 13 | category = "dev" 14 | optional = false 15 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 16 | 17 | [package.extras] 18 | dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] 19 | docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] 20 | tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] 21 | tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] 22 | 23 | [[package]] 24 | name = "black" 25 | version = "22.6.0" 26 | description = "The uncompromising code formatter." 27 | category = "dev" 28 | optional = false 29 | python-versions = ">=3.6.2" 30 | 31 | [package.dependencies] 32 | click = ">=8.0.0" 33 | mypy-extensions = ">=0.4.3" 34 | pathspec = ">=0.9.0" 35 | platformdirs = ">=2" 36 | tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} 37 | typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} 38 | 39 | [package.extras] 40 | colorama = ["colorama (>=0.4.3)"] 41 | d = ["aiohttp (>=3.7.4)"] 42 | jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] 43 | uvloop = ["uvloop (>=0.15.2)"] 44 | 45 | [[package]] 46 | name = "click" 47 | version = "8.1.3" 48 | description = "Composable command line interface toolkit" 49 | category = "dev" 50 | optional = false 51 | python-versions = ">=3.7" 52 | 53 | [package.dependencies] 54 | colorama = {version = "*", markers = "platform_system == \"Windows\""} 55 | 56 | [[package]] 57 | name = "colorama" 58 | version = "0.4.5" 59 | description = "Cross-platform colored terminal text." 60 | category = "dev" 61 | optional = false 62 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 63 | 64 | [[package]] 65 | name = "iniconfig" 66 | version = "1.1.1" 67 | description = "iniconfig: brain-dead simple config-ini parsing" 68 | category = "dev" 69 | optional = false 70 | python-versions = "*" 71 | 72 | [[package]] 73 | name = "isort" 74 | version = "5.10.1" 75 | description = "A Python utility / library to sort Python imports." 76 | category = "dev" 77 | optional = false 78 | python-versions = ">=3.6.1,<4.0" 79 | 80 | [package.extras] 81 | pipfile_deprecated_finder = ["pipreqs", "requirementslib"] 82 | requirements_deprecated_finder = ["pipreqs", "pip-api"] 83 | colors = ["colorama (>=0.4.3,<0.5.0)"] 84 | plugins = ["setuptools"] 85 | 86 | [[package]] 87 | name = "mypy" 88 | version = "0.961" 89 | description = "Optional static typing for Python" 90 | category = "dev" 91 | optional = false 92 | python-versions = ">=3.6" 93 | 94 | [package.dependencies] 95 | mypy-extensions = ">=0.4.3" 96 | tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} 97 | typing-extensions = ">=3.10" 98 | 99 | [package.extras] 100 | dmypy = ["psutil (>=4.0)"] 101 | python2 = ["typed-ast (>=1.4.0,<2)"] 102 | reports = ["lxml"] 103 | 104 | [[package]] 105 | name = "mypy-extensions" 106 | version = "0.4.3" 107 | description = "Experimental type system extensions for programs checked with the mypy typechecker." 108 | category = "dev" 109 | optional = false 110 | python-versions = "*" 111 | 112 | [[package]] 113 | name = "packaging" 114 | version = "21.3" 115 | description = "Core utilities for Python packages" 116 | category = "dev" 117 | optional = false 118 | python-versions = ">=3.6" 119 | 120 | [package.dependencies] 121 | pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" 122 | 123 | [[package]] 124 | name = "pathspec" 125 | version = "0.9.0" 126 | description = "Utility library for gitignore style pattern matching of file paths." 127 | category = "dev" 128 | optional = false 129 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" 130 | 131 | [[package]] 132 | name = "platformdirs" 133 | version = "2.5.2" 134 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 135 | category = "dev" 136 | optional = false 137 | python-versions = ">=3.7" 138 | 139 | [package.extras] 140 | docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)", "sphinx (>=4)"] 141 | test = ["appdirs (==1.4.4)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)", "pytest (>=6)"] 142 | 143 | [[package]] 144 | name = "pluggy" 145 | version = "1.0.0" 146 | description = "plugin and hook calling mechanisms for python" 147 | category = "dev" 148 | optional = false 149 | python-versions = ">=3.6" 150 | 151 | [package.extras] 152 | dev = ["pre-commit", "tox"] 153 | testing = ["pytest", "pytest-benchmark"] 154 | 155 | [[package]] 156 | name = "py" 157 | version = "1.11.0" 158 | description = "library with cross-python path, ini-parsing, io, code, log facilities" 159 | category = "dev" 160 | optional = false 161 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 162 | 163 | [[package]] 164 | name = "pyparsing" 165 | version = "3.0.9" 166 | description = "pyparsing module - Classes and methods to define and execute parsing grammars" 167 | category = "dev" 168 | optional = false 169 | python-versions = ">=3.6.8" 170 | 171 | [package.extras] 172 | diagrams = ["railroad-diagrams", "jinja2"] 173 | 174 | [[package]] 175 | name = "pytest" 176 | version = "6.2.5" 177 | description = "pytest: simple powerful testing with Python" 178 | category = "dev" 179 | optional = false 180 | python-versions = ">=3.6" 181 | 182 | [package.dependencies] 183 | atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} 184 | attrs = ">=19.2.0" 185 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 186 | iniconfig = "*" 187 | packaging = "*" 188 | pluggy = ">=0.12,<2.0" 189 | py = ">=1.8.2" 190 | toml = "*" 191 | 192 | [package.extras] 193 | testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] 194 | 195 | [[package]] 196 | name = "toml" 197 | version = "0.10.2" 198 | description = "Python Library for Tom's Obvious, Minimal Language" 199 | category = "dev" 200 | optional = false 201 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 202 | 203 | [[package]] 204 | name = "tomli" 205 | version = "2.0.1" 206 | description = "A lil' TOML parser" 207 | category = "dev" 208 | optional = false 209 | python-versions = ">=3.7" 210 | 211 | [[package]] 212 | name = "typing-extensions" 213 | version = "4.2.0" 214 | description = "Backported and Experimental Type Hints for Python 3.7+" 215 | category = "dev" 216 | optional = false 217 | python-versions = ">=3.7" 218 | 219 | [metadata] 220 | lock-version = "1.1" 221 | python-versions = "^3.8" 222 | content-hash = "d6f5e43e9ee43e7479ebb488d5bebe50e3c45abecc99330345f235c03b79208d" 223 | 224 | [metadata.files] 225 | atomicwrites = [ 226 | {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, 227 | {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, 228 | ] 229 | attrs = [ 230 | {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, 231 | {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, 232 | ] 233 | black = [ 234 | {file = "black-22.6.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f586c26118bc6e714ec58c09df0157fe2d9ee195c764f630eb0d8e7ccce72e69"}, 235 | {file = "black-22.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b270a168d69edb8b7ed32c193ef10fd27844e5c60852039599f9184460ce0807"}, 236 | {file = "black-22.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6797f58943fceb1c461fb572edbe828d811e719c24e03375fd25170ada53825e"}, 237 | {file = "black-22.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c85928b9d5f83b23cee7d0efcb310172412fbf7cb9d9ce963bd67fd141781def"}, 238 | {file = "black-22.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:f6fe02afde060bbeef044af7996f335fbe90b039ccf3f5eb8f16df8b20f77666"}, 239 | {file = "black-22.6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cfaf3895a9634e882bf9d2363fed5af8888802d670f58b279b0bece00e9a872d"}, 240 | {file = "black-22.6.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94783f636bca89f11eb5d50437e8e17fbc6a929a628d82304c80fa9cd945f256"}, 241 | {file = "black-22.6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:2ea29072e954a4d55a2ff58971b83365eba5d3d357352a07a7a4df0d95f51c78"}, 242 | {file = "black-22.6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e439798f819d49ba1c0bd9664427a05aab79bfba777a6db94fd4e56fae0cb849"}, 243 | {file = "black-22.6.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:187d96c5e713f441a5829e77120c269b6514418f4513a390b0499b0987f2ff1c"}, 244 | {file = "black-22.6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:074458dc2f6e0d3dab7928d4417bb6957bb834434516f21514138437accdbe90"}, 245 | {file = "black-22.6.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a218d7e5856f91d20f04e931b6f16d15356db1c846ee55f01bac297a705ca24f"}, 246 | {file = "black-22.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:568ac3c465b1c8b34b61cd7a4e349e93f91abf0f9371eda1cf87194663ab684e"}, 247 | {file = "black-22.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6c1734ab264b8f7929cef8ae5f900b85d579e6cbfde09d7387da8f04771b51c6"}, 248 | {file = "black-22.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9a3ac16efe9ec7d7381ddebcc022119794872abce99475345c5a61aa18c45ad"}, 249 | {file = "black-22.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:b9fd45787ba8aa3f5e0a0a98920c1012c884622c6c920dbe98dbd05bc7c70fbf"}, 250 | {file = "black-22.6.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7ba9be198ecca5031cd78745780d65a3f75a34b2ff9be5837045dce55db83d1c"}, 251 | {file = "black-22.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a3db5b6409b96d9bd543323b23ef32a1a2b06416d525d27e0f67e74f1446c8f2"}, 252 | {file = "black-22.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:560558527e52ce8afba936fcce93a7411ab40c7d5fe8c2463e279e843c0328ee"}, 253 | {file = "black-22.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b154e6bbde1e79ea3260c4b40c0b7b3109ffcdf7bc4ebf8859169a6af72cd70b"}, 254 | {file = "black-22.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:4af5bc0e1f96be5ae9bd7aaec219c901a94d6caa2484c21983d043371c733fc4"}, 255 | {file = "black-22.6.0-py3-none-any.whl", hash = "sha256:ac609cf8ef5e7115ddd07d85d988d074ed00e10fbc3445aee393e70164a2219c"}, 256 | {file = "black-22.6.0.tar.gz", hash = "sha256:6c6d39e28aed379aec40da1c65434c77d75e65bb59a1e1c283de545fb4e7c6c9"}, 257 | ] 258 | click = [ 259 | {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, 260 | {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, 261 | ] 262 | colorama = [ 263 | {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, 264 | {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, 265 | ] 266 | iniconfig = [ 267 | {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, 268 | {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, 269 | ] 270 | isort = [ 271 | {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, 272 | {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, 273 | ] 274 | mypy = [ 275 | {file = "mypy-0.961-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:697540876638ce349b01b6786bc6094ccdaba88af446a9abb967293ce6eaa2b0"}, 276 | {file = "mypy-0.961-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b117650592e1782819829605a193360a08aa99f1fc23d1d71e1a75a142dc7e15"}, 277 | {file = "mypy-0.961-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:bdd5ca340beffb8c44cb9dc26697628d1b88c6bddf5c2f6eb308c46f269bb6f3"}, 278 | {file = "mypy-0.961-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3e09f1f983a71d0672bbc97ae33ee3709d10c779beb613febc36805a6e28bb4e"}, 279 | {file = "mypy-0.961-cp310-cp310-win_amd64.whl", hash = "sha256:e999229b9f3198c0c880d5e269f9f8129c8862451ce53a011326cad38b9ccd24"}, 280 | {file = "mypy-0.961-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b24be97351084b11582fef18d79004b3e4db572219deee0212078f7cf6352723"}, 281 | {file = "mypy-0.961-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f4a21d01fc0ba4e31d82f0fff195682e29f9401a8bdb7173891070eb260aeb3b"}, 282 | {file = "mypy-0.961-cp36-cp36m-win_amd64.whl", hash = "sha256:439c726a3b3da7ca84a0199a8ab444cd8896d95012c4a6c4a0d808e3147abf5d"}, 283 | {file = "mypy-0.961-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5a0b53747f713f490affdceef835d8f0cb7285187a6a44c33821b6d1f46ed813"}, 284 | {file = "mypy-0.961-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0e9f70df36405c25cc530a86eeda1e0867863d9471fe76d1273c783df3d35c2e"}, 285 | {file = "mypy-0.961-cp37-cp37m-win_amd64.whl", hash = "sha256:b88f784e9e35dcaa075519096dc947a388319cb86811b6af621e3523980f1c8a"}, 286 | {file = "mypy-0.961-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:d5aaf1edaa7692490f72bdb9fbd941fbf2e201713523bdb3f4038be0af8846c6"}, 287 | {file = "mypy-0.961-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9f5f5a74085d9a81a1f9c78081d60a0040c3efb3f28e5c9912b900adf59a16e6"}, 288 | {file = "mypy-0.961-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f4b794db44168a4fc886e3450201365c9526a522c46ba089b55e1f11c163750d"}, 289 | {file = "mypy-0.961-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:64759a273d590040a592e0f4186539858c948302c653c2eac840c7a3cd29e51b"}, 290 | {file = "mypy-0.961-cp38-cp38-win_amd64.whl", hash = "sha256:63e85a03770ebf403291ec50097954cc5caf2a9205c888ce3a61bd3f82e17569"}, 291 | {file = "mypy-0.961-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5f1332964963d4832a94bebc10f13d3279be3ce8f6c64da563d6ee6e2eeda932"}, 292 | {file = "mypy-0.961-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:006be38474216b833eca29ff6b73e143386f352e10e9c2fbe76aa8549e5554f5"}, 293 | {file = "mypy-0.961-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9940e6916ed9371809b35b2154baf1f684acba935cd09928952310fbddaba648"}, 294 | {file = "mypy-0.961-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a5ea0875a049de1b63b972456542f04643daf320d27dc592d7c3d9cd5d9bf950"}, 295 | {file = "mypy-0.961-cp39-cp39-win_amd64.whl", hash = "sha256:1ece702f29270ec6af25db8cf6185c04c02311c6bb21a69f423d40e527b75c56"}, 296 | {file = "mypy-0.961-py3-none-any.whl", hash = "sha256:03c6cc893e7563e7b2949b969e63f02c000b32502a1b4d1314cabe391aa87d66"}, 297 | {file = "mypy-0.961.tar.gz", hash = "sha256:f730d56cb924d371c26b8eaddeea3cc07d78ff51c521c6d04899ac6904b75492"}, 298 | ] 299 | mypy-extensions = [ 300 | {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, 301 | {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, 302 | ] 303 | packaging = [ 304 | {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, 305 | {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, 306 | ] 307 | pathspec = [ 308 | {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, 309 | {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, 310 | ] 311 | platformdirs = [ 312 | {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, 313 | {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, 314 | ] 315 | pluggy = [ 316 | {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, 317 | {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, 318 | ] 319 | py = [ 320 | {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, 321 | {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, 322 | ] 323 | pyparsing = [ 324 | {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, 325 | {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, 326 | ] 327 | pytest = [ 328 | {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, 329 | {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, 330 | ] 331 | toml = [ 332 | {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, 333 | {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, 334 | ] 335 | tomli = [ 336 | {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, 337 | {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, 338 | ] 339 | typing-extensions = [ 340 | {file = "typing_extensions-4.2.0-py3-none-any.whl", hash = "sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708"}, 341 | {file = "typing_extensions-4.2.0.tar.gz", hash = "sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376"}, 342 | ] 343 | -------------------------------------------------------------------------------- /hello-poetry/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "hello-poetry" 3 | version= "0.1.0" 4 | description = "Poetry + Nix Demo" 5 | authors = [ "Bernardo Meurer " ] 6 | 7 | [tool.poetry.scripts] 8 | hello-poetry = "hello_poetry:main" 9 | 10 | [tool.poetry.dependencies] 11 | python = "^3.8" 12 | 13 | [tool.poetry.dev-dependencies] 14 | pytest = "6.2.5" 15 | black = "22.6.0" 16 | isort = "5.10.1" 17 | mypy = "0.961" 18 | 19 | [tool.black] 20 | line_length = 100 21 | 22 | [tool.pytest.ini_options] 23 | addopts = "-v -Wdefault" 24 | 25 | [tool.isort] 26 | profile = "black" 27 | multi_line_output = 3 28 | line_length = 100 29 | 30 | [build-system] 31 | requires = [ "poetry" ] 32 | build-backend = "poetry.masonry.api" 33 | -------------------------------------------------------------------------------- /hello-rust/.gitignore: -------------------------------------------------------------------------------- 1 | ### Rust ### 2 | # Generated by Cargo 3 | # will have compiled files and executables 4 | debug/ 5 | target/ 6 | 7 | # These are backup files generated by rustfmt 8 | **/*.rs.bk 9 | 10 | # MSVC Windows builds of rustc generate these, which store debugging information 11 | *.pdb 12 | -------------------------------------------------------------------------------- /hello-rust/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "hello-rust" 7 | version = "0.1.0" 8 | -------------------------------------------------------------------------------- /hello-rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello-rust" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | -------------------------------------------------------------------------------- /hello-rust/default.nix: -------------------------------------------------------------------------------- 1 | { rustPlatform, lib }: 2 | 3 | rustPlatform.buildRustPackage { 4 | name = "hello-rust"; 5 | 6 | src = lib.cleanSource ./.; 7 | 8 | cargoLock.lockFile = ./Cargo.lock; 9 | } 10 | -------------------------------------------------------------------------------- /hello-rust/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, Rust world!"); 3 | } 4 | -------------------------------------------------------------------------------- /hello-setuptools/.gitignore: -------------------------------------------------------------------------------- 1 | ### Python ### 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | cover/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | .pybuilder/ 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | # For a library or package, you might want to ignore these files since the code is 88 | # intended to run in multiple environments; otherwise, check them in: 89 | # .python-version 90 | 91 | # pipenv 92 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 93 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 94 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 95 | # install all needed dependencies. 96 | #Pipfile.lock 97 | 98 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 99 | __pypackages__/ 100 | 101 | # Celery stuff 102 | celerybeat-schedule 103 | celerybeat.pid 104 | 105 | # SageMath parsed files 106 | *.sage.py 107 | 108 | # Environments 109 | .env 110 | .venv 111 | env/ 112 | venv/ 113 | ENV/ 114 | env.bak/ 115 | venv.bak/ 116 | 117 | # Spyder project settings 118 | .spyderproject 119 | .spyproject 120 | 121 | # Rope project settings 122 | .ropeproject 123 | 124 | # mkdocs documentation 125 | /site 126 | 127 | # mypy 128 | .mypy_cache/ 129 | .dmypy.json 130 | dmypy.json 131 | 132 | # Pyre type checker 133 | .pyre/ 134 | 135 | # pytype static type analyzer 136 | .pytype/ 137 | 138 | # Cython debug symbols 139 | cython_debug/ 140 | -------------------------------------------------------------------------------- /hello-setuptools/default.nix: -------------------------------------------------------------------------------- 1 | { buildPythonApplication, lib }: 2 | buildPythonApplication { 3 | pname = "hello_setuptools"; 4 | version = "0.1.0"; 5 | 6 | src = lib.cleanSource ./.; 7 | } 8 | -------------------------------------------------------------------------------- /hello-setuptools/hello_setuptools/__init__.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | print("Hello, Setuptools world!") 3 | -------------------------------------------------------------------------------- /hello-setuptools/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line_length = 100 3 | 4 | [tool.pytest.ini_options] 5 | addopts = "-v -Wdefault" 6 | 7 | [tool.isort] 8 | profile = "black" 9 | multi_line_output = 3 10 | line_length = 100 11 | 12 | [tool.flakehell] 13 | exclude = ["build"] 14 | max_line_length = 100 15 | # c.f. https://github.com/flakehell/flakehell/issues/10 16 | extended_default_ignore=[ ] 17 | 18 | [tool.flakehell.plugins] 19 | mccabe = ["+*"] 20 | pycodestyle = ["+*", "-W503"] 21 | pyflakes = ["+*"] 22 | pylint = ["+*"] 23 | -------------------------------------------------------------------------------- /hello-setuptools/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup(name = "hello_setuptools", 4 | version = "0.1.0", 5 | description = "Setuptools + Nix demo", 6 | author = "Bernardo Meurer ", 7 | packages = ["hello_setuptools"], 8 | entry_points = { 9 | "console_scripts": [ "hello_setuptools=hello_setuptools:main" ] 10 | }, 11 | ) 12 | -------------------------------------------------------------------------------- /hello-shell/default.nix: -------------------------------------------------------------------------------- 1 | # This example uses a different pattern than many of the 2 | # others in this repository, by relying on a "trivial builder" 3 | # 4 | # See the manual for more details: 5 | # 6 | # 7 | 8 | { writeShellApplication }: 9 | 10 | writeShellApplication { 11 | name = "hello-shell"; 12 | 13 | runtimeInputs = [ ]; 14 | 15 | text = '' 16 | echo Hello, shell world! 17 | ''; 18 | } 19 | -------------------------------------------------------------------------------- /scripts/release-key.gpg: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | 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 48 | qXy2HtxyhCn9+V8ki5G/znEJwor48g== 49 | =Mc2q 50 | -----END PGP PUBLIC KEY BLOCK----- 51 | -------------------------------------------------------------------------------- /scripts/setup-nix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | KEY="$(dirname "$0")/release-key.gpg" 6 | VERSION="${VERSION:=2.10.3}" 7 | CHECK_SIGNATURE=true 8 | 9 | if ! command -v gpg &>/dev/null; then 10 | echo "WARN: gpg is not available, signatures will not be checked" 11 | CHECK_SIGNATURE=false 12 | fi 13 | 14 | if [ ! -f "$KEY" ]; then 15 | echo "WARN: gpg key is not present in '$KEY', signatures will not be checked" 16 | CHECK_SIGNATURE=false 17 | fi 18 | 19 | if [ "$CHECK_SIGNATURE" == "true" ]; then 20 | gpg --quiet --import "$KEY" 21 | fi 22 | 23 | workdir=$(mktemp -d) 24 | trap 'cd ~ && rm -rf "$workdir"' EXIT 25 | 26 | INSTALLER="install-nix-$VERSION" 27 | 28 | pushd "$workdir" &>/dev/null 29 | curl -sS "https://releases.nixos.org/nix/nix-$VERSION/install" -o "$INSTALLER" 30 | curl -sS "https://releases.nixos.org/nix/nix-$VERSION/install.asc" -o "$INSTALLER.asc" 31 | if [ "$CHECK_SIGNATURE" == "true" ]; then 32 | gpg --always-trust --quiet --verify "./$INSTALLER.asc" 33 | fi 34 | chmod +x "$INSTALLER" 35 | popd &>/dev/null 36 | 37 | cat <"$workdir/nix.conf" 38 | accept-flake-config = true 39 | auto-optimise-store = true 40 | builders-use-substitutes = true 41 | connect-timeout = 5 42 | cores = 0 43 | experimental-features = nix-command flakes 44 | http-connections = 0 45 | max-jobs = auto 46 | sandbox = true 47 | substituters = https://cache.nixos.org/ https://nix-community.cachix.org 48 | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= 49 | trusted-users = root $USER 50 | EOF 51 | 52 | if [ -n "${TOKEN+x}" ]; then 53 | echo "access-tokens = github.com=$TOKEN" >>"$workdir/nix.conf" 54 | fi 55 | 56 | "$workdir/$INSTALLER" --daemon --nix-extra-conf-file "$workdir/nix.conf" 57 | --------------------------------------------------------------------------------