flake: add option to install packages from nixos-unstable
This commit is contained in:
parent
861cb69fa1
commit
05a798a56e
4 changed files with 54 additions and 26 deletions
20
flake.lock
20
flake.lock
|
@ -57,7 +57,25 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home": "home",
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
18
flake.nix
18
flake.nix
|
@ -2,9 +2,10 @@
|
||||||
description = "A highly structured configuration database.";
|
description = "A highly structured configuration database.";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "nixpkgs/release-20.03";
|
inputs.nixpkgs.url = "nixpkgs/release-20.03";
|
||||||
|
inputs.unstable.url = "nixpkgs/nixos-unstable";
|
||||||
inputs.home.url = "github:rycee/home-manager/bqv-flakes";
|
inputs.home.url = "github:rycee/home-manager/bqv-flakes";
|
||||||
|
|
||||||
outputs = inputs@{ self, home, nixpkgs }:
|
outputs = inputs@{ self, home, nixpkgs, unstable }:
|
||||||
let
|
let
|
||||||
inherit (builtins) listToAttrs baseNameOf attrNames attrValues readDir;
|
inherit (builtins) listToAttrs baseNameOf attrNames attrValues readDir;
|
||||||
inherit (nixpkgs.lib) removeSuffix;
|
inherit (nixpkgs.lib) removeSuffix;
|
||||||
|
@ -22,21 +23,26 @@
|
||||||
value = import path;
|
value = import path;
|
||||||
});
|
});
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgImport = pkgs:
|
||||||
|
import pkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = attrValues self.overlays;
|
overlays = attrValues self.overlays;
|
||||||
config = { allowUnfree = true; };
|
config = { allowUnfree = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pkgs = pkgImport nixpkgs;
|
||||||
|
|
||||||
|
unstablePkgs = pkgImport unstable;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
nixosConfigurations =
|
nixosConfigurations = let
|
||||||
let configs = import ./hosts (inputs // { inherit system pkgs; });
|
configs =
|
||||||
|
import ./hosts (inputs // { inherit system pkgs unstablePkgs; });
|
||||||
in configs;
|
in configs;
|
||||||
|
|
||||||
overlay = import ./pkgs;
|
overlay = import ./pkgs;
|
||||||
|
|
||||||
overlays =
|
overlays = let
|
||||||
let
|
|
||||||
overlayDir = ./overlays;
|
overlayDir = ./overlays;
|
||||||
fullPath = name: overlayDir + "/${name}";
|
fullPath = name: overlayDir + "/${name}";
|
||||||
overlayPaths = map fullPath (attrNames (readDir overlayDir));
|
overlayPaths = map fullPath (attrNames (readDir overlayDir));
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
inputs@{ home, nixpkgs, self, pkgs, system, ... }:
|
inputs@{ home, nixpkgs, unstablePkgs, self, pkgs, system, ... }:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
|
@ -12,7 +12,10 @@ let
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
specialArgs.usr = { inherit utils; };
|
specialArgs = {
|
||||||
|
inherit unstablePkgs;
|
||||||
|
usr = { inherit utils; };
|
||||||
|
};
|
||||||
|
|
||||||
modules = let
|
modules = let
|
||||||
inherit (home.nixosModules) home-manager;
|
inherit (home.nixosModules) home-manager;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{ pkgs, ... }:
|
{ unstablePkgs, ... }:
|
||||||
let inherit (builtins) readFile;
|
let inherit (builtins) readFile;
|
||||||
in {
|
in {
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
environment = {
|
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 ''
|
in ''
|
||||||
${readFile ./config.py}
|
${readFile ./config.py}
|
||||||
|
|
||||||
|
@ -14,6 +15,6 @@ in {
|
||||||
|
|
||||||
sessionVariables.BROWSER = "qute";
|
sessionVariables.BROWSER = "qute";
|
||||||
|
|
||||||
systemPackages = with pkgs; [ qute qutebrowser mpv youtubeDL ];
|
systemPackages = with unstablePkgs; [ qute qutebrowser mpv youtubeDL ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue