add nix flake

This commit is contained in:
Denis Lehmann 2021-07-14 18:30:21 +02:00
parent 927011f624
commit fd389951df
2 changed files with 95 additions and 0 deletions

40
flake.lock Normal file
View File

@ -0,0 +1,40 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1623875721,
"narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1625919529,
"narHash": "sha256-Epn7JRegnKN81hQh4hGx1FOwfp3fBxDCIuSZDgqaBQ4=",
"path": "/nix/store/yh05k932arpkhblqrxnjcp28fpqh7nia-source",
"rev": "cf59fbd539681f5ec2f4a82cf77aae7ab827a03f",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

55
flake.nix Normal file
View File

@ -0,0 +1,55 @@
{
description = "A colorful wallpaper generator";
nixConfig.bash-prompt = "\[\\e[1m\\e[34mhuepaper-develop\\e[0m\]$ ";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Package
packages.huepaper =
pkgs.python3Packages.buildPythonPackage rec {
name = "huepaper";
src = self;
nativeBuildInputs = with pkgs; [
wrapGAppsHook
];
propagatedBuildInputs = with pkgs; [
python3Packages.colour
python3Packages.pillow
];
};
defaultPackage = self.packages.${system}.huepaper;
# Development shell
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
python3
python3Packages.colour
python3Packages.pillow
python3Packages.pip
python3Packages.setuptools
python3Packages.virtualenv
];
};
}
);
}