Must share nixpkgs

This commit is contained in:
Mats Rauhala 2021-11-24 19:26:58 +02:00
parent e61eeaf61f
commit 44d1541503
3 changed files with 137 additions and 0 deletions

75
flake.lock Normal file
View File

@ -0,0 +1,75 @@
{
"nodes": {
"easy-hls": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1636606878,
"narHash": "sha256-rLxYl7iYP9vQhSvVlV2uRCdgrqKDz/vN1Z8ZmA8itkM=",
"owner": "jkachmar",
"repo": "easy-hls-nix",
"rev": "edd5710946d46ea40810ef9a708b084d7e05a118",
"type": "github"
},
"original": {
"owner": "jkachmar",
"repo": "easy-hls-nix",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1615055905,
"narHash": "sha256-Ig7CXgE5C3mwtTVBl8nSTessa1oMAm6Pm/p+T6iAJD8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f3fc074642a25ef5a1423412f09946149237e338",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1637238590,
"narHash": "sha256-zGI/dR9WZvfZE0Eyk7zC4Y8ukxC/oSbfApqIvSCtB+o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "57407fed58509a8d731d525f39842ea5ab696237",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"easy-hls": "easy-hls",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
}
}
},
"root": "root",
"version": 7
}

58
flake.nix Normal file
View File

@ -0,0 +1,58 @@
{
description = "A very basic flake";
inputs = {
easy-hls = { url = "github:jkachmar/easy-hls-nix"; };
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, easy-hls }:
{
overlay = final: prev: {
haskellPackages = prev.haskellPackages.override ( old: {
overrides = final.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
reddit-pub = f.callPackage ./. {};
});
} );
};
}
//
flake-utils.lib.eachSystem ["x86_64-linux" "x86_64-darwin"] ( system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
hp = pkgs.haskellPackages;
hls = (easy-hls.withGhcs [ hp.ghc.version ] ).${system};
in
rec {
packages = { inherit (hp) reddit-pub; };
defaultPackage = packages.reddit-pub;
devShell =
hp.shellFor {
packages = h: [h.reddit-pub];
withHoogle = true;
buildInputs = with pkgs; [
dhall-lsp-server
entr
cabal-install
hp.hlint
stylish-haskell
ghcid
hls
rrdtool
jq
sqlite-interactive
sqlite-interactive
hp.graphmod
];
};
}
);
}

View File

@ -20,6 +20,10 @@ maintainer: mats.rauhala@iki.fi
-- copyright: -- copyright:
-- category: -- category:
extra-source-files: CHANGELOG.md extra-source-files: CHANGELOG.md
data-files: dhall/*.dhall
, dhall/AMQP/*.dhall
, dhall/Fetcher/*.dhall
, dhall/Qualifier/*.dhall
library library
ghc-options: -Wall ghc-options: -Wall