Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{ compiler ? null
, pkgs ? import <nixpkgs> {}
}:

let
haskellPackages =
if builtins.isNull compiler
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
overriddenPackages = haskellPackages.override {
overrides = self: super: {
taskwarrior =
self.callPackage ./taskwarrior.nix {};
};
};
in
overriddenPackages.callCabal2nix "hasknote" ./. {}
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
79 changes: 79 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
description = "A very basic flake";

inputs = {
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs = {
url = "github:NixOS/nixpkgs/release-22.11";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, flake-compat, nixpkgs, flake-utils }:

flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
haskellPackages = pkgs.haskellPackages;
overriddenPackages = haskellPackages.override {
overrides = self: super: {
hasknote = self.callCabal2nix "hasknote" ./. { };
};
};
in {
packages.default = overriddenPackages.hasknote;
devShells.default = overriddenPackages.shellFor {
packages = p: [ p.hasknote ];
buildInputs = with pkgs.haskellPackages; [
cabal-install
haskell-language-server
hls-splice-plugin
hls-eval-plugin
];
};
});
}
1 change: 1 addition & 0 deletions hasknote.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ executable hasknote
build-depends: aeson
, base
, config-ini
, containers
, data-default
, directory
, filepath
Expand Down
23 changes: 10 additions & 13 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
let
pkgs = (import ./pinned-packages.nix).pkgs1909;
drv = import ./. { inherit pkgs; };
in
pkgs.haskellPackages.shellFor {
packages = p: [drv];
buildInputs = with pkgs.haskellPackages; [
cabal-install
ghcid
stylish-haskell
hlint
];
}
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).shellNix
5 changes: 3 additions & 2 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import qualified Data.Ini.Config as Ini
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import qualified Data.Set as Set
import Data.Time (UTCTime, getCurrentTime)
import qualified Data.UUID as UUID

Expand Down Expand Up @@ -254,7 +255,7 @@ removeAnnotation :: Text -> Task -> Task
removeAnnotation prefix task =
task {
Task.annotations =
filter
Set.filter
((/=prefix) . T.take (T.length prefix) . Annot.description)
(Task.annotations task)
}
Expand All @@ -263,7 +264,7 @@ addAnnotation :: Text -> UTCTime -> Task -> Task
addAnnotation description entryTime task =
task {
Task.annotations =
Annot.Annotation entryTime description : Task.annotations task
Set.insert (Annot.Annotation entryTime description) (Task.annotations task)
}

expandPath :: FilePath -> IO FilePath
Expand Down
21 changes: 0 additions & 21 deletions taskwarrior.nix

This file was deleted.