From c4be4abdebda6cc6611e1b8d6f04d08a2f56871f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20H=C3=A9mono?= Date: Wed, 7 Aug 2024 19:01:00 +0200 Subject: [PATCH] feat: add unstable nixpkgs overlay --- flake.lock | 17 +++++++++++++++++ flake.nix | 11 +++++++++-- hosts/gwiad/configuration.nix | 3 ++- overlays/default.nix | 11 +++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 overlays/default.nix diff --git a/flake.lock b/flake.lock index 1162b13..a83a5c1 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,28 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1722813957, + "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "mysecrets": "mysecrets", "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix" } }, diff --git a/flake.nix b/flake.nix index a044690..1e6bfa6 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Secrets management sops-nix = { @@ -27,7 +28,13 @@ }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, ... }@inputs: let + inherit (self) outputs; + in { + + # Custom packages and modifications, exported as overlays + overlays = import ./overlays {inherit inputs;}; + nixosConfigurations = { sesame = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; @@ -37,7 +44,7 @@ ]; }; gwiad = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; + specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/gwiad/configuration.nix # inputs.home-manager.nixosModules.default diff --git a/hosts/gwiad/configuration.nix b/hosts/gwiad/configuration.nix index 2d3fec9..509200d 100644 --- a/hosts/gwiad/configuration.nix +++ b/hosts/gwiad/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, inputs, ... }: +{ config, lib, pkgs, inputs, outputs, ... }: { imports = @@ -43,6 +43,7 @@ config.allowUnfree = true; overlays = [ inputs.nix-vscode-extensions.overlays.default + outputs.overlays.unstable-packages ]; }; diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..1d0fb57 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,11 @@ +# This file defines overlays +{inputs, ...}: { + # When applied, the unstable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.unstable' + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; +}