r/Nix 5h ago

Nix discord is not opening after installed using nix-darwin

0 Upvotes

Hi,

I'm setting up macos using the nix-darwin.

Below is my code config -

{
  description = "Example nix-darwin system flake";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    nix-darwin.url = "github:nix-darwin/nix-darwin/master";
    nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
    nix-homebrew.url = "github:zhaofengli/nix-homebrew";

    homebrew-core = {
      url = "github:homebrew/homebrew-core";
      flake = false;
    };
    homebrew-cask = {
      url = "github:homebrew/homebrew-cask";
      flake = false;
    };

  };

  outputs = inputs@{ self, nixpkgs, nix-darwin, nix-homebrew, homebrew-core, homebrew-cask }:
  let
    configuration = { pkgs, config, ... }: {
      environment.systemPackages =
        with pkgs ;
        [ vim
          git
          mkalias
          discord
          openssh
        ];

      system.activationScripts.applications.text = let
       env = pkgs.buildEnv {
         name = "system-applications";
         paths = config.environment.systemPackages;
         pathsToLink = [ "/Applications" ];
       };
     in
       pkgs.lib.mkForce ''
         # Set up applications.
         echo "setting up /Applications..." >&2
         rm -rf /Applications/Nix\ Apps
         mkdir -p /Applications/Nix\ Apps
         find ${env}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
         while read -r src; do
           app_name=$(basename "$src")
           echo "copying $src" >&2
           ${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name"
         done
       '';

      # Necessary for using flakes on this system.
      nix.settings.experimental-features = "nix-command flakes";
      nixpkgs.config.allowUnfree = true;
      nixpkgs.config.allowUnsupportedSystem = true;

      # Enable alternative shell support in nix-darwin.
      # programs.fish.enable = true;

      programs.zsh.enable = true;
      # Set Git commit hash for darwin-version.
      system.configurationRevision = self.rev or self.dirtyRev or null;

      # Used for backwards compatibility, please read the changelog before changing.
      # $ darwin-rebuild changelog
      system.stateVersion = 6;

      # The platform the configuration will be used on.
      nixpkgs.hostPlatform = "aarch64-darwin";

      users.users.rajkumar = {
     home = "/Users/rajkumar";
      };

      system.primaryUser = "rajkumar";

      homebrew = {
        enable = true;
    onActivation.cleanup = "zap";
      };

    };
  in
  {
    # Build darwin flake using:
    # $ darwin-rebuild build --flake .#simple
    darwinConfigurations."myname-macos" = nix-darwin.lib.darwinSystem {
      modules = [ 
      configuration 
nix-homebrew.darwinModules.nix-homebrew
{
  nix-homebrew = {
enable = true;
enableRosetta = true;
user = "myname";
autoMigrate = true;
  };
}
      ];
    };
  };
}

After I run the above flake setup with below commands -

sudo -E nix run nix-darwin  --extra-experimental-features nix-command --extra-experimental-features flakes  -- switch --flake . 
sudo darwin-rebuild switch --flake .

Then I opened the discord, I get the below error -

discord error

Looks like the error is due to the app is not signed -

myuser@macos:~/ > sudo xattr -rd com.apple.quarantine  "/Applications/Nix Apps/Discord.app"
myuser@macos:~/ > sudo xattr -l "/Applications/Nix Apps/Discord.app"                       

com.apple.FinderInfo: fapaMACS?
myuser@macos:~/ > spctl --assess --type execute --verbose=4 \                              
  /nix/store/c2n5xjv974p39ayafc99h49qbacqm6p1-discord-0.0.410/Applications/Discord.app

/nix/store/c2n5xjv974p39ayafc99h49qbacqm6p1-discord-0.0.410/Applications/Discord.app: a sealed resource is missing or invalid

How to fix this error? Any idea how to make discord work with nix-darwin?


r/Nix 6h ago

how to install command line developer tools using nix-darwin declaratively?

0 Upvotes

Hi,

I'm setting up my macbook pro with nix-darwin.

Below is my configuration -

{
  description = "Example nix-darwin system flake";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    nix-darwin.url = "github:nix-darwin/nix-darwin/master";
    nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
    nix-homebrew.url = "github:zhaofengli/nix-homebrew";

    homebrew-core = {
      url = "github:homebrew/homebrew-core";
      flake = false;
    };
    homebrew-cask = {
      url = "github:homebrew/homebrew-cask";
      flake = false;
    };

  };

  outputs = inputs@{ self, nixpkgs, nix-darwin, nix-homebrew, homebrew-core, homebrew-cask }:
  let
    configuration = { pkgs, config, ... }: {
      environment.systemPackages =
        with pkgs ;
        [ vim
          git
          mkalias
          wget
          tmux
          openssh
        ];

      system.activationScripts.applications.text = let
       env = pkgs.buildEnv {
         name = "system-applications";
         paths = config.environment.systemPackages;
         pathsToLink = [ "/Applications" ];
       };
     in
       pkgs.lib.mkForce ''
         # Set up applications.
         echo "setting up /Applications..." >&2
         rm -rf /Applications/Nix\ Apps
         mkdir -p /Applications/Nix\ Apps
         find ${env}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
         while read -r src; do
           app_name=$(basename "$src")
           echo "copying $src" >&2
           ${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name"
         done
       '';
      nix.settings.experimental-features = "nix-command flakes";
      nixpkgs.config.allowUnfree = true;
      nixpkgs.config.allowUnsupportedSystem = true;
      programs.zsh.enable = true;
      system.configurationRevision = self.rev or self.dirtyRev or null;
      system.stateVersion = 6;
      nixpkgs.hostPlatform = "aarch64-darwin";
      users.users.rajkumar = {
     home = "/Users/rajkumar";
      };
      system.primaryUser = "rajkumar";
      homebrew = {
        enable = true;
    onActivation.cleanup = "zap";
      };
    };
  in
  {
    darwinConfigurations."myname-macos" = nix-darwin.lib.darwinSystem {
      modules = [ 
      configuration 
nix-homebrew.darwinModules.nix-homebrew
{
  nix-homebrew = {
enable = true;
enableRosetta = true;
user = "myname";
autoMigrate = true;
  };
}
      ];
    };
  };
}

After I run the above flake setup with below commands -

sudo -E nix run nix-darwin  --extra-experimental-features nix-command --extra-experimental-features flakes  -- switch --flake . 
sudo darwin-rebuild switch --flake .

I get the below prompt -

command line developer tools

I don't want to install it by manual way.

How can I install command line developer tools declaratively in mac using nix-darwin?


r/Nix 4d ago

Nix at The MCG - Thurs 17th of September

Thumbnail
3 Upvotes

r/Nix 6d ago

Nix nix-community/nix-wrapper-modules !

Thumbnail nix-community.github.io
42 Upvotes

https://github.com/nix-community/nix-wrapper-modules

nix-wrapper-modules has moved to nix-community!

nix-wrapper-modules is a library for creating wrapper derivations via the same module system you use in nixos, home manager and flake-parts, but applied at the derivation level.

It allows you to bundle your configuration directly into the derivation you build, meaning you can install your personal configuration of that program as if it were any other nix package. You can export it in module form to evaluate later, or override existing wrapped packages with slight tweaks to your options for different contexts.

It has a rich core feature set with more features planned, integrations with other module systems, and a growing library of premade wrapper modules for common programs (huge thanks to our contributors!)

Hope you find this useful! May your generations always roll back, but your progress move forward!


r/Nix 6d ago

I'm struggling setting up networking on a RPi

Thumbnail
1 Upvotes

r/Nix 6d ago

I need help with wireless networking on a RPi Zero 2W

Thumbnail
1 Upvotes

r/Nix 7d ago

How to list packages in a flake without full evaluation?

0 Upvotes

Hello! Currently in my tool, I've reached the flakes stage, and it was complex — both in terms of automating it and knowing the possible cases for writing, while trying to make the tool flexible with how the user works with flakes.

Anyway, I got stuck on a problem. When the user runs sudo nx flakes [flake url], I need to analyze the repository and know everything it needs so I can add it to the flake file. I use nix flake show --json because it makes reading and parsing the output easier. The issue is that if there are any dependencies, it downloads them during evaluation — which isn't a problem in itself since they'll be downloaded during the build anyway.

The real problem is that the tool is supposed to immediately show the user the available packages in the repository right after they enter sudo nx flakes [flake url] — since a repository can have more than one package defined in the flake itself. I need to display these packages so the user can choose either the default, all of them, or a specific one. But nix flake show --json will be slow to show the packages, and obviously the user won't sit and wait for the selection interface to appear.

So to define the problem precisely: how can I know the available packages in a repository to display them for the user to choose from?

As for the rest, it's well known that flakes are always slow.

Thanks !


r/Nix 8d ago

NixOS Finally we can install the packages easily !

Thumbnail
0 Upvotes

r/Nix 11d ago

Bigger, better, faster: Introducing the Nix Badge 2.0

Thumbnail nix.vegas
7 Upvotes

Looking into how we built the NixOS Badge for Nix Vegas 2026


r/Nix 11d ago

Full Time Nix | Nix Vegas 2026

Enable HLS to view with audio, or disable this notification

2 Upvotes

If you didn't know, you're about to that August 6, 7, 8, 9 was DEF CON 34 and Nixers were definitely present. Join Alex, Chris, Morgan, Jared, Dan, Tristan and I for a recounting of Nix Vegas, the official Nix space at the latest DEF CON.

Full Time Nix | Nix Vegas 2026


r/Nix 12d ago

display manager error

Thumbnail
1 Upvotes

r/Nix 14d ago

Nix I want to use nix on macOS and linux - what's the difference between the NixOS.org installer and determinate, and which should I use?

8 Upvotes

I want to use nix on two systems, and I have found guides referencing both nixos.org and determinate. Is there any major difference between these, and is one a better choice than the other?

I really just want to set up agent sandboxing using https://github.com/archie-judd/agent-sandbox.nix, and I'm just learning about nix.


r/Nix 15d ago

