From 69a47e6734bc1e19d4fd608e9f378a30148f697b Mon Sep 17 00:00:00 2001 From: arcnmx Date: Sun, 28 Jan 2024 12:20:36 -0800 Subject: [PATCH] fix: shell --- devShell.nix | 8 ++++++-- outputs.nix | 11 +++-------- packages/default.nix | 5 ++--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/devShell.nix b/devShell.nix index bf574d8b..bbbd1a32 100644 --- a/devShell.nix +++ b/devShell.nix @@ -2,7 +2,7 @@ inputs, system, }: let - pkgs = inputs.nixpkgs.legacyPackages.${system}; + inherit (inputs.self.legacyPackages.${system}) pkgs; nf-actions = pkgs.writeShellScriptBin "nf-actions" '' NF_CONFIG_FILES=($NF_CONFIG_ROOT/ci/{nodes,flake-cron}.nix) for f in "''${NF_CONFIG_FILES[@]}"; do @@ -60,6 +60,10 @@ nf-argocd = pkgs.writeShellScriptBin "argocd" '' exec nix run ''${FLAKE_OPTS-} "$NF_CONFIG_ROOT#pkgs.argocd" -- "$@" ''; + nf-deploy-rs = pkgs.writeShellScriptBin "deploy" '' + cd "$NF_CONFIG_ROOT" + exec nix shell ''${FLAKE_OPTS-} "$NF_CONFIG_ROOT#deploy-rs" -c deploy "$@" + ''; in pkgs.mkShell { nativeBuildInputs = with pkgs; [ @@ -78,7 +82,7 @@ in nf-deadnix nf-kustomize nf-argocd - deploy-rs + nf-deploy-rs ]; shellHook = '' export NIX_BIN_DIR=$(dirname $(readlink -f $(type -P nix))) diff --git a/outputs.nix b/outputs.nix index 5009ef19..c3c13af4 100644 --- a/outputs.nix +++ b/outputs.nix @@ -15,15 +15,12 @@ inherit inputs lib std pkgs; tree = tree.impure; }; - shells = + outputs = inputs.flake-utils.lib.eachDefaultSystem (system: rec { devShells.default = import ./devShell.nix {inherit system inputs;}; - }); - packages = - inputs.flake-utils.lib.eachDefaultSystem - (system: rec { packages = import ./packages {inherit system inputs lib;}; + legacyPackages.pkgs = pkgs.${system}; }); std = import ./std.nix {inherit inputs;}; inherit (std) set; @@ -32,8 +29,6 @@ in { inherit tree std lib checks; inputs = patchedInputs; - legacyPackages = pkgs; } // systems - // shells - // packages + // outputs diff --git a/packages/default.nix b/packages/default.nix index f4f69f4d..a25d1f39 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -3,18 +3,17 @@ inputs, lib, }: let - inherit (lib.options) mkOption; - inherit (lib.types) attrsOf package; inherit (lib.meta) getExe; inherit (lib.strings) concatStringsSep concatMapStringsSep; packages = inputs.self.packages.${system}; - pkgs = inputs.nixpkgs.legacyPackages.${system}; + inherit (inputs.self.legacyPackages.${system}) pkgs; fmt = import ../ci/fmt.nix; output = { inherit (pkgs.buildPackages) terraform tflint alejandra deadnix statix ; + inherit (inputs.deploy-rs.packages.${system}) deploy-rs; nf-deploy = pkgs.writeShellScriptBin "nf-deploy" '' exec ${pkgs.runtimeShell} ${../ci/deploy.sh} "$@" '';