Compare commits
3 Commits
82d99a485c
...
bb99c5585b
Author | SHA1 | Date |
---|---|---|
Dmitriy Pleshevskiy | bb99c5585b | |
Dmitriy Pleshevskiy | db26eb7213 | |
Dmitriy Pleshevskiy | 03c25ed475 |
|
@ -58,6 +58,7 @@ x -> y -> z
|
||||||
- sketch
|
- sketch
|
||||||
- force-appendix
|
- force-appendix
|
||||||
- center
|
- center
|
||||||
|
- animated-interval
|
||||||
|
|
||||||
# Limitation
|
# Limitation
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
|
||||||
|
src = builtins.fetchGit ./.;
|
||||||
|
}).defaultNix
|
57
flake.lock
57
flake.lock
|
@ -15,73 +15,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1678901627,
|
|
||||||
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1679281263,
|
"lastModified": 1680487167,
|
||||||
"narHash": "sha256-neMref1GTruSLt1jBgAw+lvGsZj8arQYfdxvSi5yp4Q=",
|
"narHash": "sha256-9FNIqrxDZgSliGGN2XJJSvcDYmQbgOANaZA4UWnTdg4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8276a165b9fa3db1a7a4f29ee29b680e0799b9dc",
|
"rev": "53dad94e874c9586e71decf82d972dfb640ef044",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1678875422,
|
|
||||||
"narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=",
|
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"id": "nixpkgs",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs"
|
||||||
"tools": "tools"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tools": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": "nixpkgs_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1679320952,
|
|
||||||
"narHash": "sha256-L7x8BwHWGFILwvXTluKJkfkSYZQxPbSXrzDc/HC80Oc=",
|
|
||||||
"ref": "refs/heads/main",
|
|
||||||
"rev": "88e2a5beb95722b454f081e5b766eef8f908eeb3",
|
|
||||||
"revCount": 30,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.pleshevski.ru/mynix/tools"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.pleshevski.ru/mynix/tools"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
19
flake.nix
19
flake.nix
|
@ -1,20 +1,11 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
tools.url = "git+https://git.pleshevski.ru/mynix/tools";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, tools, ... }:
|
outputs = { nixpkgs, flake-utils, ... }:
|
||||||
let
|
let mkWd2 = import ./wd2.nix; in
|
||||||
inherit (builtins) readFile;
|
|
||||||
|
|
||||||
mkWd2 = { writeShellApplication, symlinkJoin, d2, ... }:
|
|
||||||
writeShellApplication {
|
|
||||||
name = "wd2";
|
|
||||||
runtimeInputs = [ d2 ];
|
|
||||||
text = (readFile ./wd2);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
overlays = {
|
overlays = {
|
||||||
default = final: prev: {
|
default = final: prev: {
|
||||||
|
@ -27,9 +18,7 @@
|
||||||
inherit (builtins) mapAttrs;
|
inherit (builtins) mapAttrs;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
wd2 = pkgs.callPackage mkWd2 {
|
wd2 = pkgs.callPackage mkWd2 { };
|
||||||
d2 = tools.packages.${system}.d2;
|
|
||||||
};
|
|
||||||
|
|
||||||
mkApp = drv: flake-utils.lib.mkApp { inherit drv; };
|
mkApp = drv: flake-utils.lib.mkApp { inherit drv; };
|
||||||
packages = {
|
packages = {
|
||||||
|
|
5
wd2
5
wd2
|
@ -24,6 +24,7 @@ cli and overwrite cli parameters with the same name.
|
||||||
- sketch
|
- sketch
|
||||||
- force-appendix
|
- force-appendix
|
||||||
- center
|
- center
|
||||||
|
- animated-interval
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -82,6 +83,7 @@ d2_sketch=$(get_attr_value "sketch")
|
||||||
d2_port=$(get_attr_value "port")
|
d2_port=$(get_attr_value "port")
|
||||||
d2_force_appendix=$(get_attr_value "force-appendix")
|
d2_force_appendix=$(get_attr_value "force-appendix")
|
||||||
d2_center=$(get_attr_value "center")
|
d2_center=$(get_attr_value "center")
|
||||||
|
d2_animated_interval=$(get_attr_value "animated-interval")
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
d2 "${d2_args[@]}" \
|
d2 "${d2_args[@]}" \
|
||||||
|
@ -92,5 +94,6 @@ d2 "${d2_args[@]}" \
|
||||||
${d2_sketch:+--sketch=${d2_sketch}} \
|
${d2_sketch:+--sketch=${d2_sketch}} \
|
||||||
${d2_port:+--port=${d2_port}} \
|
${d2_port:+--port=${d2_port}} \
|
||||||
${d2_force_appendix:+--force-appendix=${d2_force_appendix}}
|
${d2_force_appendix:+--force-appendix=${d2_force_appendix}}
|
||||||
${d2_center:+--center=${d2_center}}
|
${d2_center:+--center=${d2_center}} \
|
||||||
|
${d2_animated_interval:+--animated-interval=${d2_animated_interval}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue