Compare commits

...

2 commits

Author SHA1 Message Date
378572fe5b
home-manager: Properly use flake-provided overly
Oops :)
2024-10-07 20:57:29 -05:00
67cf3adb8e
Properly export all packages for CI builds
We now properly handle deeply merging attributes, allowing us to export both the home-manager configuration and other packages.

This additionally modifies `./pkgs/default.nix` to take a single argument, `pkgs`.
2024-10-07 20:38:59 -05:00
3 changed files with 43 additions and 55 deletions

18
flake.lock generated
View file

@ -55,11 +55,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727383923, "lastModified": 1728337164,
"narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=", "narHash": "sha256-VdRTjJFyq4Q9U7Z/UoC2Q5jK8vSo6E86lHc2OanXtvc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ffe2d07e771580a005e675108212597e5b367d2d", "rev": "038630363e7de57c36c417fd2f5d7c14773403e4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -90,11 +90,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727707210, "lastModified": 1727999297,
"narHash": "sha256-8XZp5XO2FC6INZEZ2WlwErtvFVpl45ACn8CJ2hfTA0Y=", "narHash": "sha256-LTJuQPCsSItZ/8TieFeP30iY+uaLoD0mT0tAj1gLeyQ=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "f61d5f2051a387a15817007220e9fb3bbead57b3", "rev": "8c8388ade72e58efdeae71b4cbb79e872c23a56b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -105,11 +105,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1727634051, "lastModified": 1728018373,
"narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", "rev": "bc947f541ae55e999ffdb4013441347d83b00feb",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -37,26 +37,29 @@
modules = [ modules = [
./home/home.nix ./home/home.nix
]; ];
pkgs = nixpkgs.legacyPackages.${system}.extend (import ./pkgs/default.nix); pkgs = nixpkgs.legacyPackages.${system}.extend (self.overlays.default);
extraSpecialArgs = specialArgs; extraSpecialArgs = specialArgs;
}; };
in in
{ {
# There's a few things going on here that are all merged in the end. # First, we provide a generalized package overlay, providing several packages
# We start with a generalized package overlay, providing several packages
# for e.g. nix-darwin, NixOS, and home-manager usage. # for e.g. nix-darwin, NixOS, and home-manager usage.
overlays.default = (import ./pkgs/default.nix); # ./pkgs/default.nix's singular argument, `pkgs`, is provided by our `final`.
overlays.default = (final: prev: import ./pkgs/default.nix {
pkgs = final;
});
# Secondly, we create system-specific home-manager configurations. # Next, we provide Linux-specific home-manager configurations,
# and expose our default packages to the world.
packages = packages =
let
########################## ##########################
# Linux-specific options # # Linux-specific options #
########################## ##########################
linuxSystems linuxConfiguration = linuxSystems (system: {
(system: {
homeConfigurations = { homeConfigurations = {
# First, we currently assume that Linux devices # We currently assume that Linux devices only require
# only require dotfiles and utilize the username `spotlight`. # 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 {
@ -73,37 +76,23 @@
}; };
}; };
}; };
})
//
###########################
# Darwin-specific options #
###########################
darwinSystems (system: {
# We use the username `spot` under Darwin.
# We also assume that desktop applications should be made available, alongside GPG.
homeConfigurations.spot = homeManager {
system = system;
specialArgs = {
desktop = true;
gpg = true;
};
};
}); });
# // # For all platforms, export our packages for CI to build.
exportedPackages = allSystems (system: import ./pkgs/default.nix {
pkgs = nixpkgs.legacyPackages.${system};
});
# We must use recursiveUpdate in order to go deeper beyond one level.
# For example, `linuxConfiguration` provides `packages.x86_64-linux.homeConfiguration`
# and `exportedPackages` provides `packages.x86_64-linux.<package name>`.
# #
# #################### # With the normal `//` syntax, `packages.x86_64-linux` is not recursively merged,
# # Generic packages # # and either packages or the home-manager configuration end up being replaced.
# #################### # This is not ideal :(
# # We'll export some of our overlay's packages for CI to build. recursiveUpdate = nixpkgs.lib.recursiveUpdate;
# allSystems (system: { in
# packages = { recursiveUpdate linuxConfiguration exportedPackages;
# swiftformat = import ./pkgs/swiftformat.nix;
# monaco-powerline = import ./monaco-powerline/default.nix;
# };
# });
# We provide a NixOS module for easy usage within other system flakes. # We provide a NixOS module for easy usage within other system flakes.
# (Again, we assume a default name of `spotlight` under Linux.) # (Again, we assume a default name of `spotlight` under Linux.)

View file

@ -1,6 +1,5 @@
self: super: { pkgs, ... }: {
{ ipsw = pkgs.callPackage ./ipsw.nix { };
ipsw = super.callPackage ./ipsw.nix { }; monaco-powerline = pkgs.callPackage ./monaco-powerline/default.nix { };
monaco-powerline = super.callPackage ./monaco-powerline/default.nix { }; swiftformat = pkgs.callPackage ./swiftformat.nix { };
swiftformat = super.callPackage ./swiftformat.nix { };
} }