From 1341c0520b47716606e6a5bb57da2ee50bef7cbe Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Thu, 19 Oct 2023 09:34:06 +0200 Subject: [PATCH] use NUR as an overlay --- configuration.nix | 25 ++++++++++++++++++++++++- flake.nix | 10 ++++++++-- home/default.nix | 7 ++----- home/firefox/addons.nix | 6 +++--- home/firefox/custom-addons.nix | 2 +- home/firefox/default.nix | 5 ++--- 6 files changed, 40 insertions(+), 15 deletions(-) diff --git a/configuration.nix b/configuration.nix index 8fa40e6..2f6aa94 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: { +{ pkgs, outputs, config, ... }: { imports = [ ./hardware-configuration.nix @@ -116,4 +116,27 @@ setSocketVariable = true; }; }; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.nurPackages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; } diff --git a/flake.nix b/flake.nix index 9bf43bb..889f370 100644 --- a/flake.nix +++ b/flake.nix @@ -18,9 +18,15 @@ inputs.home-manager.follows = "home-manager"; }; }; - - outputs = { nixpkgs, home-manager, homeage, agenix, nur, ... }: { + + outputs = { self, nixpkgs, home-manager, homeage, agenix, nur, ... }: + let + inherit (self) outputs; + in + { + overlays = { nurPackages = nur.overlay; }; nixosConfigurations.pim = nixpkgs.lib.nixosSystem { + specialArgs = { inherit outputs; }; system = "x86_64-linux"; modules = [ ./configuration.nix diff --git a/home/default.nix b/home/default.nix index 68f3207..2adbf44 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,13 +1,10 @@ -{ pkgs, nur, ... }: +{ pkgs, ... }: -let - nur-no-pkgs = import (nur) { inherit pkgs; nurpkgs = pkgs; }; -in { imports = [ ./bash ./neovim - (import ./firefox nur-no-pkgs) # TODO: bit of a hack, but better than before + ./firefox ./ssh ./syncthing ./alacritty diff --git a/home/firefox/addons.nix b/home/firefox/addons.nix index cc519fd..38cf1ff 100644 --- a/home/firefox/addons.nix +++ b/home/firefox/addons.nix @@ -1,7 +1,7 @@ -{ nurpkgs, lib, ... }@args: +pkgs: lib: let - rycee-addons = nurpkgs.repos.rycee.firefox-addons; - custom-addons = import ./custom-addons.nix args; + rycee-addons = pkgs.nur.repos.rycee.firefox-addons; + custom-addons = import ./custom-addons.nix pkgs lib; in { default = lib.concatLists [ diff --git a/home/firefox/custom-addons.nix b/home/firefox/custom-addons.nix index 6b0dec1..ed14f16 100644 --- a/home/firefox/custom-addons.nix +++ b/home/firefox/custom-addons.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +pkgs: lib: let # Stolen from: https://github.com/nix-community/nur-combined/blob/master/repos/rycee/pkgs/firefox-addons/default.nix buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? pkgs.stdenv, fetchurl ? pkgs.fetchurl, diff --git a/home/firefox/default.nix b/home/firefox/default.nix index d5825b3..9778057 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -1,8 +1,7 @@ -nurpkgs: -{ pkgs, lib, ... }@args: +{ pkgs, lib, ... }: let - firefoxAddons = import ./addons.nix (args // { inherit nurpkgs; }); + firefoxAddons = import ./addons.nix pkgs lib; firefoxSettings = { "browser.aboutConfig.showWarning" = false; "browser.toolbars.bookmarks.visibility" = "always";