From ad64ae1ecc2824916f7fe549837d3f31ea39f134 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Fri, 18 Oct 2024 10:38:31 +0200 Subject: [PATCH] clean up flake.nix --- flake.nix | 54 +++++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index 07a7f01..9e7b129 100644 --- a/flake.nix +++ b/flake.nix @@ -18,72 +18,52 @@ }; outputs = - { + inputs@{ self, nixpkgs, - ghostty, ghostty-hm, home-manager, ... - }@inputs: + }: let inherit (self) outputs; + system = "x86_64-linux"; + + pkgs = nixpkgs.legacyPackages.${system}; + mkHome = modules: home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit inputs outputs; + }; modules = [ ghostty-hm.homeModules.default ./home/common ] ++ modules; - pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { - inherit inputs outputs; - }; }; mkHost = modules: nixpkgs.lib.nixosSystem { + inherit system; specialArgs = { inherit inputs outputs; }; - system = "x86_64-linux"; modules = [ ./common ] ++ modules; }; - - supportedSystems = [ - "x86_64-linux" - "aarch64-linux" - ]; - forEachSystem = - f: - builtins.listToAttrs ( - map (system: { - name = system; - value = f system; - }) supportedSystems - ); - systemBits = forEachSystem (system: rec { - inherit system; - pkgs = import nixpkgs { - localSystem = system; - overlays = [ ]; - }; - }); - - forEachSystem' = f: forEachSystem (system: (f systemBits.${system})); - inherit (nixpkgs) lib; in { overlays = import ./overlays { inherit inputs outputs; }; - devShells = forEachSystem' ( - { system, pkgs, ... }: - { - default = pkgs.mkShell { packages = [ ]; }; - } - ); + devShell.${system} = pkgs.mkShell { + packages = with pkgs; [ + just + nh + ]; + }; homeConfigurations = { "dln@dinky" = mkHome [ ./home/dln/dinky.nix ];