From 123b6c56de06a3139224da6314d5963183d9e9e1 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Tue, 2 Jun 2020 04:54:02 +0200 Subject: [PATCH] Use haskellPackages from master --- home/battery.nix | 5 ----- home/mail.nix | 1 - home/taskwarrior.nix | 9 ++------- nix/sources.json | 6 +++--- overlays/10-previews.nix | 17 +++++------------ overlays/30-ghc.nix | 12 ++++++++++++ overlays/pkgSets.nix | 3 +-- overlays/shh.nix | 7 ------- overlays/writeHaskellScript.nix | 10 ++-------- system/monitoring/nixpkgs.nix | 9 +++++---- 10 files changed, 30 insertions(+), 49 deletions(-) create mode 100644 overlays/30-ghc.nix delete mode 100644 overlays/shh.nix diff --git a/home/battery.nix b/home/battery.nix index fbeef866..5498b617 100644 --- a/home/battery.nix +++ b/home/battery.nix @@ -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" diff --git a/home/mail.nix b/home/mail.nix index ab719fa0..1c28fb0d 100644 --- a/home/mail.nix +++ b/home/mail.nix @@ -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" diff --git a/home/taskwarrior.nix b/home/taskwarrior.nix index 169c95d3..b9a23bd6 100644 --- a/home/taskwarrior.nix +++ b/home/taskwarrior.nix @@ -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 diff --git a/nix/sources.json b/nix/sources.json index 6c934697..f7ef384b 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -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///archive/.tar.gz" }, "obelisk": { diff --git a/overlays/10-previews.nix b/overlays/10-previews.nix index 2d50007e..fb846140 100644 --- a/overlays/10-previews.nix +++ b/overlays/10-previews.nix @@ -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; } diff --git a/overlays/30-ghc.nix b/overlays/30-ghc.nix new file mode 100644 index 00000000..42ec84d5 --- /dev/null +++ b/overlays/30-ghc.nix @@ -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); +} diff --git a/overlays/pkgSets.nix b/overlays/pkgSets.nix index cff77eef..25f2a174 100644 --- a/overlays/pkgSets.nix +++ b/overlays/pkgSets.nix @@ -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 = { diff --git a/overlays/shh.nix b/overlays/shh.nix deleted file mode 100644 index 02839eb3..00000000 --- a/overlays/shh.nix +++ /dev/null @@ -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)); - }; -} diff --git a/overlays/writeHaskellScript.nix b/overlays/writeHaskellScript.nix index 35490760..8e985a5d 100644 --- a/overlays/writeHaskellScript.nix +++ b/overlays/writeHaskellScript.nix @@ -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" ''; diff --git a/system/monitoring/nixpkgs.nix b/system/monitoring/nixpkgs.nix index 1ad50427..239aa061 100644 --- a/system/monitoring/nixpkgs.nix +++ b/system/monitoring/nixpkgs.nix @@ -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; }