convert to flakes

This commit is contained in:
Cyryl Płotnicki 2022-06-25 09:14:15 +01:00
parent 8387b4f402
commit 383c126c6a
5 changed files with 128 additions and 31 deletions

3
.envrc
View File

@ -1 +1,2 @@
eval "$(lorri direnv)"
use flake

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
public/
resources/_gen/
.direnv/

58
flake.lock Normal file
View File

@ -0,0 +1,58 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1655876541,
"narHash": "sha256-eOz1YNclUTobC2f9meWpw+idhzWImdti43OKjLBoDq8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a0edeb02ae5b92eda6efbee4e26d8c33c15063fd",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1656065134,
"narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

54
flake.nix Normal file
View File

@ -0,0 +1,54 @@
{
description = "legdur: verify integrity of large directories over time";
inputs = {
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, flake-compat }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
netlify-deployer = pkgs.python38Packages.buildPythonPackage rec {
pname = "netlify_deployer";
version = "0.5.2";
src = pkgs.python38Packages.fetchPypi {
inherit pname version;
sha256 =
"aae0092b36e7408281ad73269b446c701edaacecc8ba1a07cc85671e3ddfae6e";
};
propagatedBuildInputs = with pkgs;
with pkgs.python38Packages; [
requests
git
pbr
wheel
setuptools
];
doCheck = false;
};
customPython =
pkgs.python38.buildEnv.override { extraLibs = [ netlify-deployer ]; };
in rec {
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs;
with pkgs.python38Packages; [
git
hugo
cacert
requests
pip
virtualenv
customPython
];
};
});
}

View File

@ -1,31 +1,14 @@
let
pkgs = import <nixpkgs> {};
netlify-deployer = pkgs.python38Packages.buildPythonPackage rec {
pname = "netlify_deployer";
version = "0.5.2";
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ./.;
}).shellNix
src = pkgs.python38Packages.fetchPypi {
inherit pname version;
sha256 = "aae0092b36e7408281ad73269b446c701edaacecc8ba1a07cc85671e3ddfae6e";
};
propagatedBuildInputs = with pkgs; with pkgs.python38Packages; [ requests git pbr wheel setuptools ];
doCheck = false;
};
customPython = pkgs.python38.buildEnv.override {
extraLibs = [ netlify-deployer ];
};
in
pkgs.mkShell {
buildInputs = with pkgs; with pkgs.python38Packages; [
git
hugo
cacert
requests
pip
virtualenv
customPython
];
}