flake: add overlays and minimal devShell

inspired by 1cbeaa156b/profiles/base/default.nix
This commit is contained in:
Trolli Schmittlauch 2024-02-12 19:12:47 +01:00
parent bcf415bcec
commit 5cb55e9805
3 changed files with 22 additions and 4 deletions

View file

@ -1,6 +1,8 @@
{ pkgs, config, ... }: { lib, pkgs, config, ... }:
{ {
# take overlays from flake
nixpkgs.overlays = lib.attrValues config.inputInjection.flake-inputs.self.overlays;
# List packages installed in system profile. # List packages installed in system profile.
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget

View file

@ -26,10 +26,10 @@
}; };
outputs = outputs =
{ self, nixpkgs, nur, lanzaboote, flake-utils, home-manager, ... }@inputs: { self, nixpkgs, nur, lanzaboote, utils, home-manager, ... }@inputs:
let let
# FIXME: allow different systems # FIXME: allow different systems
systems = flake-utils.lib.system; systems = utils.lib.system;
# necessary to make the top-level inputs available to system configuration # necessary to make the top-level inputs available to system configuration
# inspired by https://jade.fyi/blog/flakes-arent-real/ # inspired by https://jade.fyi/blog/flakes-arent-real/
inputInjection = {pkgs, lib, ...}: { inputInjection = {pkgs, lib, ...}: {
@ -74,10 +74,24 @@
}; };
in in
{ {
overlays.default = import ./packages;
nixosConfigurations = { nixosConfigurations = {
thinknix = mkSystem systems.x86_64-linux [ ./hosts/thinknix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s lanzaboote.nixosModules.lanzaboote ]; thinknix = mkSystem systems.x86_64-linux [ ./hosts/thinknix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s lanzaboote.nixosModules.lanzaboote ];
framenix = mkSystem systems.x86_64-linux [ ./hosts/framenix inputs.nixos-hardware.nixosModules.framework-13-7040-amd lanzaboote.nixosModules.lanzaboote ]; framenix = mkSystem systems.x86_64-linux [ ./hosts/framenix inputs.nixos-hardware.nixosModules.framework-13-7040-amd lanzaboote.nixosModules.lanzaboote ];
}; };
homeConfigurations.spiollinux = mkHomeManager "spiollinux" "spiollinux" systems.x86_64-linux; homeConfigurations.spiollinux = mkHomeManager "spiollinux" "spiollinux" systems.x86_64-linux;
}; } // utils.lib.eachDefaultSystem(system:
let
nixpkgs = import inputs.nixpkgs {
inherit system;
overlays = nixpkgs.lib.attrValues self.overlays;
};
pkgs = inputs.nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
buildInputs = [];
};
# expose nixpkgs with overlay; TODO: figure out role of config
#legacyPackages = nixpkgs;
});
} }

2
packages/default.nix Normal file
View file

@ -0,0 +1,2 @@
final: prev: {
}