diff options
| -rw-r--r-- | flake.lock | 102 | ||||
| -rw-r--r-- | flake.nix | 68 | ||||
| -rw-r--r-- | overlays/default.nix | 3 | ||||
| -rw-r--r-- | pkgs/chef/default.nix | 26 | ||||
| -rw-r--r-- | pkgs/cook-import/default.nix | 17 |
5 files changed, 50 insertions, 166 deletions
@@ -1,41 +1,20 @@ { "nodes": { - "flake-utils": { + "flake-parts": { "inputs": { - "systems": "systems" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "lastModified": 1754091436, + "narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "poetry2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729742964, - "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-github-actions", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, @@ -54,37 +33,26 @@ "type": "github" } }, - "poetry2nix": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_2", - "treefmt-nix": "treefmt-nix" - }, + "nixpkgs-lib": { "locked": { - "lastModified": 1743690424, - "narHash": "sha256-cX98bUuKuihOaRp8dNV1Mq7u6/CQZWTPth2IJPATBXc=", + "lastModified": 1753579242, + "narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=", "owner": "nix-community", - "repo": "poetry2nix", - "rev": "ce2369db77f45688172384bbeb962bc6c2ea6f94", + "repo": "nixpkgs.lib", + "rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e", "type": "github" }, "original": { "owner": "nix-community", - "repo": "poetry2nix", + "repo": "nixpkgs.lib", "type": "github" } }, "root": { "inputs": { - "flake-utils": "flake-utils", + "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", - "poetry2nix": "poetry2nix" + "systems": "systems" } }, "systems": { @@ -101,42 +69,6 @@ "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" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "poetry2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1730120726, - "narHash": "sha256-LqHYIxMrl/1p3/kvm2ir925tZ8DkI0KA10djk8wecSk=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "9ef337e492a5555d8e17a51c911ff1f02635be15", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } } }, "root": "root", @@ -2,61 +2,33 @@ description = "cooklang utilities"; inputs = { - nixpkgs.url = github:nixos/nixpkgs; - flake-utils.url = github:numtide/flake-utils; - poetry2nix = { - url = github:nix-community/poetry2nix; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; + nixpkgs.url = "github:nixos/nixpkgs"; + flake-parts.url = "github:hercules-ci/flake-parts"; + systems.url = "github:nix-systems/default"; }; - outputs = inputs@{ self, nixpkgs, flake-utils, poetry2nix, ... }: { - - overlays = { - default = import ./overlays; - }; + outputs = inputs @ { self, nixpkgs, flake-parts, ... }: flake-parts.lib.mkFlake { inherit self inputs; } { + systems = import inputs.systems; - nixosModules = { - default = import ./modules/nixos; - }; - homeManagerModules = { - default = import ./modules/home-manager; + flake = { + overlays.default = import ./overlays; + nixosModules.default = import ./modules/nixos; + homeModules.default = import ./modules/home-manager; }; - } // flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ - self.overlays.default - (prev: final: { - poetry2nix = poetry2nix.lib.mkPoetry2Nix { pkgs = prev; }; - }) - ]; - }; - in { - packages = { - inherit (pkgs) cooklang-chef cook-cli; - inherit (pkgs.vimPlugins) vim-cooklang; - }; - - apps = { - chef = { - type = "app"; - program = pkgs.lib.getExe pkgs.cooklang-chef; - }; - cookcli = { - type = "app"; - program = pkgs.lib.getExe pkgs.cook-cli; + perSystem = { config, pkgs, system, ... }: { + _module.args.pkgs = import nixpkgs { + inherit system; + overlays = [ + self.overlays.default + ]; }; - cook-import = { - type = "app"; - program = pkgs.lib.getExe pkgs.cook-import; + + packages = { + inherit (pkgs) cooklang-chef; + inherit (pkgs.vimPlugins) vim-cooklang; }; }; - }); + }; } diff --git a/overlays/default.nix b/overlays/default.nix index 1133f88..22ba89c 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,9 +1,6 @@ final: prev: { - cooklang-chef = prev.callPackage ../pkgs/chef {}; - cook-import = prev.callPackage ../pkgs/cook-import {}; - vimPlugins = prev.vimPlugins.extend (_: _: { vim-cooklang = prev.callPackage ../pkgs/vim-cooklang.nix {}; }); diff --git a/pkgs/chef/default.nix b/pkgs/chef/default.nix index b765966..2830cae 100644 --- a/pkgs/chef/default.nix +++ b/pkgs/chef/default.nix @@ -1,39 +1,39 @@ -{ rustPlatform, fetchFromGitHub, lib, installShellFiles -, ... }: -let +{ rustPlatform, fetchFromGitHub, lib, installShellFiles }: +rustPlatform.buildRustPackage rec { pname = "cooklang-chef"; - version = "0.10.0"; + version = "0.10.1"; src = fetchFromGitHub { owner = "Zheoni"; repo = "cooklang-chef"; rev = "v${version}"; - hash = "sha256-YPsofecsdiJE4rWVy82ao99YZiCPEPoF14XavTAhq+w="; + hash = "sha256-U/zEtDHIAjBakMjIqpJeFzTxof8SHSgLj9zjgND6q1Q="; }; -in rustPlatform.buildRustPackage { - inherit pname version src; - cargoHash = "sha256-77KPW4SQ9KI0H+ND3mFITJjftLjpLMXi7qp0PUZOINw="; + cargoLock.lockFile = "${src}/Cargo.lock"; nativeBuildInputs = [ installShellFiles ]; postInstall = '' + # Without setting $XDG_CONFIG_HOME, `chef` will complain when trying to generate completion scripts export XDG_CONFIG_HOME=$out/share for s in bash fish zsh; do - installShellCompletion --cmd chef --$s <($out/bin/chef generate-completions $s) + installShellCompletion --cmd ${meta.mainProgram} --$s <($out/bin/chef generate-completions $s) done ''; - # passthru = { - # inherit ui; - # }; - meta = with lib; { homepage = "https://github.com/Zheoni/cooklang-chef"; description = "A CLI to manage cooklang recipes with extensions"; license = licenses.mit; mainProgram = "chef"; + maintainer = { + name = "Chris Wells"; + github = "the-mathematicaster"; + email = "chris@mathematicaster.org"; + githubId = 99217745; + }; }; } diff --git a/pkgs/cook-import/default.nix b/pkgs/cook-import/default.nix deleted file mode 100644 index 512745e..0000000 --- a/pkgs/cook-import/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ poetry2nix, fetchFromGitHub, lib, ... }: -poetry2nix.mkPoetryApplication { - projectDir = fetchFromGitHub { - owner = "cooklang"; - repo = "cook-import"; - rev = "d92e44a"; - hash = "sha256-SSrLN0qhHNalF8RrsZvezqZvAkcKCLukSGW9f3IHIIE="; - }; - - meta = with lib; { - homepage = "https://github.com/cooklang/cook-import"; - description = "A command-line tool to import recipes into Cooklang format"; - license = licenses.mit; - mainProgram = "cook-import"; - broken = true; - }; -} |
