diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 68 |
1 files changed, 20 insertions, 48 deletions
@@ -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; }; }; - }); + }; } |
