1
0
Fork 0

Use haskellPackages from master

This commit is contained in:
Malte Brandy 2020-06-02 04:54:02 +02:00
parent af446a46a2
commit 123b6c56de
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
10 changed files with 30 additions and 49 deletions

View file

@ -2,11 +2,6 @@
let
battery-watch = pkgs.writeHaskellScript {
name = "battery-watch";
libraries = [
pkgs.haskellPackages.fdo-notify
pkgs.haskellPackages.megaparsec
pkgs.haskellPackages.replace-megaparsec
];
bins = [ pkgs.acpi ];
imports = [
"DBus.Notify"

View file

@ -27,7 +27,6 @@ let
sortMail = pkgs.writeHaskellScript {
name = "sort-mail-archive";
bins = [ pkgs.notmuch pkgs.coreutils pkgs.mblaze pkgs.findutils ];
libraries = [ pkgs.haskellPackages.megaparsec ];
imports = [
"Text.Megaparsec"
"Text.Megaparsec.Char"

View file

@ -29,11 +29,6 @@
Null -> "null"
'';
inherit (pkgs) writeHaskellScript;
libraries = [
pkgs.haskellPackages.fdo-notify
pkgs.haskellPackages.aeson
pkgs.haskellPackages.these
];
imports = [
"DBus.Notify"
"DBus.Client (clientErrorMessage)"
@ -47,8 +42,8 @@
"qualified Data.List as List"
];
on-modify = writeHaskellScript {
inherit imports libraries;
name = "on-modify";
inherit imports;
} ''
${functions}
main = do
@ -73,8 +68,8 @@
BS.hPut stdout input2
'';
on-add = writeHaskellScript {
inherit imports libraries;
name = "on-add";
inherit imports;
} ''
${functions}
main = do

View file

@ -65,10 +65,10 @@
"homepage": null,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "89fda74df52b02ea0015fbc6da75330a52079192",
"sha256": "0pivssg411nzb3f82mgvlmb8wggkpxzj9f743brg61syi0vl596q",
"rev": "cfa5a0c0e09e62780c627fddcfb9b23ee1a893fe",
"sha256": "0lnbwk5n347c87hfgdn13c190rxy86g4f28gf9iz5g4avccnnly3",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/89fda74df52b02ea0015fbc6da75330a52079192.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/cfa5a0c0e09e62780c627fddcfb9b23ee1a893fe.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"obelisk": {

View file

@ -1,19 +1,12 @@
self: super:
let
preview = version: func:
if super.lib.versionOlder super.lib.version version then
func (import self.sources.unstable { })
else
{ };
in preview "20.09pre-git" (unstable: {
unstable = import self.sources.unstable { };
master = import super.sources.nixpkgs-master { };
in {
gnome3 = super.gnome3 // {
inherit (unstable.gnome3) gnome-keyring seahorse gdm;
};
haskellPackages = super.haskellPackages // {
inherit (unstable.haskellPackages) ormolu releaser;
};
inherit (unstable)
neovim vimPlugins syncthing nerdfonts cabal-install; # riot-desktop;
}) // {
inherit (import super.sources.nixpkgs-master { }) go-neb;
neovim vimPlugins syncthing nerdfonts; # riot-desktop;
inherit (master) go-neb;
}

12
overlays/30-ghc.nix Normal file
View file

@ -0,0 +1,12 @@
self: super:
let master = import super.sources.nixpkgs-master { };
in {
myHaskellPackages = {
inherit (master.haskellPackages)
brittany ormolu releaser cabal-fmt stack ghcide cabal-install dhall aeson
containers unordered-containers shh string-interpolate relude
replace-megaparsec async say cmdargs text megaparsec fdo-notify these
neuron taskwarrior pandoc;
};
ghc = master.ghc.withPackages (_: builtins.attrValues self.myHaskellPackages);
}

View file

@ -33,10 +33,9 @@ self: super: {
};
home-pkgs = {
inherit (self.pythonPackages) yapf jsbeautifier;
inherit (self.haskellPackages) brittany ormolu releaser; # cabal-fmt;
inherit (self)
go gdb mpc_cli ncmpcpp shfmt htmlTidy astyle nodejs tasksh magic-wormhole
nixfmt stack ghcid rnix-lsp tmate rustup kitty ghc cabal-install nix-top;
nixfmt rnix-lsp tmate rustup kitty nix-top ghc;
obelisk = (import self.sources.obelisk { }).command;
};
accounting-pkgs = {

View file

@ -1,7 +0,0 @@
self: super:
let inherit (self.haskell.lib) unmarkBroken dontCheck doJailbreak;
in {
haskellPackages = super.haskellPackages // {
shh = doJailbreak (unmarkBroken (dontCheck super.haskellPackages.shh));
};
}

View file

@ -1,18 +1,12 @@
self: super: {
haskellList = list: ''["${builtins.concatStringsSep ''", "'' list}"]'';
writeHaskellScript =
{ name ? "haskell-script", bins ? [ ], libraries ? [ ], imports ? [ ] }:
{ name ? "haskell-script", bins ? [ ], imports ? [ ] }:
code:
self.writers.makeBinWriter {
compileScript = ''
cp $contentPath ${name}.hs
${
self.ghc.withPackages (_:
libraries ++ (builtins.attrValues {
inherit (self.haskellPackages)
shh string-interpolate relude async say cmdargs text;
}))
}/bin/ghc ${name}.hs -threaded -Wall -Wno-unused-top-binds -Wno-missing-signatures -Wno-type-defaults -Wno-unused-imports -Werror
${self.ghc}/bin/ghc ${name}.hs -threaded -Wall -Wno-unused-top-binds -Wno-missing-signatures -Wno-type-defaults -Wno-unused-imports -Werror
mv ${name} $out
${self.binutils-unwrapped}/bin/strip --strip-unneeded "$out"
'';

View file

@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
let
watchNixpkgsPackage = name: path: {
job_name = path;
@ -20,8 +20,9 @@ let
watchHaskellStable = name:
watchNixpkgsPackage name
"nixos/release-20.03/nixpkgs.haskellPackages.${name}.x86_64-linux";
watchedUnstablePkgs = [ "cabal-fmt" "neuron" ];
watchedPkgs = [
watchedHaskellUpdatesPkgs =
builtins.attrNames (pkgs.myHaskellPackages);
watchedStablePkgs = [
"ghcide"
"brittany"
"releaser"
@ -34,6 +35,6 @@ let
];
in {
services.prometheus.scrapeConfigs =
map watchHaskellUnstable (watchedUnstablePkgs ++ watchedPkgs)
map watchHaskellUnstable watchedHaskellUpadatesPkgs
++ map watchHaskellStable watchedPkgs;
}