Centralize overlay path specification

This commit is contained in:
Spotlight 2024-05-27 21:23:51 -04:00
parent cca0dd227f
commit a3848d5d18
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
4 changed files with 36 additions and 37 deletions

View file

@ -54,10 +54,6 @@
nixpkgs = { nixpkgs = {
# TODO(spotlightishere): Make this configurable beyond a singular device. # TODO(spotlightishere): Make this configurable beyond a singular device.
hostPlatform = "aarch64-darwin"; hostPlatform = "aarch64-darwin";
# Custom packages.
# TODO(spotlightishere): Why does this need to be specified in both home-manager and globally?
overlays = [ (import ../pkgs/default.nix) ];
}; };
# Our singular user! # Our singular user!

18
flake.lock generated
View file

@ -37,11 +37,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1715930644, "lastModified": 1716847642,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "narHash": "sha256-rjEswRV0o23eBBils8lJXyIGha+l/VjV73IPg+ztxgk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "rev": "10c7c219b7dae5795fb67f465a0d86cbe29f25fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -72,11 +72,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716329735, "lastModified": 1716511055,
"narHash": "sha256-ap51w+VqG21vuzyQ04WrhI2YbWHd3UGz0e7dc/QQmoA=", "narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "eac4f25028c1975a939c8f8fba95c12f8a25e01c", "rev": "0bea8222f6e83247dd13b055d83e64bce02ee532",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -87,11 +87,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1716293225, "lastModified": 1716509168,
"narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=", "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916", "rev": "bfb7a882678e518398ce9a31a881538679f6f092",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -18,7 +18,7 @@
}; };
}; };
outputs = inputs@{ nixpkgs, home-manager, nix-darwin, ... }: outputs = inputs@{ self, nixpkgs, home-manager, nix-darwin, ... }:
let let
# TODO(spotlightishere): Is there a better way to approach this that doesn't # TODO(spotlightishere): Is there a better way to approach this that doesn't
# involve importing so many separate flakes? # involve importing so many separate flakes?
@ -30,6 +30,7 @@
homeManager = { system, specialArgs ? { } }: homeManager = { system, specialArgs ? { } }:
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
nixpkgs.overlays = [ (import ../pkgs/default.nix) ];
modules = [ modules = [
./home/home.nix ./home/home.nix
]; ];
@ -39,33 +40,36 @@
in in
{ {
# There's a few things going on here that are all merged in the end. # There's a few things going on here that are all merged in the end.
# We start with system-specific packages, providing home-manager. # We start with a generalized package overlay, providing several packages
# for e.g. nix-darwin, NixOS, and home-manager usage.
overlays.default = (import ./pkgs/default.nix);
# Secondly, we create system-specific home-manager configurations.
packages = packages =
########################## ##########################
# Linux-specific options # # Linux-specific options #
########################## ##########################
linuxSystems linuxSystems (system: {
(system: { homeConfigurations = {
homeConfigurations = { # First, we currently assume that Linux devices
# First, we currently assume that Linux devices # only require dotfiles and utilize the username `spotlight`.
# only require dotfiles and utilize the username `spotlight`. #
# # For now, this is effectively true, sans a few specific configurations :)
# For now, this is effectively true, sans a few specific configurations :) spotlight = homeManager {
spotlight = homeManager { system = system;
system = system; };
};
# For a special case: with the Steam Deck, we have to assume the user # For a special case: with the Steam Deck, we have to assume the user
# is named `deck` due to its immutable system image. # is named `deck` due to its immutable system image.
deck = homeManager { deck = homeManager {
system = system; system = system;
specialArgs = { specialArgs = {
gpg = true; gpg = true;
username = "deck"; username = "deck";
};
}; };
}; };
}) };
})
// //
@ -90,6 +94,7 @@
imports = [ imports = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
nixpkgs.overlays = [ self.overlays.default ];
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -107,6 +112,7 @@
# Our provided home-manager configuration # Our provided home-manager configuration
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
{ {
nixpkgs.overlays = [ self.overlays.default ];
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
# Custom packages.
nixpkgs.overlays = [ (import ../pkgs/default.nix) ];
# Commonly used packages. # Commonly used packages.
home.packages = with pkgs; [ home.packages = with pkgs; [
binwalk binwalk