Skip to content

Instantly share code, notes, and snippets.

@judofyr
Last active January 7, 2025 17:26
Show Gist options
  • Save judofyr/5636eba8dcd12fb4b0982693607afe8c to your computer and use it in GitHub Desktop.
Save judofyr/5636eba8dcd12fb4b0982693607afe8c to your computer and use it in GitHub Desktop.
shrinkray Nix flake

Nix flake for shrinkray

# Build:
nix build .#

# Run
./result/bin/shrinkray --help
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1734119587,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1733096140,
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
}
},
"pyproject-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733540292,
"narHash": "sha256-UAW/Rs8hx6ai+lAv2c0fP21NXi3SWuJO9p0DNiEYS90=",
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"rev": "e2393999b79ea26c1d399f8fcc34db4a01665e9b",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"pyproject-nix": "pyproject-nix",
"shrinkray-src": "shrinkray-src"
}
},
"shrinkray-src": {
"flake": false,
"locked": {
"lastModified": 1729508522,
"narHash": "sha256-bN6mumHNizxpV9XQPuwhNfH4FfQYHMUMNZbfeVpzw04=",
"owner": "DRMacIver",
"repo": "shrinkray",
"rev": "85a08a67fa2302588ed8372f643629ab7f83ac23",
"type": "github"
},
"original": {
"owner": "DRMacIver",
"repo": "shrinkray",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.pyproject-nix.url = "github:pyproject-nix/pyproject.nix";
inputs.pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.shrinkray-src.url = "github:DRMacIver/shrinkray";
inputs.shrinkray-src.flake = false;
outputs =
{
nixpkgs,
flake-parts,
pyproject-nix,
shrinkray-src,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ];
systems = nixpkgs.lib.systems.flakeExposed;
perSystem =
{ pkgs, ... }:
let
python = pkgs.python3;
project = pyproject-nix.lib.project.loadPoetryPyproject {
projectRoot = shrinkray-src;
};
attrs = project.renderers.buildPythonPackage { inherit python; };
shrinkray = python.pkgs.buildPythonPackage (attrs // { dontCheckRuntimeDeps = true; });
in
{
devShells.default = pkgs.mkShell {
buildInputs = [ shrinkray ];
};
packages.default = shrinkray;
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment