From 9550b3ca5bd64b20f17f87096f3d5b8554628db0 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 24 Mar 2024 08:23:39 +0000 Subject: [PATCH] refactor: add keymap-drawer to flake outputs --- drawer/default.nix | 24 ++++++++ flake.lock | 133 ++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 11 ++++ 3 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 drawer/default.nix diff --git a/drawer/default.nix b/drawer/default.nix new file mode 100644 index 0000000..d0889ec --- /dev/null +++ b/drawer/default.nix @@ -0,0 +1,24 @@ +{ + inputs, + lib, + ... +}: let +in { + perSystem = { + pkgs, + system, + ... + }: let + inherit (inputs.poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication; + in { + packages = { + keymap-drawer = mkPoetryApplication { + projectDir = inputs.keymap-drawer; + preferWheels = true; + meta = { + mainProgram = "keymap"; + homepage = "https://github.com/caksoylar/keymap-drawer"; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index df605a3..5a0fc47 100644 --- a/flake.lock +++ b/flake.lock @@ -59,6 +59,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "glove80-zmk": { "flake": false, "locked": { @@ -75,6 +93,43 @@ "type": "github" } }, + "keymap-drawer": { + "flake": false, + "locked": { + "lastModified": 1711220101, + "narHash": "sha256-XY/52aNvwuIJCbCF8xkDUKI9LTntwbmhJFr6DS4Yb+0=", + "owner": "caksoylar", + "repo": "keymap-drawer", + "rev": "f63ccf49bae1df2f58d3f6bab8a0fc13faf6c981", + "type": "github" + }, + "original": { + "owner": "caksoylar", + "repo": "keymap-drawer", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703863825, + "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1711163522, @@ -91,12 +146,38 @@ "type": "github" } }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1708589824, + "narHash": "sha256-2GOiFTkvs5MtVF65sC78KNVxQSmsxtk0WmV1wJ9V2ck=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "3c92540611f42d3fb2d0d084a6c694cd6544b609", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { "devshell": "devshell", "flake-parts": "flake-parts", "glove80-zmk": "glove80-zmk", - "nixpkgs": "nixpkgs" + "keymap-drawer": "keymap-drawer", + "nixpkgs": "nixpkgs", + "poetry2nix": "poetry2nix" } }, "systems": { @@ -113,6 +194,56 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708335038, + "narHash": "sha256-ETLZNFBVCabo7lJrpjD6cAbnE11eDOjaQnznmg/6hAE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "e504621290a1fd896631ddbc5e9c16f4366c9f65", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7f148a0..53c3c2e 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,14 @@ url = "github:moergo-sc/zmk"; flake = false; }; + keymap-drawer = { + url = "github:caksoylar/keymap-drawer"; + flake = false; + }; + poetry2nix = { + url = "github:nix-community/poetry2nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; @@ -19,6 +27,8 @@ self, nixpkgs, glove80-zmk, + keymap-drawer, + poetry2nix, flake-parts, devshell, } @ inputs: @@ -26,6 +36,7 @@ systems = nixpkgs.lib.systems.flakeExposed; imports = [ inputs.devshell.flakeModule + ./drawer ]; perSystem = {