Skip to content

Commit

Permalink
lib/flake: easier nixpkgs/home overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Oct 20, 2023
1 parent aba9751 commit a3e985b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/flake.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ self, nixpkgs, home, flake-utils, ... }:
{ self, nixpkgs, flake-utils, ... }@inputs:

let
inherit (flake-utils.lib) eachDefaultSystem mkApp;
Expand Down Expand Up @@ -53,14 +53,14 @@ in
mkNixOSConfig =
{ hostname
, system ? null # get from hardware-configuration.nix by default
, nixosSystem ? nixpkgs.lib.nixosSystem
, nixpkgs ? inputs.nixpkgs
, extraModules ? [ ]
}:
let
inherit (self.outputs.nixosConfigurations.${hostname}) config pkgs;
in
{
nixosConfigurations.${hostname} = nixosSystem {
nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ../hosts/${hostname} ] ++ extraModules;
lib = nixpkgs.lib.extend (final: prev:
Expand Down Expand Up @@ -96,14 +96,12 @@ in
, deviceType ? "desktop"
, extraModules ? [ ]
, system ? "x86_64-linux"
, homeManagerConfiguration ? home.lib.homeManagerConfiguration
, nixpkgs ? inputs.nixpkgs
, home ? inputs.home
}:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
homeConfigurations.${hostname} = homeManagerConfiguration {
inherit pkgs;
homeConfigurations.${hostname} = home.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
({ ... }: {
home = { inherit username homeDirectory; };
Expand Down

0 comments on commit a3e985b

Please sign in to comment.