From 01f5308c73135d7d1bb7dbab77145e5b49210cbc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 1 May 2025 22:19:50 +0200 Subject: [PATCH] add unstable packages --- flake.lock | 17 +++++++++++++++++ flake.nix | 29 ++++++++++++++++++++++------- home/vinzenz/configuration.nix | 2 ++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 3b4ce17..84dee85 100644 --- a/flake.lock +++ b/flake.lock @@ -165,12 +165,29 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1746061036, + "narHash": "sha256-OxYwCGJf9VJ2KnUO+w/hVJVTjOgscdDg/lPv8Eus07Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3afd19146cac33ed242fc0fc87481c67c758a59e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "lix-module": "lix-module", "niri": "niri", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "zerforschen-plus": "zerforschen-plus" } }, diff --git a/flake.nix b/flake.nix index 7d83008..566b5e7 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,8 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + home-manager = { url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -32,6 +34,7 @@ lix-module, niri, zerforschen-plus, + nixpkgs-unstable, }: let devices = { @@ -48,14 +51,15 @@ ]; forDevice = f: nixpkgs.lib.mapAttrs f devices; in - { + rec { nixosConfigurations = forDevice ( device: system: - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; + let specialArgs = { + inherit inputs device; + pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}"; + }; + in nixpkgs.lib.nixosSystem { + inherit system specialArgs; modules = [ lix-module.nixosModules.default @@ -69,10 +73,12 @@ ./hosts/${device}/hardware.nix ./hosts/${device}/imports.nix ./hosts/${device}/configuration.nix + + { nixpkgs.overlays = [ overlays.unstable-packages ]; } ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ home-manager.nixosModules.home-manager - { home-manager.extraSpecialArgs = { inherit device; }; } + { home-manager.extraSpecialArgs = specialArgs; } ./modules/home-manager.nix ./modules/i18n.nix @@ -83,6 +89,15 @@ } ); + overlays = { + unstable-packages = final: prev: { + unstable = import nixpkgs-unstable { + system = prev.system; + config = prev.config; + }; + }; + }; + formatter = { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-rfc-style; diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 1890000..8da0974 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -49,6 +49,8 @@ arduino-cli kicad kikit + + unstable.ut1999 ]; home.file."policy.json" = {