diff --git a/.envrc b/.envrc index 77813bd..2e787dc 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,6 @@ #! /bin/sh -source "$(fetchurl "https://raw.githubusercontent.com/paisano-nix/direnv/main/lib" "sha256-XKqDMz+VtF8VSJ4yOok4mO1xxXUZbD1t2yC0JmEXrCI=")" +# shellcheck disable=SC1090 +. "$(fetchurl "https://raw.githubusercontent.com/paisano-nix/direnv/main/lib" "sha256-IgQhKK7UHL1AfCUntJO2KCaIDJQotRnK2qC4Daxk+wI=")" use envreload //repo/shells/default //repo/config diff --git a/.github/settings.yml b/.github/settings.yml index 2823390..93febe6 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,7 +1,62 @@ +labels: +- color: '#000000' + description: This issue has been abdandoned + name: ':running: Status: Abdandoned' +- color: '#4CAF50' + description: This issue has been accepted + name: ':ok: Status: Accepted' +- color: '#F44336' + description: This issue is in a blocking state + name: ':x: Status: Blocked' +- color: '#A6A6A6' + description: This issue is actively being worked on + name: ':construction: Status: In Progress' +- color: '#F44336' + description: This issue is not currently being worked on + name: ':golf: Status: On Hold' +- color: '#FDD835' + description: This issue is pending a review + name: ':eyes: Status: Review Needed' +- color: '#F44336' + description: This issue targets a bug + name: ':bug: Type: Bug' +- color: '#FB8C00' + description: This issue targets general maintenance + name: ':wrench: Type: Maintenance' +- color: '#AB47BC' + description: This issue contains a question + name: ':grey_question: Type: Question' +- color: '#F44336' + description: This issue targets a security vulnerability + name: ':cop: Type: Security' +- color: '#64B5F6' + description: This issue targets a new feature through a story + name: ':scroll: Type: Story' +- color: '#F44336' + description: This issue is prioritized as critical + name: ':boom: Priority: Critical' +- color: '#FB8C00' + description: This issue is prioritized as high + name: ':fire: Priority: High' +- color: '#4CAF50' + description: This issue is prioritized as low + name: ':low_brightness: Priority: Low' +- color: '#FFEE58' + description: This issue is prioritized as medium + name: ':star2: Priority: Medium' +- color: '#4CAF50' + description: This issue is of low complexity or very well understood + name: ':muscle: Effort: 1' +- color: '#FFEE58' + description: This issue is of medium complexity or only partly well understood + name: ':muscle: Effort: 3' +- color: '#F44336' + description: This issue is of high complexity or just not yet well understood + name: ':muscle: Effort: 5' repository: allow_merge_commit: false allow_rebase_merge: true - allow_squash_merge: false + allow_squash_merge: true default_branch: main delete_branch_on_merge: true description: Paisano's TUI/CLI companion diff --git a/.gitignore b/.gitignore index 60d8aff..1f55e13 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ result # nixago: ignore-linked-files +/cog.toml +/lefthook.yml +/.conform.yaml +/treefmt.toml adrgen.config.yml lefthook.yml .editorconfig @@ -9,4 +13,4 @@ lefthook.yml treefmt.toml # nixago-auto-created: mdbook-build-folder -docs/build +docs/build \ No newline at end of file diff --git a/book.toml b/book.toml index d1b4fa1..7934594 100644 --- a/book.toml +++ b/book.toml @@ -5,7 +5,7 @@ src = "docs" title = "Paisano TUI Book" [build] -build-dir = "docs/build" +build-dir = "docs/book" [output] [output.html] @@ -14,8 +14,7 @@ additional-css = ["./mdbook-paisano-preprocessor.css"] [output.linkcheck] [preprocessor.paisano-preprocessor] -assets_version = "0" -command = "mdbook-paisano-preprocessor" +before = ["links"] registry = ".#__std.init" [[preprocessor.paisano-preprocessor.multi]] diff --git a/cog.toml b/cog.toml deleted file mode 100644 index ec4597d..0000000 --- a/cog.toml +++ /dev/null @@ -1,14 +0,0 @@ -post_bump_hooks = [ - "git push", - "git push origin {{version}}", - "echo Go to and post: https://discourse.nixos.org/t/paisano-tui-cli/27351", - "cog -q changelog --at {{version}}", -] - -[changelog] -path = "CHANGELOG.md" -template = "remote" -remote = "github.com" -repository = "tui" -owner = "paisano-nix" -authors = [{ username = "blaggacao", signature = "David Arnold" }] diff --git a/flake.lock b/flake.lock index 9025192..b9d83da 100644 --- a/flake.lock +++ b/flake.lock @@ -15,23 +15,34 @@ "type": "github" } }, + "call-flake": { + "locked": { + "lastModified": 1687380775, + "narHash": "sha256-bmhE1TmrJG4ba93l9WQTLuYM53kwGQAjYHRvHOeuxWU=", + "owner": "divnix", + "repo": "call-flake", + "rev": "74061f6c241227cd05e79b702db9a300a2e4131a", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "call-flake", + "type": "github" + } + }, "devshell": { "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], "nixpkgs": [ - "std", "nixpkgs" - ] + ], + "systems": "systems" }, "locked": { - "lastModified": 1663445644, - "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", + "lastModified": 1694435990, + "narHash": "sha256-yLQPD2eZGepu3yvdwABXrR3GhAqWRWTj9rn3a4knYuk=", "owner": "numtide", "repo": "devshell", - "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", + "rev": "f6aec2e8b1cdddcab10ce7fc2eac66886e3deaad", "type": "github" }, "original": { @@ -42,9 +53,13 @@ }, "dmerge": { "inputs": { + "haumea": [ + "std", + "haumea" + ], "nixlib": [ "std", - "nixpkgs" + "lib" ], "yants": [ "std", @@ -52,26 +67,27 @@ ] }, "locked": { - "lastModified": 1659548052, - "narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=", + "lastModified": 1686862774, + "narHash": "sha256-ojGtRQ9pIOUrxsQEuEPerUkqIJEuod9hIflfNkY+9CE=", "owner": "divnix", - "repo": "data-merge", - "rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497", + "repo": "dmerge", + "rev": "9f7f7a8349d33d7bd02e0f2b484b1f076e503a96", "type": "github" }, "original": { "owner": "divnix", - "repo": "data-merge", + "ref": "0.2.1", + "repo": "dmerge", "type": "github" } }, "flake-utils": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "type": "github" }, "original": { @@ -80,11 +96,33 @@ "type": "github" } }, + "haumea": { + "inputs": { + "nixpkgs": [ + "std", + "lib" + ] + }, + "locked": { + "lastModified": 1685133229, + "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", + "owner": "nix-community", + "repo": "haumea", + "rev": "34dd58385092a23018748b50f9b23de6266dffc2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v0.2.2", + "repo": "haumea", + "type": "github" + } + }, "incl": { "inputs": { "nixlib": [ "std", - "nixpkgs" + "lib" ] }, "locked": { @@ -101,52 +139,35 @@ "type": "github" } }, - "n2c": { - "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], - "nixpkgs": [ - "std", - "nixpkgs" - ] - }, + "lib": { "locked": { - "lastModified": 1677330646, - "narHash": "sha256-hUYCwJneMjnxTvj30Fjow6UMJUITqHlpUGpXMPXUJsU=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "ebca8f58d450cae1a19c07701a5a8ae40afc9efc", + "lastModified": 1694306727, + "narHash": "sha256-26fkTOJOI65NOTNKFvtcJF9mzzf/kK9swHzfYt1Dl6Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c30b6a84c0b84ec7aecbe74466033facc9ed103f", "type": "github" }, "original": { - "owner": "nlewo", - "repo": "nix2container", + "owner": "nix-community", + "repo": "nixpkgs.lib", "type": "github" } }, "nixago": { "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], - "nixago-exts": [ - "std", - "blank" - ], + "flake-utils": "flake-utils", + "nixago-exts": [], "nixpkgs": [ - "std", "nixpkgs" ] }, "locked": { - "lastModified": 1676075813, - "narHash": "sha256-X/aIT8Qc8UCqnxJvaZykx3CJ0ZnDFvO+dqp/7fglZWo=", + "lastModified": 1687381756, + "narHash": "sha256-IUMIlYfrvj7Yli4H2vvyig8HEPpfCeMaE6+kBGPzFyk=", "owner": "nix-community", "repo": "nixago", - "rev": "9cab4dde31ec2f2c05d702ea8648ce580664e906", + "rev": "dacceb10cace103b3e66552ec9719fa0d33c0dc9", "type": "github" }, "original": { @@ -157,11 +178,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1675940568, - "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", + "lastModified": 1694760568, + "narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6ccc4a59c3f1b56d039d93da52696633e641bc71", + "rev": "46688f8eb5cd6f1298d873d4d2b9cf245e09e88e", "type": "github" }, "original": { @@ -188,6 +209,7 @@ }, "paisano": { "inputs": { + "call-flake": "call-flake", "nixpkgs": [ "std", "nixpkgs" @@ -199,11 +221,11 @@ ] }, "locked": { - "lastModified": 1677437285, - "narHash": "sha256-YGfMothgUq1T9wMJYEhOSvdIiD/8gLXO1YcZA6hyIWU=", + "lastModified": 1693982790, + "narHash": "sha256-WTZYlqGUjzzz/PSzcvjEZz2kkwYSXObjeQVrFBaqa2Y=", "owner": "paisano-nix", "repo": "core", - "rev": "5f2fc05e98e001cb1cf9535ded09e05d90cec131", + "rev": "3e897a19418361ece34841105122ed4f9379ca96", "type": "github" }, "original": { @@ -213,35 +235,27 @@ } }, "paisano-tui": { - "inputs": { - "nixpkgs": [ - "std", - "blank" - ], - "std": [ - "std" - ] - }, + "flake": false, "locked": { - "lastModified": 1677366563, - "narHash": "sha256-c4a9Qd2xXO8zxMTuJQWmDrdIbmwlGjKcOyjB1xnRHjQ=", + "lastModified": 1694014205, + "narHash": "sha256-u0+T6vMznzfjDMUd01ZXQsrQPMEhMjrQwUPTFsPBR1k=", "owner": "paisano-nix", "repo": "tui", - "rev": "f45d054b1329e70e475eb185367d18fa08a6a176", + "rev": "587ab9fd07bd969d59df73bfe527b5f8a4e752d1", "type": "github" }, "original": { "owner": "paisano-nix", + "ref": "0.2.0", "repo": "tui", "type": "github" } }, "root": { "inputs": { - "nixpkgs": [ - "std", - "nixpkgs" - ], + "devshell": "devshell", + "nixago": "nixago", + "nixpkgs": "nixpkgs", "std": "std" } }, @@ -252,10 +266,13 @@ "blank" ], "blank": "blank", - "devshell": "devshell", + "devshell": [ + "devshell" + ], "dmerge": "dmerge", - "flake-utils": "flake-utils", + "haumea": "haumea", "incl": "incl", + "lib": "lib", "makes": [ "std", "blank" @@ -264,19 +281,30 @@ "std", "blank" ], - "n2c": "n2c", - "nixago": "nixago", - "nixpkgs": "nixpkgs", + "n2c": [ + "std", + "blank" + ], + "nixago": [ + "nixago" + ], + "nixpkgs": [ + "nixpkgs" + ], "paisano": "paisano", "paisano-tui": "paisano-tui", + "terranix": [ + "std", + "blank" + ], "yants": "yants" }, "locked": { - "lastModified": 1677533497, - "narHash": "sha256-+FgZDz0Gwont/bIW0/IQNLfdYpSiLui8dA91xsioea0=", + "lastModified": 1694815542, + "narHash": "sha256-VxKm6oq3GeVIhrhrCBTGIomxqesWmjsDiOeYiKmrzrY=", "owner": "divnix", "repo": "std", - "rev": "621c9b4b69d41c07c96cb0d6887ef9f8788a5617", + "rev": "0ce59ac671f041183da72e7cd5db9c6eb878e326", "type": "github" }, "original": { @@ -285,19 +313,34 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "yants": { "inputs": { "nixpkgs": [ "std", - "nixpkgs" + "lib" ] }, "locked": { - "lastModified": 1667096281, - "narHash": "sha256-wRRec6ze0gJHmGn6m57/zhz/Kdvp9HS4Nl5fkQ+uIuA=", + "lastModified": 1686863218, + "narHash": "sha256-kooxYm3/3ornWtVBNHM3Zh020gACUyFX2G0VQXnB+mk=", "owner": "divnix", "repo": "yants", - "rev": "d18f356ec25cb94dc9c275870c3a7927a10f8c3c", + "rev": "8f0da0dba57149676aa4817ec0c880fbde7a648d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5d07b94..6b085d7 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,25 @@ { description = "Paisano's TUI/CLI companion"; - inputs.std.url = "github:divnix/std"; - inputs.nixpkgs.follows = "std/nixpkgs"; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + inputs.std = { + url = "github:divnix/std"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.devshell.follows = "devshell"; + inputs.nixago.follows = "nixago"; + }; + + inputs.devshell = { + url = "github:numtide/devshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + inputs.nixago = { + url = "github:nix-community/nixago"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixago-exts.follows = ""; + }; outputs = { std, diff --git a/nix/repo/config.nix b/nix/repo/config.nix index 3cf13b5..2febb35 100644 --- a/nix/repo/config.nix +++ b/nix/repo/config.nix @@ -7,70 +7,17 @@ A: (1) dotfile proliferation (2) have all the things in one place / fromat (3) potentially share / re-use configuration data - keeping it in sync */ -{ - # Tool Homepage: https://editorconfig.org/ - editorconfig = { - data = { - root = true; - "*" = { - end_of_line = "lf"; - insert_final_newline = true; - trim_trailing_whitespace = true; - charset = "utf-8"; - indent_style = "space"; - indent_size = 2; - }; - "*.md" = { - max_line_length = "off"; - trim_trailing_whitespace = false; - }; - "{*.go,go.mod}" = { - indent_style = "tab"; - indent_size = 4; - }; - }; - }; - +let + inherit (inputs) nixpkgs; + inherit (inputs.std.inputs) dmerge; + inherit (inputs.std.data) configs; + inherit (inputs.std.lib.dev) mkNixago; +in { # Tool Homepage: https://numtide.github.io/treefmt/ - treefmt = { - packages = [ - inputs.nixpkgs.alejandra - inputs.nixpkgs.nodePackages.prettier - inputs.nixpkgs.nodePackages.prettier-plugin-toml - inputs.nixpkgs.shfmt - inputs.nixpkgs.go - ]; - devshell.startup.prettier-plugin-toml = inputs.nixpkgs.lib.stringsWithDeps.noDepEntry '' - export NODE_PATH=${inputs.nixpkgs.nodePackages.prettier-plugin-toml}/lib/node_modules:$NODE_PATH - ''; + treefmt = (mkNixago configs.treefmt) { + packages = [nixpkgs.go]; data = { formatter = { - nix = { - command = "alejandra"; - includes = ["*.nix"]; - }; - prettier = { - command = "prettier"; - options = ["--plugin" "prettier-plugin-toml" "--write"]; - includes = [ - "*.css" - "*.html" - "*.js" - "*.json" - "*.jsx" - "*.md" - "*.mdx" - "*.scss" - "*.ts" - "*.yaml" - "*.toml" - ]; - }; - shell = { - command = "shfmt"; - options = ["-i" "2" "-s" "-w"]; - includes = ["*.sh"]; - }; go = { command = "gofmt"; options = ["-w"]; @@ -80,34 +27,29 @@ A: (1) dotfile proliferation }; }; + # Tool Homepage: https://editorconfig.org/ + editorconfig = (mkNixago configs.editorconfig) {}; + conform = (mkNixago configs.conform) {}; + # Tool Homepage: https://github.com/evilmartians/lefthook - lefthook = { + lefthook = (mkNixago configs.lefthook) {}; + + cog = (mkNixago configs.cog) { data = { - commit-msg = { - commands = { - conform = { - # allow WIP, fixup!/squash! commits locally - run = '' - [[ "$(head -n 1 {1})" =~ ^WIP(:.*)?$|^wip(:.*)?$|fixup\!.*|squash\!.* ]] || - conform enforce --commit-msg-file {1}''; - skip = ["merge" "rebase"]; - }; - }; - }; - pre-commit = { - commands = { - treefmt = { - run = "treefmt --fail-on-change {staged_files}"; - skip = ["merge" "rebase"]; - }; - }; + changelog = { + remote = "github.com"; + repository = "hive"; + owner = "divnix"; }; + post_bump_hooks = dmerge.append [ + "echo Go to and post: https://discourse.nixos.org/t/paisano-tui-cli/27351" + ]; }; }; # Tool Hompeage: https://github.com/apps/settings # Install Setting App in your repo to enable it - githubsettings = { + githubsettings = (mkNixago configs.githubsettings) { data = { repository = { name = "tui"; @@ -115,7 +57,7 @@ A: (1) dotfile proliferation homepage = "https://paisano-nix.github.io/tui"; topics = "nix, nix-flakes, flake, ux, tui, cli"; default_branch = "main"; - allow_squash_merge = false; + allow_squash_merge = true; allow_merge_commit = false; allow_rebase_merge = true; delete_branch_on_merge = true; @@ -129,36 +71,19 @@ A: (1) dotfile proliferation }; # Tool Homepage: https://rust-lang.github.io/mdBook/ - mdbook = { + mdbook = (mkNixago configs.mdbook) { # add preprocessor packages here - packages = - [ - inputs.nixpkgs.mdbook-linkcheck - ] - ++ inputs.nixpkgs.lib.optionals (inputs ? mdbook-paisano-preprocessor) [ - inputs.mdbook-paisano-preprocessor.app.package.default - ]; + packages = [nixpkgs.mdbook-linkcheck]; data = { # Configuration Reference: https://rust-lang.github.io/mdBook/format/configuration/index.html - book = { - language = "en"; - multilingual = false; - title = "Paisano TUI Book"; - src = "docs"; - }; - build.build-dir = "docs/build"; - preprocessor = { - paisano-preprocessor = { - command = "mdbook-paisano-preprocessor"; - assets_version = "0"; - registry = ".#__std.init"; - multi = [ - { - chapter = "TUI Reference"; - cell = "tui"; - } - ]; - }; + book.title = "Paisano TUI Book"; + preprocessor.paisano-preprocessor = { + multi = [ + { + chapter = "TUI Reference"; + cell = "tui"; + } + ]; }; output = { html = { @@ -168,7 +93,5 @@ A: (1) dotfile proliferation linkcheck = {}; }; }; - output = "book.toml"; - hook.mode = "copy"; # let CI pick it up outside of devshell }; } diff --git a/nix/repo/shells.nix b/nix/repo/shells.nix index e0f55b8..0c6c8ca 100644 --- a/nix/repo/shells.nix +++ b/nix/repo/shells.nix @@ -3,58 +3,55 @@ This file holds reproducible shells with commands in them. They conveniently also generate config files in their startup hook. */ -{ - mdbook = inputs.std.lib.dev.mkShell {nixago = [(inputs.std.lib.cfg.mdbook cell.config.mdbook)];}; +let + inherit (inputs) nixpkgs; + inherit (inputs.std.lib.dev) mkShell; + inherit (inputs.nixpkgs.lib) mapAttrs optionals; # Tool Homepage: https://numtide.github.io/devshell/ - default = inputs.std.lib.dev.mkShell { - name = "Paisano TUI"; +in + mapAttrs (_: mkShell) rec { + mdbook.nixago = [cell.config.mdbook]; + default = { + name = "Paisano TUI"; - # Tool Homepage: https://nix-community.github.io/nixago/ - # This is Standard's devshell integration. - # It runs the startup hook when entering the shell. - nixago = [ - inputs.std.lib.cfg.adrgen - inputs.std.lib.cfg.conform - (inputs.std.lib.cfg.treefmt cell.config.treefmt) - (inputs.std.lib.cfg.editorconfig cell.config.editorconfig) - (inputs.std.lib.cfg.githubsettings cell.config.githubsettings) - (inputs.std.lib.cfg.lefthook cell.config.lefthook) - (inputs.std.lib.cfg.mdbook cell.config.mdbook) - ]; - - commands = - [ - { - category = "release"; - package = inputs.nixpkgs.cocogitto; - } - { - category = "rendering"; - package = inputs.nixpkgs.mdbook; - } - { - package = inputs.nixpkgs.delve; - category = "dev"; - name = "dlv"; - } - { - package = inputs.nixpkgs.go; - category = "dev"; - } - { - package = inputs.nixpkgs.gotools; - category = "dev"; - } - { - package = inputs.nixpkgs.gopls; - category = "dev"; - } - ] - ++ inputs.nixpkgs.lib.optionals inputs.nixpkgs.stdenv.isLinux [ - { - package = inputs.nixpkgs.golangci-lint; - category = "dev"; - } + # Tool Homepage: https://nix-community.github.io/nixago/ + # This is Standard's devshell integration. + # It runs the startup hook when entering the shell. + nixago = [ + cell.config.conform + cell.config.treefmt + cell.config.editorconfig + cell.config.githubsettings + cell.config.lefthook + cell.config.mdbook + cell.config.cog ]; - }; -} + + commands = + [ + { + package = nixpkgs.delve; + category = "dev"; + name = "dlv"; + } + { + package = nixpkgs.go; + category = "dev"; + } + { + package = nixpkgs.gotools; + category = "dev"; + } + { + package = nixpkgs.gopls; + category = "dev"; + } + ] + ++ optionals nixpkgs.stdenv.isLinux [ + { + package = nixpkgs.golangci-lint; + category = "dev"; + } + ]; + }; + }