From 506e810b9f753bc409836a1395826506e2430219 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Fri, 10 Jan 2020 00:10:59 -0700 Subject: [PATCH] flake: initial NUR support --- configuration.nix | 11 +++++++++-- flake.lock | 13 +++++++++++++ flake.nix | 3 ++- hosts/default.nix | 4 +++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/configuration.nix b/configuration.nix index 506b0009..d7f2e287 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,7 +1,7 @@ # this file is an impure recreation of the flake profile currently deployed # based on the systems hostname. The purpose is so tools which do not yet have # flake support (e.g `nixos-option`), can work as expected. -{ lib, ... }: +{ lib, pkgs, ... }: let inherit (builtins) attrNames readDir; @@ -30,5 +30,12 @@ in { nixpkgs.overlays = let overlays = map (name: import (./overlays + "/${name}")) (attrNames (readDir ./overlays)); - in overlays; + in overlays ++ [ + (final: prev: { + nur = import (builtins.fetchTarball + "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + }; + }) + ]; } diff --git a/flake.lock b/flake.lock index 370e14a9..9157fa13 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,19 @@ "narHash": "sha256-4p9gqMJTVmyH7eSq1euGZWusldWoBfKfi/VwZEPL2Mw=", "originalUrl": "github:nrdxp/nixpkgs/fork", "url": "github:nrdxp/nixpkgs/1e232452ed4c57e9968f4342d9ba044d36403928" + }, + "nur": { + "inputs": { + "nixpkgs": { + "inputs": {}, + "narHash": "sha256-4p9gqMJTVmyH7eSq1euGZWusldWoBfKfi/VwZEPL2Mw=", + "originalUrl": "nixpkgs", + "url": "github:nrdxp/nixpkgs/1e232452ed4c57e9968f4342d9ba044d36403928" + } + }, + "narHash": "sha256-i+NZZWnhNcxl73e2FjfgKUn3sW42ZKiVeXNKv72MN14=", + "originalUrl": "github:nrdxp/NUR/flake", + "url": "github:nrdxp/NUR/c632e4112b19a1b2fa05242a8cc971091d12e154" } }, "version": 3 diff --git a/flake.nix b/flake.nix index 479f52d4..331bc182 100644 --- a/flake.nix +++ b/flake.nix @@ -5,8 +5,9 @@ inputs.nixpkgs.url = "github:nrdxp/nixpkgs/fork"; inputs.home.url = "github:nrdxp/home-manager/flakes"; + inputs.nur.url = "github:nrdxp/NUR/flake"; - outputs = args@{ self, home, nixpkgs }: + outputs = args@{ self, home, nixpkgs, nur }: let inherit (builtins) listToAttrs baseNameOf attrNames readDir; inherit (nixpkgs.lib) removeSuffix; diff --git a/hosts/default.nix b/hosts/default.nix index 0ecedae8..33e64e79 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -11,6 +11,8 @@ let system = "x86_64-linux"; specialArgs.usr = utils; + specialArgs.nurModules = args.nur.nixosModules; + specialArgs.nurOverlays = args.nur.overlays; modules = let core = ../profiles/core.nix; @@ -24,7 +26,7 @@ let ]; system.configurationRevision = self.rev; - nixpkgs.overlays = self.overlays; + nixpkgs.overlays = self.overlays ++ [ args.nur.overlay ]; }; local = import "${toString ./.}/${this}.nix";