Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
horizon-platform
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Théophile Choutri
horizon-platform
Commits
8284bf1e
Commit
8284bf1e
authored
1 year ago
by
Daniel Firth
Browse files
Options
Downloads
Patches
Plain Diff
develop flake
parent
b11f05e9
Branches
Branches containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+29
-17
29 additions, 17 deletions
README.md
develop/flake.lock
+1352
-0
1352 additions, 0 deletions
develop/flake.lock
develop/flake.nix
+96
-0
96 additions, 0 deletions
develop/flake.nix
with
1477 additions
and
17 deletions
README.md
+
29
−
17
View file @
8284bf1e
...
...
@@ -27,34 +27,46 @@ This package set has the following policy.
*
wai-app-static
*
warp
## Updating the
p
ackage
s
et
## Updating the
P
ackage
S
et
The package set is generated from the
`horizon.dhall`
. You can edit this in one
of two ways: manually using a text edit, or programatically using
`horizon-shell`
.
Generating the nix expressions for the package set is a two step process.
### Manual
1.
Edit the
`horizon.dhall`
file.
2.
Generate the nix expressions with
`nix run develop/#horizon-gen-nix`
.
Edit the
`horizon.dhall`
file and add or change some package data.
You can edit the
`horizon.dhall`
file in one of two ways: manually using a text
editor, or programatically using
`horizon-shell`
.
Run
`horizon-gen-nix`
from the remote repository.
```
nix run 'git+https://gitlab.horizon-haskell.net/haskell/horizon-gen-nix?ref=refs/tags/0.10.0'
```
### Programatic
### Using horizon-shell.
To use
`horizon-shell`
.
```
nix develop
nix
run
develop
/#horizon-shell
```
See the in-shell help for usage.
This is a haskell interpreter with a few shortcut functions available. Running
`tryToUpgradeEverything`
will poll hackage for any potential updates and add
them to the dhall file. This will only modify the dhall, not the nix
expressions. You must remember to run
`nix run develop/#horizon-gen-nix`
afterwards.
To quickly add a new package to the dhall, use the
`addHackage`
function. For example
`addHackage "optics"`
.
##
#
Tweaking
## Tweaking
& Hacking
If you need to do additional manual overrides to the nix code, such as
`addPkgconfigDepends`
, edit the
`configuration/common.nix`
overlay, which is
applied last.
applied over the generated derivations.
If you need to nullify libraries, use the
`configuration/hacking.nix`
overlay.
Try to leave a note as to why this library has been nullified.
## Feedback
To build all packages, run
```
nix run develop/#feedback -- build
```
This diff is collapsed.
Click to expand it.
develop/flake.lock
0 → 100644
+
1352
−
0
View file @
8284bf1e
This diff is collapsed.
Click to expand it.
develop/flake.nix
0 → 100644
+
96
−
0
View file @
8284bf1e
{
nixConfig
=
{
extra-substituters
=
"https://horizon.cachix.org"
;
extra-trusted-public-keys
=
"horizon.cachix.org-1:MeEEDRhRZTgv/FFGCv3479/dmJDfJ82G6kfUDxMSAw0="
;
};
inputs
=
{
feedback
.
url
=
"github:NorfairKing/feedback"
;
flake-parts
.
url
=
"github:hercules-ci/flake-parts"
;
flake-to-gitlab-ci
.
url
=
"git+https://gitlab.nixica.dev/haskell/flake-to-gitlab-ci?ref=refs/tags/0.2.4.2"
;
horizon-gen-nix
.
url
=
"git+https://gitlab.horizon-haskell.net/haskell/horizon-gen-nix?ref=refs/tags/0.11.0"
;
horizon-shell
.
url
=
"git+https://gitlab.horizon-haskell.net/shells/horizon-shell?ref=refs/tags/0.0.9"
;
nixpkgs
.
url
=
"github:NixOS/nixpkgs/nixos-unstable"
;
};
outputs
=
inputs
@
{
self
,
flake-parts
,
nixpkgs
,
...
}:
flake-parts
.
lib
.
mkFlake
{
inherit
inputs
;
}
{
systems
=
[
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
perSystem
=
{
system
,
pkgs
,
...
}:
let
cachix-push-horizon-ghc-only
=
pkgs
.
writers
.
writeBashBin
"cachix-push-horizon-ghc-only"
''
nix build -L --json .#packages.x86_64-linux.ghc |
${
pkgs
.
jq
}
/bin/jq -r '.[].outputs | to_entries[].value' |
${
pkgs
.
cachix
}
/bin/cachix push horizon
''
;
cachix-push-horizon-devour
=
pkgs
.
writers
.
writeBashBin
"cachix-push-horizon-devour"
''
nix build github:srid/devour-flake -L --no-link --print-out-paths --override-input flake . | xargs cat |
${
pkgs
.
cachix
}
/bin/cachix push horizon
''
;
devour-flake
=
pkgs
.
writers
.
writeBashBin
"devour-flake"
''
nix build github:srid/devour-flake -L --no-link --print-out-paths --override-input flake . --keep-going
''
;
test-template
=
pkgs
.
writers
.
writeBashBin
"test-template"
''
mkdir temp
cd temp
nix flake init -t 'git+https://gitlab.horizon-haskell.net/templates/horizon-templates#minimal'
git init .
git add *
nix build github:srid/devour-flake -L --no-link --print-out-paths --override-input flake . --override-input flake/horizon-platform ../ --keep-going
cd ..
rm temp -rf
''
;
run-horizon-gen-nix
=
pkgs
.
writers
.
writeBashBin
"run-horizon-gen-nix"
''
${
pkgs
.
cabal-install
}
/bin/cabal update
${
inputs
.
horizon-gen-nix
.
packages
.
${
system
}
.
default
}
/bin/horizon-gen-nix $@;
''
;
in
{
apps
=
{
cachix-push-horizon-devour
=
{
type
=
"app"
;
program
=
"
${
cachix-push-horizon-devour
}
/bin/cachix-push-horizon-devour"
;
};
cachix-push-horizon-ghc-only
=
{
type
=
"app"
;
program
=
"
${
cachix-push-horizon-ghc-only
}
/bin/cachix-push-horizon-ghc-only"
;
};
devour-flake
=
{
type
=
"app"
;
program
=
"
${
devour-flake
}
/bin/devour-flake"
;
};
feedback
=
{
type
=
"app"
;
program
=
"
${
inputs
.
feedback
.
packages
.
${
system
}
.
default
}
/bin/feedback"
;
};
flake-to-gitlab-ci
=
inputs
.
flake-to-gitlab-ci
.
apps
.
${
system
}
.
default
;
horizon-gen-nix
=
inputs
.
horizon-gen-nix
.
apps
.
${
system
}
.
default
;
horizon-shell
=
inputs
.
horizon-shell
.
apps
.
${
system
}
.
default
;
run-horizon-gen-nix
=
{
program
=
"
${
run-horizon-gen-nix
}
/bin/run-horizon-gen-nix"
;
type
=
"app"
;
};
test-template
=
{
type
=
"app"
;
program
=
"
${
test-template
}
/bin/test-template"
;
};
};
};
};
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment