flake: add option to install packages from nixos-unstable

This commit is contained in:
Timothy DeHerrera 2020-06-12 19:18:27 -06:00
parent 861cb69fa1
commit 05a798a56e
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
4 changed files with 54 additions and 26 deletions

View File

@ -57,7 +57,25 @@
"root": {
"inputs": {
"home": "home",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"unstable": "unstable"
}
},
"unstable": {
"info": {
"lastModified": 1591465133,
"narHash": "sha256-HdXyiHl8TumxQZhs2/DCSnqbi1GnvqXaZlsJneGf0g0="
},
"locked": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "029a5de08390bb03c3f44230b064fd1850c6658a",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
}
},

View File

@ -2,9 +2,10 @@
description = "A highly structured configuration database.";
inputs.nixpkgs.url = "nixpkgs/release-20.03";
inputs.unstable.url = "nixpkgs/nixos-unstable";
inputs.home.url = "github:rycee/home-manager/bqv-flakes";
outputs = inputs@{ self, home, nixpkgs }:
outputs = inputs@{ self, home, nixpkgs, unstable }:
let
inherit (builtins) listToAttrs baseNameOf attrNames attrValues readDir;
inherit (nixpkgs.lib) removeSuffix;
@ -22,21 +23,26 @@
value = import path;
});
pkgs = import nixpkgs {
pkgImport = pkgs:
import pkgs {
inherit system;
overlays = attrValues self.overlays;
config = { allowUnfree = true; };
};
pkgs = pkgImport nixpkgs;
unstablePkgs = pkgImport unstable;
in {
nixosConfigurations =
let configs = import ./hosts (inputs // { inherit system pkgs; });
nixosConfigurations = let
configs =
import ./hosts (inputs // { inherit system pkgs unstablePkgs; });
in configs;
overlay = import ./pkgs;
overlays =
let
overlays = let
overlayDir = ./overlays;
fullPath = name: overlayDir + "/${name}";
overlayPaths = map fullPath (attrNames (readDir overlayDir));

View File

@ -1,4 +1,4 @@
inputs@{ home, nixpkgs, self, pkgs, system, ... }:
inputs@{ home, nixpkgs, unstablePkgs, self, pkgs, system, ... }:
let
inherit (nixpkgs) lib;
@ -12,7 +12,10 @@ let
lib.nixosSystem {
inherit system;
specialArgs.usr = { inherit utils; };
specialArgs = {
inherit unstablePkgs;
usr = { inherit utils; };
};
modules = let
inherit (home.nixosModules) home-manager;

View File

@ -1,10 +1,11 @@
{ pkgs, ... }:
{ unstablePkgs, ... }:
let inherit (builtins) readFile;
in {
sound.enable = true;
environment = {
etc."xdg/qutebrowser/config.py".text = let mpv = "${pkgs.mpv}/bin/mpv";
etc."xdg/qutebrowser/config.py".text =
let mpv = "${unstablePkgs.mpv}/bin/mpv";
in ''
${readFile ./config.py}
@ -14,6 +15,6 @@ in {
sessionVariables.BROWSER = "qute";
systemPackages = with pkgs; [ qute qutebrowser mpv youtubeDL ];
systemPackages = with unstablePkgs; [ qute qutebrowser mpv youtubeDL ];
};
}