diff --git a/flake.nix b/flake.nix index c2758b0..55a7961 100644 --- a/flake.nix +++ b/flake.nix @@ -3,13 +3,16 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; + nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs }: { + outputs = { self, nixpkgs, ... }@inputs: { nixosConfigurations.thinknix = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ./nixos/configuration.nix ]; + # necessary to make the top-level inputs available to system configuration + specialArgs = { inherit inputs; }; }; }; } diff --git a/nixos/configuration.nix b/nixos/configuration.nix index af6b0f3..df6224e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -2,10 +2,10 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, lib, inputs, ... }: let - unstable = import { }; + unstable = inputs.nixos-unstable; localfork = import /home/spiollinux/src/nixpkgs { }; in @@ -234,15 +234,22 @@ in # Enable all sysrq functions (useful to recover from some issues): boot.kernel.sysctl."kernel.sysrq" = 1; # NixOS default: 16 (only the sync command) + nix = { + # expose all flake inputs through nix Path and registry + registry = (lib.mapAttrs (_: value: { flake = value; }) inputs) // { + nixpkgs.flake = inputs.nixpkgs; + }; + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; # keep build-time deps around for offline-rebuilding - nix.settings = { - # keep around all inputs necessary for offline-rebuilding the system - keep-outputs = true; - keep-derivations = true; - trusted-users = [ "spiollinux" ]; - experimental-features = [ "nix-command" "flakes" ]; - # use all cores for building - cores = 0; + settings = { + # keep around all inputs necessary for offline-rebuilding the system + keep-outputs = true; + keep-derivations = true; + trusted-users = [ "spiollinux" ]; + experimental-features = [ "nix-command" "flakes" ]; + # use all cores for building + cores = 0; + }; }; # override tmpdir for daemon #systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp";