From b3d11ffcb4e367169d3677adf1ec0746963734b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 25 Mar 2023 07:38:31 +0100 Subject: [PATCH] add an unfree template --- flake.nix | 6 ++++++ template/unfree/flake.nix | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 template/unfree/flake.nix diff --git a/flake.nix b/flake.nix index a127e8c..5d1447b 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,12 @@ A minimal flake using flake-parts. ''; }; + unfree = { + path = ./template/unfree; + description = '' + A minimal flake using flake-parts importing nixpkgs with the unfree option. + ''; + }; }; flakeModules = { easyOverlay = ./extras/easyOverlay.nix; diff --git a/template/unfree/flake.nix b/template/unfree/flake.nix new file mode 100644 index 0000000..7ec00c3 --- /dev/null +++ b/template/unfree/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Description for the project"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = inputs@{ flake-parts, nixpkgs, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-darwin" ]; + perSystem = { pkgs, system, ... }: { + # This sets `pkgs` to a nixpkgs with allowUnfree option set. + _module.args.pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + packages.default = pkgs.hello-unfree; + }; + }; +}