From 3f6665b1a1f837449831d94195b8c171c1b1a333 Mon Sep 17 00:00:00 2001 From: specCon18 Date: Tue, 19 Sep 2023 18:12:24 -0400 Subject: [PATCH] updated flake to stop use of --impure --- flake.nix | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 2a7a14c..2f60c79 100644 --- a/flake.nix +++ b/flake.nix @@ -7,14 +7,28 @@ let supportedSystems = [ "x86_64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - pkgsFor = nixpkgs.legacyPackages; + #v I improved how you call in packages + pkgs = forAllSystems (system: + import nixpkgs { + inherit system; + #v this can be adjusted to read args passed without impure later + config = { allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ + "unrar" + ]; + }; + } + ); in { packages = forAllSystems (system: { - default = pkgsFor.${system}.callPackage ./nix/default.nix { }; + default = pkgs.${system}.callPackage ./nix/default.nix { }; }); devShells = forAllSystems (system: { - default = pkgsFor.${system}.callPackage ./nix/devshell.nix { }; + default = pkgs.${system}.callPackage ./nix/devshell.nix { }; }); + nixConfig = { + #v I would have like this to work but it requires the nix user to set an option. + allowUnfree = true; + }; }; } \ No newline at end of file