Skip to content
Snippets Groups Projects
Commit 65e54943 authored by Shae Erisson's avatar Shae Erisson
Browse files

add nix support

parent 1bdad162
Branches
Tags
1 merge request!1Nix; stack to cabal; reformat; refactor
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1670543317,
"narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1668984258,
"narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1668994630,
"narHash": "sha256-1lqx6HLyw6fMNX/hXrrETG1vMvZRGm2XVC9O/Jt0T6c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "af50806f7c6ab40df3e6b239099e8f8385f6c78b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": [
"flake-utils"
],
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1670413394,
"narHash": "sha256-M7sWqrKtOqUv9euX1t3HCxis8cPy9MNiZxQmUf0KF1o=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "1303a1a76e9eb074075bfe566518c413f6fc104e",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}
{
description = "tahoe-lafs-immutable-uploader";
inputs = {
# Nix Inputs
nixpkgs.url = "github:nixos/nixpkgs/?ref=nixos-22.11";
flake-utils.url = github:numtide/flake-utils;
pre-commit-hooks.url = github:cachix/pre-commit-hooks.nix;
pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
};
outputs = {
self,
nixpkgs,
pre-commit-hooks,
flake-utils,
}: let
utils = flake-utils.lib;
in
utils.eachDefaultSystem (system: let
compilerVersion = "ghc8107";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
hsPkgs = pkgs.haskell.packages.${compilerVersion}.override {
overrides = hfinal: hprev: {
tahoe-lafs-immutable-uploader = hfinal.callCabal2nix "tahoe-lafs-immutable-uploader" ./. {};
};
};
in rec {
packages =
utils.flattenTree
{tahoe-lafs-immutable-uploader = hsPkgs.tahoe-lafs-immutable-uploader;};
# nix flake check
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
fourmolu.enable = true;
cabal-fmt.enable = true;
};
};
};
# nix develop
devShell = hsPkgs.shellFor {
inherit (self.checks.${system}.pre-commit-check) shellHook;
withHoogle = true;
packages = p: [
p.tahoe-lafs-immutable-uploader
];
buildInputs = with pkgs;
[
cabal2nix
haskellPackages.cabal-fmt
haskellPackages.cabal-install
haskellPackages.fourmolu
haskellPackages.ghcid
hsPkgs.haskell-language-server
nodePackages.serve
]
++ (builtins.attrValues (import ./scripts.nix {s = pkgs.writeShellScriptBin;}));
};
# nix build
defaultPackage = packages.tahoe-lafs-immutable-uploader;
});
}
name: tahoe-lafs-immutable-uploader
version: 0.1.0.0
github: "githubuser/tahoe-lafs-immutable-uploader"
license: BSD3
author: "Author name here"
maintainer: "example@example.com"
copyright: "2020 Author name here"
extra-source-files:
- README.md
- ChangeLog.md
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/githubuser/tahoe-lafs-immutable-uploader#readme>
dependencies:
- base >= 4.7 && < 5
library:
source-dirs: src
default-extensions:
- "OverloadedStrings"
dependencies:
- extra
- monad-loops
- crypto-api
- cryptonite
- cipher-aes128
- primitive
- containers
- bytestring
- "base32 >= 0.2"
- cereal
- text
- text-format
- filepath
- directory
- fec
- async
- memory
executables:
tahoe-lafs-encrypt-chk:
main: Main.hs
source-dirs: app
default-extensions:
- "OverloadedStrings"
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- tahoe-lafs-immutable-uploader
- bytestring
- text
- "base32 >= 0.2"
- optparse-applicative
tests:
tahoe-lafs-immutable-uploader-test:
main: Spec.hs
source-dirs: test
default-extensions:
- "OverloadedStrings"
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- tahoe-lafs-immutable-uploader
- bytestring
- text
- tasty
- tasty-hunit
- fec
- cipher-aes128
- crypto-api
- "base32 >= 0.2"
- base64
- temporary
- cereal
{s}: rec
{
ghcidScript = s "dev" "ghcid --command 'cabal new-repl lib:haskellintro' --allow-eval --warnings";
allScripts = [ghcidScript];
}
# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
#
# The location of a snapshot can be provided as a file or url. Stack assumes
# a snapshot provided as a file might change, whereas a url resource does not.
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-16.26
# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# subdirs:
# - auto-update
# - wai
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver.
# These entries can reference officially published versions as well as
# forks / in-progress versions pinned to a git hash. For example:
#
# extra-deps:
# - acme-missiles-0.3
# - git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#
extra-deps:
- "cipher-aes128-0.7.0.5@sha256:95c6327b0c93839f56e74cace17d9b85292214975bac9e8b7c13ebb725ba3856,3777"
- "fec-0.1.1@sha256:916d302856260e975d778d23b8369a6267bca561e5614852044958caa89954dd,1287"
- "base32-0.2.0.0@sha256:a50b8f9da31af2fa3e4eda3d6e33c16b85ea6e0ffe391621e910c64cb0034c6f,2732"
- "text-format-0.3.2@sha256:2a3fc17cf87120fcfdbca62a0da59759755549285841cdc1483081c35fb3d115,1814"
# Override default flag values for local packages and extra-deps
# flags: {}
# Extra package databases containing global packages
# extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=2.1"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages:
- completed:
hackage: cipher-aes128-0.7.0.5@sha256:95c6327b0c93839f56e74cace17d9b85292214975bac9e8b7c13ebb725ba3856,3777
pantry-tree:
size: 1232
sha256: af923f62ac037ef55c67ab8d1d98a3c1d020623ca9c97143e553f7a90f75e888
original:
hackage: cipher-aes128-0.7.0.5@sha256:95c6327b0c93839f56e74cace17d9b85292214975bac9e8b7c13ebb725ba3856,3777
- completed:
hackage: fec-0.1.1@sha256:916d302856260e975d778d23b8369a6267bca561e5614852044958caa89954dd,1287
pantry-tree:
size: 430
sha256: 4cc825d2b161a52f2e0aafc59ebb94c0cb6c45994fc249369f4dbed36fcf9965
original:
hackage: fec-0.1.1@sha256:916d302856260e975d778d23b8369a6267bca561e5614852044958caa89954dd,1287
- completed:
hackage: base32-0.2.0.0@sha256:a50b8f9da31af2fa3e4eda3d6e33c16b85ea6e0ffe391621e910c64cb0034c6f,2732
pantry-tree:
size: 1935
sha256: 2c6d5bf7ff235ef622cf515b0c162e34010b55e8e6f2e0af8fd2c596e72f9f1a
original:
hackage: base32-0.2.0.0@sha256:a50b8f9da31af2fa3e4eda3d6e33c16b85ea6e0ffe391621e910c64cb0034c6f,2732
- completed:
hackage: text-format-0.3.2@sha256:2a3fc17cf87120fcfdbca62a0da59759755549285841cdc1483081c35fb3d115,1814
pantry-tree:
size: 1029
sha256: 2db26ddb77184186e0d5b2b020bdfbeb044c168024767b1fa3691682ca618896
original:
hackage: text-format-0.3.2@sha256:2a3fc17cf87120fcfdbca62a0da59759755549285841cdc1483081c35fb3d115,1814
snapshots:
- completed:
size: 533252
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/26.yaml
sha256: cdbc5db9c1afe80a5998247939027a0c7db92fa0f20b5cd01596ec3da628b622
original: lts-16.26
...@@ -8,9 +8,15 @@ cabal-version: 1.12 ...@@ -8,9 +8,15 @@ cabal-version: 1.12
name: tahoe-lafs-immutable-uploader name: tahoe-lafs-immutable-uploader
version: 0.1.0.0 version: 0.1.0.0
description: Please see the README on GitHub at <https://github.com/githubuser/tahoe-lafs-immutable-uploader#readme> description:
homepage: https://github.com/githubuser/tahoe-lafs-immutable-uploader#readme Please see the README on GitHub at <https://github.com/githubuser/tahoe-lafs-immutable-uploader#readme>
bug-reports: https://github.com/githubuser/tahoe-lafs-immutable-uploader/issues
homepage:
https://github.com/githubuser/tahoe-lafs-immutable-uploader#readme
bug-reports:
https://github.com/githubuser/tahoe-lafs-immutable-uploader/issues
author: Author name here author: Author name here
maintainer: example@example.com maintainer: example@example.com
copyright: 2020 Author name here copyright: 2020 Author name here
...@@ -18,8 +24,8 @@ license: BSD3 ...@@ -18,8 +24,8 @@ license: BSD3
license-file: LICENSE license-file: LICENSE
build-type: Simple build-type: Simple
extra-source-files: extra-source-files:
README.md
ChangeLog.md ChangeLog.md
README.md
source-repository head source-repository head
type: git type: git
...@@ -36,10 +42,10 @@ library ...@@ -36,10 +42,10 @@ library
Upload Upload
URIExtension URIExtension
Util Util
other-modules:
Paths_tahoe_lafs_immutable_uploader other-modules: Paths_tahoe_lafs_immutable_uploader
hs-source-dirs: ghc-options: -Wall
src hs-source-dirs: src
default-extensions: OverloadedStrings default-extensions: OverloadedStrings
build-depends: build-depends:
async async
...@@ -60,16 +66,15 @@ library ...@@ -60,16 +66,15 @@ library
, primitive , primitive
, text , text
, text-format , text-format
default-language: Haskell2010 default-language: Haskell2010
executable tahoe-lafs-encrypt-chk executable tahoe-lafs-encrypt-chk
main-is: Main.hs main-is: Main.hs
other-modules: other-modules: Paths_tahoe_lafs_immutable_uploader
Paths_tahoe_lafs_immutable_uploader hs-source-dirs: app
hs-source-dirs:
app
default-extensions: OverloadedStrings default-extensions: OverloadedStrings
ghc-options: -threaded -rtsopts -with-rtsopts=-N ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
build-depends: build-depends:
base >=4.7 && <5 base >=4.7 && <5
, base32 >=0.2 , base32 >=0.2
...@@ -77,21 +82,22 @@ executable tahoe-lafs-encrypt-chk ...@@ -77,21 +82,22 @@ executable tahoe-lafs-encrypt-chk
, optparse-applicative , optparse-applicative
, tahoe-lafs-immutable-uploader , tahoe-lafs-immutable-uploader
, text , text
default-language: Haskell2010 default-language: Haskell2010
test-suite tahoe-lafs-immutable-uploader-test test-suite tahoe-lafs-immutable-uploader-test
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
main-is: Spec.hs main-is: Spec.hs
other-modules: other-modules:
Paths_tahoe_lafs_immutable_uploader
SpecCHK SpecCHK
SpecCrypto SpecCrypto
SpecMerkle SpecMerkle
SpecUpload SpecUpload
Paths_tahoe_lafs_immutable_uploader
hs-source-dirs: hs-source-dirs: test
test
default-extensions: OverloadedStrings default-extensions: OverloadedStrings
ghc-options: -threaded -rtsopts -with-rtsopts=-N ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
build-depends: build-depends:
base >=4.7 && <5 base >=4.7 && <5
, base32 >=0.2 , base32 >=0.2
...@@ -106,4 +112,5 @@ test-suite tahoe-lafs-immutable-uploader-test ...@@ -106,4 +112,5 @@ test-suite tahoe-lafs-immutable-uploader-test
, tasty-hunit , tasty-hunit
, temporary , temporary
, text , text
default-language: Haskell2010 default-language: Haskell2010
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment