Thanks @VTimofeenko, that makes sense, but I’m failing to fix this as I don’t know how to replace the hmunstable
that is for pkgs
as you say (the one you’ll see above it in the configs below - that I copied from - was used for pkgs.unstable.mise
, which I have working in home.nix
but want to replace with a module so I can declare versions of languages etc).
When I try your solution (ignoring replacing hmunstable
, I get:
error: The option `programs.rtx.enable' can no longer be used since it's been removed. The `rtx` package has been replaced by `mise`, please switch over to
using the options under `programs.mise.*` instead.
This is encouraging but the problem is, I am not refering to rtx anywhere in my configs. I previously did, but as the error says, mise is the new rtx.
Sidenote: Although everything works in my nix-darwin flake.nix
> home manager home.nix
setup (except the issue of this post), the only issue I’ve found so far is that there’s no Home Manager apps directory in /Applications
or outside of /nix/store
, which could be a sign I’ve stuffed something up. /Applications/Nix Apps
exists, but is empty as I guess it’s only for nix-darwin installed modules, and I only have zsh installed that way. This could simply be a terminal permissions issue as I misclicked a terminal permission dialog when setting up the mac. Once I have this post’s issue fixed, I can look at doing a reset of macOS and reinstall of nix and my configs and hopefully everything will be fine. But if I’ve done something wrong (as you pointed out re my use of hmunstable
), please correct me, and perhaps my configs will be fixed overall.
Here are all my paths and nix-darwin and home manager configs below:
~/.config/nix-darwin/flake.nix
~/.config/nix-darwin/nixpkgs/home.nix (home manager)
~/.config/nix-darwn/nixpkgs/pkgs-home-manager/modules-macos-active/
eg ~/.config/nix-darwn/nixpkgs/pkgs-home-manager/modules-macos-active/cli/mise/mise.nix
eg ~/.config/nix-darwn/nixpkgs/pkgs-home-manager/modules-macos-active/gui/firefox/firefox.nix
pkgs-home-manager
and subdiretories are just for my organisational convenience and future admin by someone else for installing .nix
home manager modules, and I’ll have a parallel directory pkgs-nix-darwin
if I install any via it. I have zsh installed via it currently, but soon that will be moved to home manager with its own config.
flake.nix
(nix-darwin)
{
description = "xxxx nix-darwin flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-23.11-darwin";
nixpkgs-unstable.url = "github:NixOs/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager-unstable.url = "github:nix-community/home-manager";
# I add the below to copy the stable version above - not sure if necessary:
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nur.url = "github:nix-community/NUR";
# For umport:
nypkgs.url = "github:yunfachi/nypkgs";
nypkgs.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager-unstable, nix-darwin, nur, home-manager, nypkgs, nix-homebrew, homebrew-core, homebrew-cask, ... }:
let
unstableOverlay = final: prev: {
unstable = import nixpkgs-unstable {
system = "aarch64-darwin";
};
};
hmunstableOverlay = final: prev: {
hmunstable = import home-manager-unstable {
system = "aarch64-darwin";
};
};
# For umport:
ylib = nypkgs.lib.aarch64-darwin;
configuration = { pkgs, ... }: {
environment.systemPackages = [ ];
services.nix-daemon.enable = true;
nix = {
extraOptions = ''
extra-platforms = x86_64-darwin aarch64-darwin
'';
linux-builder = {
enable = true;
ephemeral = true;
maxJobs = 4;
config = {
virtualisation = {
darwin-builder = {
diskSize = 40 * 1024;
memorySize = 8 * 1024;
};
cores = 4;
};
};
# nix.package = pkgs.nix;
};
settings = {
experimental-features = "nix-command flakes";
# Necessary for using flakes on this system.
trusted-users = [ "xxxx" ];
# Necessary for linux-builder.
};
};
programs.zsh.enable = true; # default shell on catalina
# Create /etc/zshrc that loads the nix-darwin environment.
system = {
configurationRevision = self.rev or self.dirtyRev or null;
# Set Git commit hash for darwin-version.
stateVersion = 4;
# Used for backwards compatibility, please read the changelog before changing:`$ darwin-rebuild changelog`
};
nixpkgs = {
hostPlatform = "aarch64-darwin";
# The platform the configuration will be used on.
config = { allowUnfree = true; };
# Allow unfree software to be installed by Nix.
overlays = [
nur.overlay
# For Firefox.
unstableOverlay
# For nixpkgs-unstable.
hmunstableOverlay
];
};
imports = [ ./options-nix-darwin/options-nix-darwin.nix ];
# eg settings to change dock location etc.
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
cleanup = "zap";
upgrade = false;
};
global.autoUpdate = false;
brews = [ ];
caskArgs.no_quarantine = true;
casks = [ "amethyst" "firefox" ];
};
}; # /configuration
in
{
darwinConfigurations."myhostname" = nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs; inherit ylib; };
modules = [
configuration
home-manager.darwinModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.xxxx = import ./nixpkgs/home.nix;
extraSpecialArgs = { inherit inputs ylib; };
};
users.users.xxxx.home = "/Users/xxxx";
}
nix-homebrew.darwinModules.nix-homebrew {
nix-homebrew = {
enable = true;
enableRosetta = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
user = "xxxx";
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
"homebrew/homebrew-bundle" = inputs.homebrew-bundle;
};
mutableTaps = false;
# Optional: Declarative tap management. If disabled, taps can't be added imperatively via `brew tap`.
};
}
];
}; # /darwinConfigurations
darwinPackages = self.darwinConfigurations."myhostname".pkgs;
# Expose the package set, including overlays, for convenience.
};
}
home.nix
(home manager)
{ pkgs, inputs, ylib, ... }:
let
unstable = import inputs.nixpkgs-unstable {
system = pkgs.system;
# Uncomment this if you need an unfree package from unstable.
#config.allowUnfree = true;
};
hmunstable = import inputs.home-manager-unstable {
system = pkgs.system;
# Uncomment this if you need an unfree package from unstable.
#config.allowUnfree = true;
};
in
{
home = {
enableNixpkgsReleaseCheck = true;
stateVersion = "23.11";
packages = with pkgs; [
#pkgs.unstable.mise
bandwhich
curl
curlie
...
lunarvim
];
};
editorconfig = {
enable = false;
settings = {
"*" = {
charset = "utf-8";
end_of_line = "lf";
trim_trailing_whitespace = true;
insert_final_newline = true;
max_line_width = 78;
indent_style = "space";
indent_size = 2;
};
};
};
fonts.fontconfig.enable = true;
manual = {
html.enable = true;
json.enable = true;
manpages.enable = true;
};
programs.home-manager.enable = true;
programs.home-manager.path = "$HOME/.config/nix-darwin/nixpkgs/";
imports = (ylib.umport {
paths = [./pkgs-home-manager/modules-macos-active ./options-home-manager];
exclude = [./pkgs-home-manager/modules-macos-active/cli/mise/mise.nix ./pkgs-home-manager/modules-macos-active/cli/git/gitignore-global.nix ./pkgs-home-manager/modules-macos-active/gui/firefox/firefox-bookmarks.nix];
recursive = true;
})
++
[ (inputs.home-manager-unstable + "modules-macos-active/cli/mise/mise.nix") ]
;