cabal-version: 3.0
name: a-piece-of-flake
version: 0.0.1
synopsis: Nix flake repository for everyone
description:
The main idea behind this project is to provide a quick and simple
interface for publishing Nix flakes.
Flakes have become relatively mature and address the central repository
issue. However, the Nixpkgs repository on GitHub still has more that 5k
open issues and a comparable number of pull requests, and continues to
receive many commits every day. Getting a pull request for a new tool
merged into Nixpkgs can be difficult - the Nixpkgs README explicitly
discourages people from submitting their “pet” projects.
The Nixpkgs repository is huge. It contains more than 120k packages, but
the majority of them are not native to Nix. For example, about 10% are
Haskell packages imported. Therefore, this large number cannot be used
as a reliable measure of how well the publishing process is developed in
Nix. For instance, the PyPy repository alone currently contains almost
900k packages.
It is also important to note Python is the most popular general-purpose
programming language, and its publishing process was designed by
programmers for programmers. Yet there is no pull-request step in the
workflow. The interface is essentially “upload and forget”, which has a
significant positive impact on the conversion funnel of Python packages.
Flakes are easy to install, but the publishing workflow is not yet
polished enough. The current approach to distributing flakes appears to
have inherinted many characteristics of the Nixpkgs workflow.
For Nixpkgs, this was the natural way of development, because all
derivations form a large and coupled Nix expression split across many
files within a single Git repository.
== Service
#service#
The service is deployed at
<https://pieceofflakenixrepository.org/ a-piece-of-flake>
== Development environment
#development-environment#
> $ nix develop
> $ emacs &
> $ cabal build
> $ cabal test
=== Update cachix
#update-cachix#
> nix build --no-link --print-out-paths | cachix push piece-of-flake
==== Cachix public key
#cachix-public-key#
> piece-of-flake.cachix.org-1:JamWDEABLpvWhGHIK7Xn/qYFbdZqb6ne7IAF62fXyFY=
== Release
#release#
> $ nix build $(e -static true)
> $ ./result/bin/a-piece-of-flake run
homepage: http://github.com/yaitskov/a-piece-of-flake
license: BSD-3-Clause
license-file: LICENSE
author: Daniil Iaitskov
maintainer: dyaitskov@gmail.com
copyright: Daniil Iaitkov 2026
category: System
build-type: Simple
bug-reports: https://github.com/yaitskov/a-piece-of-flake/issues
extra-source-files:
assets/favicon.svg
assets/github.svg
assets/sitemap.xml
assets/github.svg
assets/flake.svg
assets/app.js
assets/style.css
assets/bulma.min.css
-- brotli
assets/favicon.svg.br
assets/github.svg.br
assets/flake.svg.br
assets/app.js.br
assets/style.css.br
assets/bulma.min.css.br
-- gzipped
assets/favicon.svg.gz
assets/github.svg.gz
assets/flake.svg.gz
assets/app.js.gz
assets/style.css.gz
assets/bulma.min.css.gz
assets/robots.txt
assets/flush.mp3
assets/snow.mp3
assets/avalanche.mp3
trace-embrace.yaml
extra-doc-files:
changelog.md
tested-with:
GHC == 9.12.2
source-repository head
type:
git
location:
https://github.com/yaitskov/a-piece-of-flake.git
common base
default-language: GHC2024
ghc-options: -Wall
default-extensions:
DefaultSignatures
DuplicateRecordFields
NoImplicitPrelude
OverloadedRecordDot
OverloadedStrings
TemplateHaskell
TypeFamilies
ViewPatterns
build-depends:
, base >=4.7 && < 5
, optparse-applicative < 1
, relude >= 1.2.2 && < 2
, tagged < 1
, unliftio < 1
, yesod-core < 1.8
library
import: base
hs-source-dirs: src
exposed-modules:
PieceOfFlake.Acid
PieceOfFlake.Aeson
PieceOfFlake.CmdArgs
PieceOfFlake.CmdRun
PieceOfFlake.Fetcher
PieceOfFlake.Flake
PieceOfFlake.Flake.Repo
PieceOfFlake.Http
PieceOfFlake.Index
PieceOfFlake.Page
PieceOfFlake.Prelude
PieceOfFlake.Req
PieceOfFlake.Stats
PieceOfFlake.Stm
PieceOfFlake.SubmitList
PieceOfFlake.Th
PieceOfFlake.TotalMath
PieceOfFlake.WebService
PieceOfFlake.Yesod
other-modules:
Paths_a_piece_of_flake
autogen-modules:
Paths_a_piece_of_flake
build-depends:
, acid-state < 1
, add-dependent-file < 1
, aeson < 3
, aeson-pretty < 1
, binary < 1
, blaze-markup < 1
, bytestring < 1
, cryptohash-sha1 < 1
, deepseq < 2
, either < 6
, exceptions < 1
, file-embed < 1
, filepath < 2
, full-text-search < 1
, generics-sop < 1
, hostname < 2
, http-types < 1
, lens < 6
, list-t < 2
, lrucaching < 1
, monad-logger < 1
, memory < 1
, mtl < 3
, network < 4
, non-empty < 1
, non-negative-time-diff >= 0.0.2 && < 1
, prettyprinter < 2
, process < 2
, psqueues < 1
, ref-tf < 1
, refined < 1
, regex-tdfa < 2
, req < 4
, retry < 1
, ring-buffer < 1
, safecopy < 1
, sop-core < 1
, statistics < 1
, stm-containers < 2
, stm < 3
, tar < 1
, template-haskell < 3
, text-zipper < 1
, time < 2
, time-units < 2
, tokenize < 1
, trace-embrace >= 1.3 && < 2
, vector < 1
, wai < 4
, wai-extra < 4
, warp < 4
, warp-tls < 4
, wl-pprint-text < 2
test-suite test
import: base
type: exitcode-stdio-1.0
main-is: Driver.hs
other-modules:
PieceOfFlake.Test.Aeson
Discovery
hs-source-dirs:
test
ghc-options: -Wall -rtsopts -threaded -main-is Driver
build-depends:
, a-piece-of-flake
, aeson
, QuickCheck
, tasty
, tasty-discover
, tasty-hunit
, tasty-quickcheck
executable a-piece-of-flake
import: base
ghc-options: -threaded
main-is: PieceOfFlake.hs
hs-source-dirs: app
build-depends:
, a-piece-of-flake