summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2021-03-07 14:17:48 -0500
committerKjetil Orbekk <kj@orbekk.com>2021-03-07 14:17:48 -0500
commit46e1d2a1552d4aaad676faf49cb0582515d62c86 (patch)
tree7133f0b4034659685d5f33ac9c6d76959fc8ffc3
parent4e91f3e6cf9c13bb4b0974715cab8c252247b94b (diff)
Properly wrap up unstable in flake config
-rw-r--r--flake.nix33
1 files changed, 29 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index 2de484b..d94478d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,6 +11,26 @@
inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, nixpkgs-unstable, nix, nixos-hardware, home-manager }:
+ let
+ system = "x86_64-linux";
+
+ pkgs-module = {config, ...}:
+ let
+ cfg = config.nixpkgs;
+
+ unstable-overlay = final: prev: {
+ unstable = import nixpkgs-unstable {
+ inherit (cfg) config localSystem crossSystem;
+ };
+ };
+ in {
+ nixpkgs.pkgs = import nixpkgs {
+ inherit (cfg) config localSystem crossSystem;
+ overlays = cfg.overlays ++ [ unstable-overlay ];
+ };
+ };
+
+ in
{
nixosConfigurations = let
mkConfig = { hostName
@@ -18,23 +38,28 @@
, system ? "x86_64-linux" }: {
name = hostName;
value = nixpkgs.lib.nixosSystem {
- system = "x86_64-linux";
+ inherit system;
+
modules =
[
+ pkgs-module
module
nixpkgs.nixosModules.notDetected
({config, pkgs, ...}: {
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision =
- if self ? rev then self.rev else "DIRTY";
+ let
+ lastModified = final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101");
+ in
+ "${lastModified}.${self.shortRev or "dirty"}";
nixpkgs.overlays = [
# Add unstable packages.
(final: prev: {
my-extras = {
- inherit nixpkgs;
- inherit nixpkgs-unstable;
+ # inherit nixpkgs;
+ # inherit nixpkgs-unstable;
inherit nixos-hardware;
};
})