migrate taskwarrior parts to taskwarrior-flake

This commit is contained in:
Ingolf Wagner 2024-09-27 14:43:07 +09:00
parent 226687604b
commit 9ec11a8a24
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
4 changed files with 92 additions and 109 deletions

View file

@ -291,6 +291,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_5": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_3"
},
"locked": {
"lastModified": 1726153070,
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1644229661, "lastModified": 1644229661,
@ -761,6 +779,18 @@
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
} }
}, },
"nixpkgs-lib_3": {
"locked": {
"lastModified": 1725233747,
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1710695816, "lastModified": 1710695816,
@ -998,8 +1028,8 @@
"retiolum": "retiolum", "retiolum": "retiolum",
"srvos": "srvos", "srvos": "srvos",
"stylix": "stylix", "stylix": "stylix",
"taskshell": "taskshell", "taskwarrior": "taskwarrior",
"treefmt-nix": "treefmt-nix_4" "treefmt-nix": "treefmt-nix_5"
} }
}, },
"sops-nix": { "sops-nix": {
@ -1157,6 +1187,7 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_6",
"nixpkgs": [ "nixpkgs": [
"taskwarrior",
"nixpkgs" "nixpkgs"
] ]
}, },
@ -1174,6 +1205,29 @@
"type": "github" "type": "github"
} }
}, },
"taskwarrior": {
"inputs": {
"flake-parts": "flake-parts_5",
"nixpkgs": [
"nixpkgs"
],
"taskshell": "taskshell",
"treefmt-nix": "treefmt-nix_4"
},
"locked": {
"lastModified": 1727415270,
"narHash": "sha256-VrzBytDYF6rextg0qjxtnGEyw88fa1LrWuXfG4k6zE0=",
"owner": "mrvandalo",
"repo": "taskwarrior-flake",
"rev": "6d95efd92e3ae93e4e395f115116e2435fe79e80",
"type": "github"
},
"original": {
"owner": "mrvandalo",
"repo": "taskwarrior-flake",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1286,6 +1340,27 @@
} }
}, },
"treefmt-nix_4": { "treefmt-nix_4": {
"inputs": {
"nixpkgs": [
"taskwarrior",
"nixpkgs"
]
},
"locked": {
"lastModified": 1727252110,
"narHash": "sha256-3O7RWiXpvqBcCl84Mvqa8dXudZ1Bol1ubNdSmQt7nF4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "1bff2ba6ec22bc90e9ad3f7e94cca0d37870afa3",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_5": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"

View file

@ -17,9 +17,9 @@
kmonad.inputs.nixpkgs.follows = "nixpkgs"; # fixme: kmonad crashes every now and than and the keyboard is not usable anymore. kmonad.inputs.nixpkgs.follows = "nixpkgs"; # fixme: kmonad crashes every now and than and the keyboard is not usable anymore.
kmonad.url = "github:kmonad/kmonad?dir=nix"; # todo: mabye use https://github.com/jtroo/kanata instead kmonad.url = "github:kmonad/kmonad?dir=nix"; # todo: mabye use https://github.com/jtroo/kanata instead
landingpage.url = "github:mrVanDalo/landingpage"; landingpage.url = "github:mrVanDalo/landingpage";
nixos-anywhere.url = "github:nix-community/nixos-anywhere";
nix-topology.inputs.nixpkgs.follows = "nixpkgs"; nix-topology.inputs.nixpkgs.follows = "nixpkgs";
nix-topology.url = "github:oddlama/nix-topology"; nix-topology.url = "github:oddlama/nix-topology";
nixos-anywhere.url = "github:nix-community/nixos-anywhere";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
nixpkgs-legacy_2211.url = "github:nixos/nixpkgs/nixos-22.11"; nixpkgs-legacy_2211.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-legacy_2311.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs-legacy_2311.url = "github:nixos/nixpkgs/nixos-23.11";
@ -37,8 +37,9 @@
stylix.inputs.home-manager.follows = "home-manager"; stylix.inputs.home-manager.follows = "home-manager";
stylix.inputs.nixpkgs.follows = "nixpkgs"; stylix.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
taskshell.inputs.nixpkgs.follows = "nixpkgs"; taskwarrior.inputs.nixpkgs.follows = "nixpkgs";
taskshell.url = "github:mrvandalo/taskshell"; taskwarrior.url = "github:mrvandalo/taskwarrior-flake";
#taskwarrior.url = "git+file:///home/palo/dev/nixos/taskwarrior-flake";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
@ -52,7 +53,6 @@
outputs = outputs =
inputs@{ inputs@{
self,
clan-core, clan-core,
clan-fact-generators, clan-fact-generators,
flake-parts, flake-parts,
@ -60,6 +60,7 @@
home-manager-utils, home-manager-utils,
kmonad, kmonad,
landingpage, landingpage,
nix-topology,
nixos-anywhere, nixos-anywhere,
nixos-hardware, nixos-hardware,
nixpkgs, nixpkgs,
@ -71,11 +72,11 @@
polygon-art, polygon-art,
private-parts, private-parts,
retiolum, retiolum,
self,
srvos, srvos,
stylix, stylix,
taskshell, taskwarrior,
treefmt-nix, treefmt-nix,
nix-topology,
}: }:
let let
@ -129,12 +130,14 @@
polygon-art = polygon-art.packages.${system}; polygon-art = polygon-art.packages.${system};
landingpage = landingpage.packages.${system}.plain; landingpage = landingpage.packages.${system}.plain;
kmonad = kmonad.packages.${system}.kmonad; kmonad = kmonad.packages.${system}.kmonad;
tasksh = taskshell.packages.${system}.tasksh; inherit (taskwarrior.packages.${system})
bugwarrior
tasksh
taskwarrior-hooks
;
inherit (self.packages.${system}) inherit (self.packages.${system})
otpmenu otpmenu
taskwarrior-hooks
nsxiv nsxiv
bugwarrior
; ;
}) })
]; ];
@ -359,6 +362,7 @@
home-manager.backupFileExtension = "backup"; home-manager.backupFileExtension = "backup";
home-manager.sharedModules = [ home-manager.sharedModules = [
home-manager-utils.hmModule home-manager-utils.hmModule
taskwarrior.hmModules.bugwarrior
]; ];
}; };

View file

@ -7,96 +7,18 @@
with lib; with lib;
with types; with types;
let let
mkMagicMergeOption =
{
description ? "",
example ? { },
default ? { },
apply ? id,
...
}:
mkOption {
inherit
example
description
default
apply
;
type =
with lib.types;
let
valueType =
nullOr (oneOf [
bool
int
float
str
(attrsOf valueType)
(listOf valueType)
])
// {
description = "bool, int, float or str";
emptyValue.value = { };
};
in
valueType;
};
#taskwarrior-tui = pkgs.legacy_2311.taskwarrior-tui; #taskwarrior-tui = pkgs.legacy_2311.taskwarrior-tui;
taskwarrior-tui = pkgs.taskwarrior-tui; taskwarrior-tui = pkgs.taskwarrior-tui;
taskwarrior = pkgs.taskwarrior3; taskwarrior = pkgs.taskwarrior3;
in in
{ {
# bugwarrior (a bit fiddly)
imports = [
{
options.bugwarrior.config = mkMagicMergeOption {
type = attrs;
default = { };
};
config = mkIf config.gui.enable { config = mkIf config.gui.enable {
home.file.".config/bugwarrior/bugwarrior.toml".source =
(pkgs.formats.toml { }).generate "bugwarriorrc.toml"
(
{
general.taskrc = pkgs.writeText "taskrc" "data.location=$HOME/.bugwarrior";
}
// config.bugwarrior.config
);
home.packages = [
pkgs.bugwarrior
#export TASKRC=$HOME/.bugwarrior/${pkgs.writeText "bugwarrior.taskrc" "data.location=$HOME/.bugwarrior"}
(pkgs.writers.writeBashBin "bugwarrior-sync" ''
set -eo pipefail
mkdir -p $HOME/.bugwarrior bugwarrior.enable = true;
touch $HOME/.bugwarrior/taskrc
export TASKRC=$HOME/.bugwarrior/taskrc
export TASKDATA=$HOME/.bugwarrior
echo "bugwarrior pull" | ${pkgs.boxes}/bin/boxes -d ansi
${pkgs.bugwarrior}/bin/bugwarrior pull "$@"
echo "task export" | ${pkgs.boxes}/bin/boxes -d ansi
${pkgs.taskwarrior}/bin/task export > $HOME/.bugwarrior/bugwarrior.json
unset TASKRC
unset TASKDATA
echo "task import" | ${pkgs.boxes}/bin/boxes -d ansi
${taskwarrior}/bin/task import rc.hooks=0 $HOME/.bugwarrior/bugwarrior.json
'')
];
};
}
];
config = mkIf config.gui.enable {
home.packages = [ home.packages = [

View file

@ -12,28 +12,10 @@
packages.otpmenu = callPackage ./otpmenu { }; packages.otpmenu = callPackage ./otpmenu { };
#packages.sononym = callPackage ./sononym { }; #packages.sononym = callPackage ./sononym { };
#packages.sononym-crawler = callPackage ./sononym-crawler { }; #packages.sononym-crawler = callPackage ./sononym-crawler { };
packages.taskwarrior-hooks = callPackage ./taskwarrior-hooks { };
# overrides # overrides
# --------- # ---------
packages.nsxiv = (pkgs.nsxiv.override { conf = builtins.readFile ./nsxiv/config.def.h; }); packages.nsxiv = (pkgs.nsxiv.override { conf = builtins.readFile ./nsxiv/config.def.h; });
packages.bugwarrior = python311Packages.bugwarrior.overrideAttrs (old: {
version = "2024-08-27-r1";
src = pkgs.fetchFromGitHub {
owner = "ralphbean";
repo = "bugwarrior";
rev = "25e99834ef79e0a8c7141943810e0aa5152d6710";
sha256 = "sha256-JPmFP6i/7Ji5LyrKT9WCngWqMyrM00rEXV8QVLwxx1A=";
};
propagatedBuildInputs = old.propagatedBuildInputs ++ [
python311Packages.pydantic_1
python311Packages.tomli
python311Packages.email-validator
python311Packages.packaging
python311Packages.pbr
];
});
}; };
} }