From 77a9c37df76c81b2ef5e74182feebe4ea77ecee3 Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Tue, 11 Feb 2025 21:31:24 -0800 Subject: [PATCH] [Nix] Attempts to allow unfree packages --- flake.nix | 6 ++++-- home-manager/features/nix.nix | 5 +++++ system/hosts/drew-desktop/default.nix | 19 ++++++++++++++++--- system/hosts/tarro-mbp/drew.nix | 2 -- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index acaad1e..6478a55 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,9 @@ description = "System Configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs = { + url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; @@ -25,7 +27,7 @@ }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, ... }@inputs: nixosConfigurations = { drew-desktop = (import ./system/hosts/drew-desktop) { inherit inputs; diff --git a/home-manager/features/nix.nix b/home-manager/features/nix.nix index 4ffa2ae..1dc2ae0 100644 --- a/home-manager/features/nix.nix +++ b/home-manager/features/nix.nix @@ -7,4 +7,9 @@ # Enable flakes and nix-commnands. nix.settings.experimental-features = ["flakes" "nix-command"]; + + # Allow unfree code + nixpkgs.config = { + allowUnfree = true; + }; } diff --git a/system/hosts/drew-desktop/default.nix b/system/hosts/drew-desktop/default.nix index debe950..fb85e37 100644 --- a/system/hosts/drew-desktop/default.nix +++ b/system/hosts/drew-desktop/default.nix @@ -1,6 +1,13 @@ { self, nixpkgs, inputs, ... }: -nixpkgs.lib.nixosSystem { +let system = "x86_64-linux"; + # TODO: Fix this so it doesn't warn about wanting readOnlyPkgs + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; +in nixpkgs.lib.nixosSystem { + inherit system; modules = [ ./configuration.nix ./hardware-configuration.nix @@ -13,8 +20,14 @@ nixpkgs.lib.nixosSystem { ]; }; home-manager.useGlobalPkgs = true; - home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.extraSpecialArgs = { + inherit inputs; + inherit pkgs; + }; } ]; - specialArgs = { inherit inputs; }; + specialArgs = { + inherit inputs; + inherit pkgs; + }; } diff --git a/system/hosts/tarro-mbp/drew.nix b/system/hosts/tarro-mbp/drew.nix index 2dbfde8..e070f00 100644 --- a/system/hosts/tarro-mbp/drew.nix +++ b/system/hosts/tarro-mbp/drew.nix @@ -10,8 +10,6 @@ home.username = "drew"; home.homeDirectory = "/Users/drew"; - nix.settings.experimental-features = ["flakes" "nix-command"]; - home.packages = with pkgs; [ nodejs_22 ];