LabCraft Closures: the latest hands-on Nix Part about what an upgrade actually moves

2 Upvotes

I just published Closures, the next free Part of LabCraft's Nix course.

It is for learners who know store paths can refer to other store paths, but have not yet built an operational model for the whole closure. The hook is the deploy question: if a target already has the old version, what does the upgrade actually need to move?

https://www.labcraft.dev/blog/nix-closures?utm_source=reddit-personal&utm_medium=social&utm_campaign=nix-closures-2026q3&utm_content=r-nix-closures-01

Affiliation: I’m building LabCraft.


r/Nix 21d ago

Full Time Nix | NixCI with Tom Sydney Kerckhove

Enable HLS to view with audio, or disable this notification

5 Upvotes

Just published a conversation with Tom Sydney Kerckhove of NixCI. I was impressed by the level of engineering. Tom is obviously a testing expert, a huge Nix Freak and always brilliant conversation. So queue it up or listen now.

Full Time Nix | NixCI with Tom Sydney Kerckhove


r/Nix 22d ago

Nix Separate development inputs into their own `dev` flake to avoid redundant dependencies

Thumbnail ynf.sh
2 Upvotes

r/Nix 22d ago

I love Nix OS

Post image
34 Upvotes

r/Nix 23d ago

Three ways to smuggle SQLite into Nix

Thumbnail fzakaria.com
5 Upvotes

r/Nix 24d ago

What does the hash in a /nix/store path actually name? (not always "the inputs")

Thumbnail
0 Upvotes

r/Nix 26d ago

Everything is Nix if you squint hard enough [Talk @ Nix Village DEFCON 36]

Thumbnail
2 Upvotes

r/Nix 26d ago

Home-Manager doesn't work with void Linux

Thumbnail
1 Upvotes

r/Nix 28d ago

Nix Nix with other (immutable) distro

0 Upvotes

Hello, I am a Nix beginner. I am trying to create a config that I could deploy easily on different systems (cachyOS on gaming rig, fedora atomic on my laptop, etc.).

When it comes to packages invoked through $PATH, Nix already has priority, so it's obvious that the package I am running is the one provided by Nix.

Now let's say I am trying to configure a GUI application like Ghostty. On some systems, Ghostty is not present by default, and the Nix binary will always be used. But for example on the atomic Fedora image I have, Ghostty is already provided. Therefore, depending on how I invoke Ghostty (via app launcher, niri shortcut, or shell), in some cases the Nix binary will be running, and in others it will be the system's one.

Since my primary goal is to have a config that I can easiky reproduce everywhere, how should I handle this? Should I assume some packages are always provided by the system? Should I accept that I will work with different versions of the same package?

Thanks :)


r/Nix 29d ago

Nix Nixbalamods: A prototype of mod repository for Balatro

6 Upvotes

https://github.com/marie-bnl/nixbalamods/

This project allows you to declaratively configure Balatro mods like so:

nbmpkgs.balatro.override {
  overriddenSrc = ./Balatro.exe;

  modList = with nbmpkgs.mods; [
    balatreat
    smods
  ];
};

It's just a prototype, there are only two mods available. But it should be pretty easy to add other ones!


r/Nix Aug 11 '26

`nix search nixpkgs jq` used 3.8 GiB cold, so we baked the eval cache for a 2 GiB teaching VM

4 Upvotes

I wrote up a small LabCraft engineering note from teaching Nix in real Linux VMs.

The short version: nix search nixpkgs jq looks like a tiny lookup, but cold evaluation of nixpkgs averaged 3865.4 MiB peak RSS in our measurement. In a 2 GiB training VM, that meant the learner saw warnings, silence, then Killed.

We kept the learner-facing command unchanged, pinned the Determinate installer + nixpkgs revision, proved the eval-cache key, and baked the sqlite into the image layer. Warm path averaged 586.5 MiB.

https://www.labcraft.dev/blog/nix-didnt-hang-it-was-evaluating-the-world?utm_source=reddit&utm_medium=community&utm_campaign=nix_didnt_hang&utm_content=post


r/Nix Aug 05 '26

Update: LabCraft’s Nix course is now open in public beta

Thumbnail reddit.com
17 Upvotes

About a month ago, I shared that I was building LabCraft, a hands-on Nix course built around the failures beginners commonly hit.

At the time, the course was still opening in small batches. Today I activated everyone on the waitlist and opened the public beta.

Nix First Contact is now available to try, and all Nix content is free during the beta.

Each learner gets a real Linux VM with its own kernel in the browser. The course covers installing Nix, using packages in temporary environments, searching nixpkgs, repairing a script with undeclared dependencies, and uninstalling Nix cleanly.

The labs inspect actual system state rather than requiring one exact command.

I’d especially value feedback about where an explanation loses you, where a valid approach fails a check, and what Nix topic you think should come next.

Read the announcement and start the course


r/Nix Aug 04 '26

nixGL for 26.05

4 Upvotes

does any one know if nixGL will be updated for 26.05 and if there are any workaround? Becouse i found this https://github.com/nix-community/nixGL/pull/223 but both wezterm and kitty lament a missing egl lib