Code Monkey home page Code Monkey logo

nixos-config's Introduction

Nix Config for macOS + NixOS

Build Starter Template Statix Lint

Overview

Hey, you made it! Welcome. 🤓

Nix is a powerful package manager for Linux and Unix systems that ensures reproducible, declarative, and reliable software management.

This repository contains configuration for a general-purpose development environment that runs Nix on macOS, NixOS, or both simultaneously.

I use it daily on my 🧑🏻‍💻 M1 Macbook Pro and an x86 PC in my home office. It also runs as a VM on your Mac. Many others have reported that it's working for them too.

Check out the step-by-step commands below to get started!

Table of Contents

Layout

.
├── apps         # Nix commands used to bootstrap and build configuration
├── hosts        # Host-specific configuration
├── modules      # macOS and nix-darwin, NixOS, and shared configuration
├── overlays     # Drop an overlay file in this dir, and it runs. So far, mainly patches.
├── templates    # Starter versions of this configuration

Features

  • Nix Flakes: 100% flake driven, no configuration.nix, no Nix channels─ just flake.nix
  • Same Environment Everywhere: Easily share config across Linux and macOS (both Nix and Home Manager)
  • macOS Dream Setup: Fully declarative macOS (Apple and Intel) w/ UI, dock and macOS App Store apps
  • Simple Bootstrap: Simple Nix commands to start from zero, both x86 and macOS platforms
  • Managed Homebrew: Zero maintenance homebrew environment with nix-darwin and nix-homebrew
  • Disk Management: Declarative disk management with disko, say goodbye to disk utils
  • Secrets Management: Declarative secrets with agenix for SSH, PGP, syncthing, and other tools
  • Super Fast Emacs: Bleeding edge Emacs that fixes itself, thanks to a community overlay
  • Built In Home Manager: home-manager module for seamless configuration (no extra clunky CLI steps)
  • NixOS Environment: Extensively configured NixOS including clean aesthetic + window animations
  • Nix Overlays: Auto-loading of Nix overlays: drop a file in a dir and it runs (great for patches!)
  • Declarative Sync: No-fuss Syncthing: managed keys, certs, and configuration across all platforms
  • Emacs Literate Configuration: Large Emacs literate configuration to explore (if that's your thing)
  • Simplicity and Readability: Optimized for simplicity and readability in all cases, not small files everywhere
  • Backed by Continuous Integration: Flake auto updates weekly if changes don't break starter build

Disclaimer

Installing Nix on macOS will create an entirely separate volume. It will exceed many gigabytes in size.

Some folks don't like this. If this is you, turn back now!

Note

Don't worry, you can always uninstall Nix later.

Videos

macOS

Updating dependencies with one command

Build.mov

Instant Emacs 29 thanks to daemon mode

  • GUI
Emacs.mov
  • Terminal
Emacs_Terminal.mov

NixOS

NixOS.mp4

Installing

Important

Note: Nix 2.18 currently has a bug that impacts this repository.

For now, if you run into errors like this:

error: path '/nix/store/52k8rqihijagzc2lkv17f4lw9kmh4ki6-gnugrep-3.11-info' is not valid

Run nix copy to make the path valid.

nix copy --from https://cache.nixos.org /nix/store/52k8rqihijagzc2lkv17f4lw9kmh4ki6-gnugrep-3.11-info

For macOS (April 2024)

This configuration supports both Intel and Apple Silicon Macs.

1. Install dependencies

xcode-select --install

2. Install Nix

Thank you for the installer, Determinate Systems!

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Important

If using the official installation instructions instead, flakes and nix-command aren't available by default.

You'll need to enable them.

Add this line to your /etc/nix/nix.conf file

experimental-features = nix-command flakes

OR

Specify experimental features when using nix run below

nix --extra-experimental-features 'nix-command flakes' run .#<command>

3. Initialize a starter template

Choose one of two options

Simplified version without secrets management

  • Great for beginners, enables you to get started quickly and test out Nix.
  • Forgoing secrets just means you must configure apps that depend on keys, passwords, etc., yourself.
  • You can always add secrets later.
mkdir -p nixos-config && cd nixos-config && nix flake --extra-experimental-features 'nix-command flakes' init -t github:dustinlyons/nixos-config#starter

Full version with secrets management

  • Choose this to add more moving parts for a 100% declarative configuration.
  • This template offers you a place to keep passwords, private keys, etc. as part of your configuration.
mkdir -p nixos-config && cd nixos-config && nix flake --extra-experimental-features 'nix-command flakes' init -t github:dustinlyons/nixos-config#starter-with-secrets

4. Make apps executable

find apps/$(uname -m | sed 's/arm64/aarch64/')-darwin -type f \( -name apply -o -name build -o -name build-switch -o -name create-keys -o -name copy-keys -o -name check-keys \) -exec chmod +x {} \;

5. Apply your current user info

Run this Nix command to replace stub values with your system properties, username, full name, and email.

Email is only used in the git configuration.

nix run .#apply

Note

If you're using a git repository, only files in the working tree will be copied to the Nix Store.

You must run git add . first.

6. Decide what packages to install

You can search for packages on the official NixOS website.

Review these files

7. Review your shell configuration

Add anything from your existing ~/.zshrc, or just review the new configuration.

Review these files

8. Optional: Setup secrets

If you are using the starter with secrets, there are a few additional steps.

8a. Create a private Github repo to hold your secrets

In Github, create a private nix-secrets repository with at least one file (like a README). You'll enter this name during installation.

8b. Install keys

Before generating your first build, these keys must exist in your ~/.ssh directory. Don't worry, I provide a few commands to help you.

Key Name Platform Description
id_ed25519 macOS / NixOS Used to download secrets from Github.
id_ed25519_agenix macOS / NixOS Used to encrypt and decrypt secrets.

Run one of these commands:

Copy keys from USB drive

This command auto-detects a USB drive connected to the current system.

Keys must be named id_ed25519 and id_ed25519_agenix.

nix run .#copy-keys
Create new keys
nix run .#create-keys

Note

If you choose this option, make sure to save the value of id_ed25519.pub to Github.

cat /Users/$USER/.ssh/id_ed25519.pub | pbcopy # Copy key to clipboard
Check existing keys

If you're rolling your own, just check they are installed correctly.

nix run .#check-keys

9. Install configuration

Ensure the build works before deploying the configuration, run:

nix run .#build

Note

If you're using a git repository, only files in the working tree will be copied to the Nix Store.

You must run git add . first.

Warning

You may encounter error: Unexpected files in /etc, aborting activation if nix-darwin detects it will overwrite an existing /etc/ file. The error will list the files like this:

The following files have unrecognized content and would be overwritten:

  /etc/nix/nix.conf
  /etc/bashrc

Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.

Backup and move the files out of the way and/or edit your Nix configuration before continuing.

10. Make changes

Finally, alter your system with this command:

nix run .#build-switch

Caution

~/.zshrc will be replaced with the zsh configuration from this repository. Make sure this is what you want.

For NixOS

This configuration supports both x86_64 and aarch64 platforms.

1. Burn and use the latest ISO

Download and burn the minimal ISO image to a USB, or create a new VM with the ISO as base. Boot the installer.

If you're building a VM on an Apple Silicon Mac, choose 64-bit ARM.

Quick Links

2. Optional: Setup secrets

If you are using the starter with secrets, there are a few additional steps.

2a. Create a private Github repo to hold your secrets

In Github, create a private nix-secrets repository with at least one file (like a README). You'll enter this name during installation.

2b. Install keys

Before generating your first build, these keys must exist in your ~/.ssh directory. Don't worry, I provide a few commands to help you.

Key Name Platform Description
id_ed25519 macOS / NixOS Used to download secrets from Github.
id_ed25519_agenix macOS / NixOS Used to encrypt and decrypt secrets.

Run one of these commands:

Copy keys from USB drive

This command auto-detects a USB drive connected to the current system.

Keys must be named id_ed25519 and id_ed25519_agenix.

sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#copy-keys
Create new keys
sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#create-keys
Check existing keys

If you're rolling your own, just check they are installed correctly.

sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#check-keys

3. Install configuration

Pick your template

Important

For Nvidia cards, select the second option, nomodeset, when booting the installer, or you will see a blank screen.

Caution

Running this will reformat your drive to the ext4 filesystem.

Simple

  • Great for beginners, enables you to get started quickly and test out Nix.
  • Forgoing secrets means you must configure apps that depend on keys or passwords yourself.
  • You can always add secrets later.
sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install

With secrets

  • Choose this to add more moving parts for a 100% declarative configuration.
  • This template offers you a place to keep passwords, private keys, etc. as part of your configuration.
sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install-with-secrets

4. Set user password

On first boot at the login screen:

  • Use the shortcut Ctrl-Alt-F2 (or Fn-Ctrl-Option-F2 if on a Mac) to move to a terminal session
  • Login as root using the password created during installation
  • Set the user password with passwd <user>
  • Go back to the login screen: Ctrl-Alt-F7

How to create secrets

To create a new secret secret.age, first create a secrets.nix file at the root of your nix-secrets repository. Use this code:

Note

secrets.nix is interpreted by the imperative agenix commands to pick the "right" keys for your secrets.

Think of this file as the config file for agenix. It's not part of your system configuration.

secrets.nix

let
  user1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL0idNvgGiucWgup/mP78zyC23uFjYq0evcWdjGQUaBH";
  users = [ user1 ];

  system1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPJDyIr/FSz1cJdcoW69R+NrWzwGK/+3gJpqD1t8L2zE";
  systems = [ system1 ];
in
{
  "secret.age".publicKeys = [ user1 system1 ];
}

Values for user1 should be your public key, or if you prefer to have keys attached to hosts, use the system1 declaration.

Now that we've configured agenix with our secrets.nix, it's time to create our first secret.

Run the command below.

EDITOR=vim nix run github:ryantm/agenix -- -e secret.age

This opens an editor to accept, encrypt, and write your secret to disk.

The command will look up the public key for secret.age, defined in your secrets.nix, and check for its private key in ~/.ssh/.

To override the SSH path, provide the -i flag with a path to your id_ed25519 key.

Write your secret in the editor, save, and commit the file to your nix-secrets repo.

Now we have two files: secrets.nix and our secret.age.

Here's a more step-by-step example:

Secrets Example

Let's say I wanted to create a new secret to hold my Github SSH key.

I would cd into my nix-secrets repo directory, verify the agenix configuration (named secrets.nix) exists, then run

EDITOR=vim nix run github:ryantm/agenix -- -e github-ssh-key.age

This would start a vim session.

I would enter insert mode :i, copy+paste the key, hit Esc and then type :w to save it, resulting in the creation of a new file, github-ssh-key.age.

Then, I would edit secrets.nix to include a line specifying the public key to use for my new secret. I specify a user key, but I could just as easily specify a host key.

secrets.nix

let
  dustin = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL0idNvgGiucWgup/mP78zyC23uFjYq0evcWdjGQUaBH";
  users = [ dustin ];
  systems = [ ];
in
{
  "github-ssh-key.age".publicKeys = [ dustin ];
}

Finally, I'd commit all changes to the nix-secrets repository, go back to my nixos-config and run nix flake update to update the lock file.

The secret is now ready to use. Here's an example from my configuration. In the end, this creates a symlink to a decrypted file in the Nix Store that reflects my original file.

Deploying changes to your system

With Nix, changes to your system are made by

For all platforms

nix run .#build-switch

Update dependencies

nix flake update

Compatibility and Feedback

Platforms

This configuration has been tested and confirmed to work on the following platforms:

  • Newer M1/M2/M3 Apple Silicon Macs
  • Older x86_64 (Intel) Macs
  • Bare metal x86_64 PCs
  • NixOS VMs inside VMWare on macOS
  • macOS Sonoma VMs inside Parallels on macOS

Feedback and Questions

Have feedback or questions? Feel free to use the discussion forum.

Contributing

Interested in contributing to this project? Here's how you can help:

  • Code Contributions: If you're interested in contributing code, please start by looking at open issues or feature requests. Fork the repository, make your changes, and submit a pull request. Make sure your code adheres to the existing style. For significant changes, consider opening an issue for discussion before starting work.

  • Reporting Bugs: If you encounter bugs or issues, please help by reporting them. Open a GitHub Issue and include as much detail as possible: what you were doing when the bug occurred, steps to reproduce the issue, and any relevant logs or error messages.

Appendix

Why Nix Flakes

Reasons to jump into flakes and skip nix-env, Nix channels, etc

  • Flakes work just like other package managers you already know: npm, cargo, poetry, composer, etc. Channels work more like traditional Linux distributions (like Ubuntu), which most devs don't know.
  • Flakes encapsulate not just project dependencies, but Nix expressions, Nix apps, and other configurations in a single file. It's all there in a single file. This is nice.
  • Channels lock all packages to one big global nixpkgs version. Flakes lock each individual package to a version, which is more precise and makes it much easier to manage overall.
  • Flakes have a growing ecosystem (see Flake Hub or Dev Env), so you're future-proofing yourself.

NixOS Components

Component Description
Window Manager Xorg + bspwm
Terminal Emulator alacritty
Bar polybar
Application Launcher rofi
Notification Daemon dunst
Display Manager lightdm
File Manager thunar
Text Editor emacs daemon mode
Media Player cider
Image Viewer feh
Screenshot Software flameshot

License

This project is released under the BSD-3-Clause license.

Support

Buy me a coffee or follow me on Github.

Stars

"All we have to decide is what to do with the time that is given us." - J.R.R. Tolkien

Star History Chart

nixos-config's People

Contributors

dependabot[bot] avatar dustinlyons avatar execat avatar ismailbay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nixos-config's Issues

Add option to choose editor during install

Some users have asked to disable emacs and how to do that. We should ask the user what editor they want as part of install process: vim, nvim, or emacs

We can assume emacs should be daemon mode.

bin/build triggers error on fresh macOS install

Hi!

I tried the instructions in the README on a fresh install of macOS 13.5 on a 2022 M2 MacBook Air and ran into the following error:

% bin/build                
Requesting sudo to set homebrew tap permissions...
Starting build...
Switching to new generation...
building the system configuration...
setting up Homebrew (/opt/homebrew)...
Error: An existing /opt/homebrew/Library/Taps is in the way

Removing /opt/homebrew/Library/Taps (or even all of /opt/homebrew) seems to have no effect.

error: selector 'bash' matches no derivations

I am absolute noob with Nix.

I am following your tutorial. I am stuck at step 6

"6. Decide what packages to install"

Well, I decided to install Bash. I do nix-env -i bash, I get

error: selector 'bash' matches no derivations

What should I do? All the tutorials I can find always assume I understand Nix :D

installation not working when device is not named /dev/nvme*

My disk's name is sda but the installer doesn't recognize it

...
+ sgdisk --set-alignment=2048 --align-end --new=1:0:+100M --change-name=1:disk-vdb-ESP --typecode=1:EF00 /dev/nvme0n1
Problem opening /dev/nvme0n1 for reading! Error is 2.
The specified file does not exist!


Purpose of mail and name?

Another dumb noob question.

What is the purpose for asking name and email? Will that be used somewhere later?

Question [Help]

  1. I want to dual boot it with windows but it seems Running this will reformat my drive to the ext4 filesystem so what can I do about it ?
  2. What is "secrets" mentioned everywhere & what will installing the configuration with secrets will do?

dustinlyons/nix-secrets.git dependency

Hey Dustin!

I'm updating my config to the new apps/host/modules/overlays setup with secrets. Getting an error due to your private dependency dustinlyons/nix-secrets.git in flake.nix

nixos-config on  modular [$✘»!]
✦2 ❯ nix flake archive
warning: Git tree '/Users/olafur/dev/nixos-config' is dirty
no such identity: /Users/olafur/.ssh/id_github: No such file or directory
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
warning: could not read HEAD ref from repo at 'ssh://[email protected]/dustinlyons/nix-secrets.git', using 'master'
no such identity: /Users/olafur/.ssh/id_github: No such file or directory
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error:
       … while updating the lock file of flake 'git+file:///Users/olafur/dev/nixos-config'

       … while updating the flake input 'secrets'

       … while fetching the input 'git+ssh://[email protected]/dustinlyons/nix-secrets.git'

       error: program 'git' failed with exit code 128
    secrets = {
      url = "git+ssh://[email protected]/dustinlyons/nix-secrets.git";
      flake = false;
    };

I understand that it is a bit complicated, but I wonder if you could update the README.md? If I understand correctly I would have my own nix-secrets private repo or similar? Why not store the secrets directly in this config? Portability?

MacOS M2 - install issue

Hi 👋 Thanks for this excellent repository!

I wonder if you had any debugging advice for a nix-noob who is trying to set up nix on a fresh M2 MacBook Pro running Sonoma 14.1.1

I'm encountering an issue while running the build step of bin/build. To my eyes it looks like glibc isn't successfully building. It says the GNU C library is currently unavailable for this platform. I can see an entry for glibc on search.nixos.org (but, indeed, no darwin support). It gets through to the configuring phase

My question is: why do you think it is looking for glibc when doing a build on darwin? I've tried a few things (clean reinstall, adding gnugrep and glibc to list of packages, using NixOS/nixpkgs - main and unstable) but am a bit hampered by my Nix ignorance here. Do you have any suggestions for how to address this?

Starting build...
warning: Git tree '/Users/iggy/nixos-config' is dirty
error: builder for '/nix/store/d20vsmbkvs93qcdhlaliig2g4bz38lsw-glibc-nolibgcc-2.38-23.drv' failed with exit code 1;
       last 10 log lines:
[I've added in a few more log lines from nix log for extra context: 
...
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
configure flags: --disable-static --prefix=/nix/store/csvckbkqpbcq61kriv05prznm2ln1y1c-glibc-nolibgcc-2.38-23 --bindir=/nix/store/s4i9zfnjadh2qxgb1qsa8ri4j1gavr4i-glibc-nolibgcc-2.38-23-bin/bin --sbindir=/nix/store/s4i9zfnjadh2qxgb1qsa>
configure: creating cache config.cache
checking build system type... aarch64-apple-darwin23.1.0
checking host system type... aarch64-apple-darwin23.1.0
checking for gcc... gcc
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking whether g++ can link programs... no
checking for sysdeps preconfigure fragments... aarch64 alpha arc arm csky hppa i386 loongarch m68k microblaze checking for grep that handles long lines and -e... /nix/store/kxbn7dv0i7p0ylsbr53j7z0gf45kim78-gnugrep-3.11/bin/grep]
       > checking for egrep... /nix/store/kxbn7dv0i7p0ylsbr53j7z0gf45kim78-gnugrep-3.11/bin/grep -E
       > mips nios2 or1k powerpc riscv s390 sh checking for grep that handles long lines and -e... (cached) /nix/store/kxbn7dv0i7p0ylsbr53j7z0gf45kim78-gnugrep-3.11/bin/grep
       > checking for egrep... (cached) /nix/store/kxbn7dv0i7p0ylsbr53j7z0gf45kim78-gnugrep-3.11/bin/grep -E
       > sparc x86_64
       > configure: error:
       > *** The GNU C library is currently unavailable for this platform.
       > *** If you are interested in seeing glibc on this platform visit
       > *** the "How to submit a new port" in the wiki:
       > ***   https://sourceware.org/glibc/wiki/#Development
       > *** and join the community!
       For full logs, run 'nix-store -l /nix/store/d20vsmbkvs93qcdhlaliig2g4bz38lsw-glibc-nolibgcc-2.38-23.drv'.
error: 1 dependencies of derivation '/nix/store/br1z6ln523bd2ngwv1q1il49wb864ril-home-manager-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/728vr3w204fnsi0j7jhd70w5p429x5d3-home-manager-fonts.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7538zh42mv1s7jh9rjpg13hhcj6vdal4-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/g7k28kvkwmjxl5pmavryihhm0yd77x7a-system-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4n8k3dfx9h3g31lji33bma9jmmda2wbj-darwin-system-23.11.20231114.e5e3346+darwin4.e67f2bf.drv' failed to build

Issue with Adding Homebrew Tap

Hello, I'm currently trying to install emacs-plus using the Homebrew tap, but it seems that the tap is not functioning properly.
Is there any part that I might have set up incorrectly?

Info

Env: M3 Pro Mackbook

Error

nix run .#build-switch

Warning: 'emacs-plus@30' formula is unreadable: No available formula with the name "emacs-plus@30".
Installing emacs-plus@30
Warning: 'emacs-plus@30' formula is unreadable: No available formula with the name "emacs-plus@30".

/opt/homebrew/bin/brew tap

d12frosted/emacs-plus
homebrew/bundle
homebrew/cask
homebrew/core

flake.nix

 # inputs
 homebrew-emacs-plus = {
      url = "github:d12frosted/homebrew-emacs-plus";
      flake = false;
 };

### outputs   darwinConfigurations
       macos = darwin.lib.darwinSystem {
          system = "aarch64-darwin";
          specialArgs = inputs;
          modules = [
             home-manager.darwinModules.home-manager
             nix-homebrew.darwinModules.nix-homebrew
             {
             nix-homebrew = {
              enable = true;
             user = "${user}";
              taps = {
                  "homebrew/homebrew-core" = homebrew-core;
                  "homebrew/homebrew-cask" = homebrew-cask;
                  "d12frosted/emacs-plus"  = homebrew-emacs-plus;
                  "homebrew/homebrew-bundle" = homebrew-bundle;
                };
               mutableTaps = false;
               autoMigrate = true;
              };
          }
            ./hosts/darwin
          ];

modules/darwin/brews.nix

homebrew = {
    enable = true;
    casks = pkgs.callPackage ./casks.nix {};
    brews = [
  {
    name = "emacs-plus@30";
    args = [
      "with-mailutil"
      "with-xwidgets"
      "with-imagemagick"
      "with-native-comp"
      "with-poll"
    ];
  }
];

Networking wireless device fails to start

Hi @dustinlyons,

I'm taking you up on your generous offer from #40 (comment). I created a pared down version of your nixos-config for my own edification, and am having an issue where my WiFi device won't start after installing the flake from the Minimal ISO.

I can connect to WiFi using wpa_supplicant from the Minimal ISO in order to install NixOS on my machine. However, when I actually boot into the newly-installed NixOS, my WiFi network device fails to start (it times out after 1min 30s):

A start job is running for /sys/subsystem/net/devices/wlp3s0 (12s / 1min 30s)

Once I log in, the device (wlp3s0) is missing when I run ip a. For reference, I am configuring nixos-hardware here and setting up networking here (I set the commented credentials before the installation).

Do you have any idea what might be going wrong?

Installed new NixOS install using this repo, no GUI on reboot

I followed the instructions to install a fresh install of NixOS on my PC by running the listed sudo nix run command. Upon reboot, I'm dropped in a login shell and the virtual terminal at F7 doesn't exist. A bit of a nix noob here so not sure what I'm missing!

Installation issues on Linux

Hey @dustinlyons

here we go with the install log as mentioned in #21

directly after the installation I get the following

building the flake in path:/mnt/etc/nixos?lastModified=1699605049&narHash=sha256-bRfiuis%2fGf1RLZORbWPUaHmi%2f%2fAtOB74eG7q7Koytso=...
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
installing the boot loader...
[agenix] creating new generation in /run/agenix.d/1
[agenix] decrypting secrets...
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-signing-key.age' to '/home/tboston/.ssh/pgp_github.key'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-signing-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/home/tboston/.ssh/pgp_github.key.tmp': No such file or directory
mv: cannot stat '/home/tboston/.ssh/pgp_github.key.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-ssh-key.age' to '/home/tboston/.ssh/id_github'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-ssh-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/home/tboston/.ssh/id_github.tmp': No such file or directory
mv: cannot stat '/home/tboston/.ssh/id_github.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-cert.age' to '/run/agenix.d/1/syncthing-cert'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-cert.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/run/agenix.d/1/syncthing-cert.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/syncthing-cert.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-key.age' to '/run/agenix.d/1/syncthing-key'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/run/agenix.d/1/syncthing-key.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/syncthing-key.tmp': No such file or directory
[agenix] symlinking new secrets to /run/agenix (generation 1)...
Activation script snippet 'agenixInstall' failed (1)
[agenix] chowning...
chown: cannot access '/home/tboston/.ssh/pgp_github.key': No such file or directory
chown: cannot access '/home/tboston/.ssh/id_github': No such file or directory
chown: cannot access '/run/agenix.d/1/syncthing-cert': No such file or directory
chown: cannot access '/run/agenix.d/1/syncthing-key': No such file or directory
Activation script snippet 'agenixChown' failed (1)
setting up /etc...
Initializing machine ID from random generator.
Created "/boot/EFI".
Created "/boot/EFI/systemd".
Created "/boot/EFI/BOOT".
Created "/boot/loader".
Created "/boot/loader/entries".
Created "/boot/EFI/Linux".
Copied "/nix/store/vapnrxrw3b21c7ji61bmnbzl2cj1vl96-systemd-254.3/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/nix/store/vapnrxrw3b21c7ji61bmnbzl2cj1vl96-systemd-254.3/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
⚠️ Mount point '/boot' which backs the random seed file is world accessible, which is a security hole! ⚠️
⚠️ Random seed file '/boot/loader/.#bootctlrandom-seed4ac3184e6c3f3b47' is world accessible, which is a security hole! ⚠️
Random seed file /boot/loader/random-seed successfully written (32 bytes).
Created EFI boot entry "Linux Boot Manager".
[agenix] creating new generation in /run/agenix.d/1
[agenix] decrypting secrets...
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-signing-key.age' to '/home/tboston/.ssh/pgp_github.key'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-signing-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/home/tboston/.ssh/pgp_github.key.tmp': No such file or directory
mv: cannot stat '/home/tboston/.ssh/pgp_github.key.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-ssh-key.age' to '/home/tboston/.ssh/id_github'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-ssh-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/home/tboston/.ssh/id_github.tmp': No such file or directory
mv: cannot stat '/home/tboston/.ssh/id_github.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-cert.age' to '/run/agenix.d/1/syncthing-cert'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-cert.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/run/agenix.d/1/syncthing-cert.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/syncthing-cert.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-key.age' to '/run/agenix.d/1/syncthing-key'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/run/agenix.d/1/syncthing-key.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/syncthing-key.tmp': No such file or directory
[agenix] symlinking new secrets to /run/agenix (generation 1)...
Activation script snippet 'agenixInstall' failed (1)
[agenix] chowning...
chown: cannot access '/home/tboston/.ssh/pgp_github.key': No such file or directory
chown: cannot access '/home/tboston/.ssh/id_github': No such file or directory
chown: cannot access '/run/agenix.d/1/syncthing-cert': No such file or directory
chown: cannot access '/run/agenix.d/1/syncthing-key': No such file or directory
Activation script snippet 'agenixChown' failed (1)
setting up /etc...
[agenix] creating new generation in /run/agenix.d/1
[agenix] decrypting secrets...
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-signing-key.age' to '/home/tboston/.ssh/pgp_github.key'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-signing-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/home/tboston/.ssh/pgp_github.key.tmp': No such file or directory
mv: cannot stat '/home/tboston/.ssh/pgp_github.key.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-ssh-key.age' to '/home/tboston/.ssh/id_github'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/github-ssh-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/home/tboston/.ssh/id_github.tmp': No such file or directory
mv: cannot stat '/home/tboston/.ssh/id_github.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-cert.age' to '/run/agenix.d/1/syncthing-cert'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-cert.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/run/agenix.d/1/syncthing-cert.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/syncthing-cert.tmp': No such file or directory
decrypting '/nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-key.age' to '/run/agenix.d/1/syncthing-key'...
[agenix] WARNING: encrypted file /nix/store/6jcbnjr4298701njnnj4gyi289fh22h9-source/felix-syncthing-key.age does not exist!
Error: No such file or directory (os error 2)

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]
chmod: cannot access '/run/agenix.d/1/syncthing-key.tmp': No such file or directory
mv: cannot stat '/run/agenix.d/1/syncthing-key.tmp': No such file or directory
[agenix] symlinking new secrets to /run/agenix (generation 1)...
Activation script snippet 'agenixInstall' failed (1)
[agenix] chowning...
chown: cannot access '/home/tboston/.ssh/pgp_github.key': No such file or directory
chown: cannot access '/home/tboston/.ssh/id_github': No such file or directory
chown: cannot access '/run/agenix.d/1/syncthing-cert': No such file or directory
chown: cannot access '/run/agenix.d/1/syncthing-key': No such file or directory
Activation script snippet 'agenixChown' failed (1)
setting up /etc...
setting root password...
New password:
Retype new password:
passwd: password updated successfully
installation finished!
+ sudo chmod -R 775 /mnt/etc/nixos
+ cleanup
+ rm -rf nixos-config-main.zip nixos-config-main nixos-config
+ prompt_reboot
+ read -p 'Do you want to reboot now? (y/yes) ' choice
Do you want to reboot now? (y/yes) 

Maybe you wanna look into that first. I'll keep the laptop running for now in this stage.

Homebrew not found

I somehow run into situation:

➜  nixos-config nix run .#build-switch

Running build-switch for aarch64-darwin
Starting build...
Switching to new generation...
building the system configuration...
setting up Homebrew (/opt/homebrew)...
ln: /opt/homebrew/bin/brew: No such file or directory

Can you tell me what's wrong? :)

NixOS install `./bin/apply: No such file or directory`

Hi Dustin,

I'm following the README instructions for NixOS, and the install step is erroring out:

$ sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install
Running install for x86_64-linux
+ cleanup
+ rm -rf nixos-config-main.zip nixos-config-main nixos-config
+ check_installer
+ '[' -e /etc/NIXOS ']'
+ echo -e '\e[1;32mRunning in the NixOS installer environment.\e[0m'
Running in the NixOS installer environment.
+ download_config
+ curl -LJ0 https://github.com/dustinlyons/nixos-config/archive/main.zip -o nixos-config-main.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2320k    0 2320k    0     0  4661k      0 --:--:-- --:--:-- --:--:-- 4661k
+ unzip nixos-config-main.zip
Archive:  nixos-config-main.zip
090115311285ad626e1d1b4e3614efbbf695c35e
   creating: nixos-config-main/
   creating: nixos-config-main/.github/
  inflating: nixos-config-main/.github/dependabot.yml  
   creating: nixos-config-main/.github/workflows/
  inflating: nixos-config-main/.github/workflows/build-template.yml  
  inflating: nixos-config-main/.github/workflows/build.yml  
  inflating: nixos-config-main/.github/workflows/lint.yml  
  inflating: nixos-config-main/.github/workflows/update-flake-lock.yml  
 extracting: nixos-config-main/.gitignore  
  inflating: nixos-config-main/LICENSE  
  inflating: nixos-config-main/README.md  
   creating: nixos-config-main/apps/
  inflating: nixos-config-main/apps/README.md  
   creating: nixos-config-main/apps/aarch64-darwin/
  inflating: nixos-config-main/apps/aarch64-darwin/apply  
  inflating: nixos-config-main/apps/aarch64-darwin/build  
  inflating: nixos-config-main/apps/aarch64-darwin/build-switch  
  inflating: nixos-config-main/apps/aarch64-darwin/check-keys  
  inflating: nixos-config-main/apps/aarch64-darwin/copy-keys  
  inflating: nixos-config-main/apps/aarch64-darwin/create-keys  
    linking: nixos-config-main/apps/aarch64-linux  -> x86_64-linux 
   creating: nixos-config-main/apps/x86_64-linux/
  inflating: nixos-config-main/apps/x86_64-linux/apply  
  inflating: nixos-config-main/apps/x86_64-linux/build-switch  
  inflating: nixos-config-main/apps/x86_64-linux/check-keys  
  inflating: nixos-config-main/apps/x86_64-linux/copy-keys  
  inflating: nixos-config-main/apps/x86_64-linux/create-keys  
  inflating: nixos-config-main/apps/x86_64-linux/install  
  inflating: nixos-config-main/apps/x86_64-linux/install-with-secrets  
  inflating: nixos-config-main/flake.lock  
  inflating: nixos-config-main/flake.nix  
   creating: nixos-config-main/hosts/
   creating: nixos-config-main/hosts/darwin/
  inflating: nixos-config-main/hosts/darwin/default.nix  
   creating: nixos-config-main/hosts/nixos/
  inflating: nixos-config-main/hosts/nixos/default.nix  
   creating: nixos-config-main/modules/
   creating: nixos-config-main/modules/darwin/
  inflating: nixos-config-main/modules/darwin/README.md  
  inflating: nixos-config-main/modules/darwin/casks.nix  
   creating: nixos-config-main/modules/darwin/dock/
  inflating: nixos-config-main/modules/darwin/dock/default.nix  
  inflating: nixos-config-main/modules/darwin/files.nix  
  inflating: nixos-config-main/modules/darwin/home-manager.nix  
  inflating: nixos-config-main/modules/darwin/packages.nix  
  inflating: nixos-config-main/modules/darwin/secrets.nix  
   creating: nixos-config-main/modules/nixos/
  inflating: nixos-config-main/modules/nixos/README.md  
   creating: nixos-config-main/modules/nixos/config/
  inflating: nixos-config-main/modules/nixos/config/login-wallpaper.png  
   creating: nixos-config-main/modules/nixos/config/polybar/
  inflating: nixos-config-main/modules/nixos/config/polybar/bars.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/colors.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/config.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/modules.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/user_modules.ini  
   creating: nixos-config-main/modules/nixos/config/rofi/
  inflating: nixos-config-main/modules/nixos/config/rofi/colors.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/confirm.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/launcher.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/message.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/networkmenu.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/powermenu.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/styles.rasi  
  inflating: nixos-config-main/modules/nixos/disk-config.nix  
  inflating: nixos-config-main/modules/nixos/files.nix  
  inflating: nixos-config-main/modules/nixos/home-manager.nix  
  inflating: nixos-config-main/modules/nixos/packages.nix  
  inflating: nixos-config-main/modules/nixos/secrets.nix  
   creating: nixos-config-main/modules/shared/
  inflating: nixos-config-main/modules/shared/README.md  
   creating: nixos-config-main/modules/shared/cachix/
  inflating: nixos-config-main/modules/shared/cachix/default.nix  
   creating: nixos-config-main/modules/shared/config/
   creating: nixos-config-main/modules/shared/config/emacs/
 extracting: nixos-config-main/modules/shared/config/emacs/.gitignore  
  inflating: nixos-config-main/modules/shared/config/emacs/config.org  
  inflating: nixos-config-main/modules/shared/config/emacs/init.el  
  inflating: nixos-config-main/modules/shared/config/p10k.zsh  
  inflating: nixos-config-main/modules/shared/default.nix  
  inflating: nixos-config-main/modules/shared/files.nix  
  inflating: nixos-config-main/modules/shared/home-manager.nix  
  inflating: nixos-config-main/modules/shared/packages.nix  
   creating: nixos-config-main/overlays/
  inflating: nixos-config-main/overlays/10-feather-font.nix  
  inflating: nixos-config-main/overlays/README.md  
   creating: nixos-config-main/templates/
   creating: nixos-config-main/templates/starter-with-secrets/
   creating: nixos-config-main/templates/starter-with-secrets/apps/
   creating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/apply  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/build  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/build-switch  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/check-keys  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/copy-keys  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/create-keys  
    linking: nixos-config-main/templates/starter-with-secrets/apps/aarch64-linux  -> x86_64-linux 
   creating: nixos-config-main/templates/starter-with-secrets/apps/x86_64-linux/
  inflating: nixos-config-main/templates/starter-with-secrets/apps/x86_64-linux/apply  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/x86_64-linux/build-switch  
  inflating: nixos-config-main/templates/starter-with-secrets/flake.nix  
   creating: nixos-config-main/templates/starter-with-secrets/hosts/
   creating: nixos-config-main/templates/starter-with-secrets/hosts/darwin/
  inflating: nixos-config-main/templates/starter-with-secrets/hosts/darwin/default.nix  
   creating: nixos-config-main/templates/starter-with-secrets/hosts/nixos/
  inflating: nixos-config-main/templates/starter-with-secrets/hosts/nixos/default.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/
   creating: nixos-config-main/templates/starter-with-secrets/modules/darwin/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/README.md  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/casks.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/darwin/dock/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/dock/default.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/files.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/home-manager.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/packages.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/secrets.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/README.md  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/login-wallpaper.png  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/bars.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/colors.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/config.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/modules.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/user_modules.ini  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/colors.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/confirm.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/launcher.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/message.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/networkmenu.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/powermenu.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/styles.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/disk-config.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/files.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/home-manager.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/packages.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/secrets.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/README.md  
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/cachix/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/cachix/default.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/
 extracting: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/.gitignore  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/config.org  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/init.el  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/p10k.zsh  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/default.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/files.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/home-manager.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/packages.nix  
   creating: nixos-config-main/templates/starter-with-secrets/overlays/
  inflating: nixos-config-main/templates/starter-with-secrets/overlays/10-feather-font.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/overlays/README.md  
   creating: nixos-config-main/templates/starter/
   creating: nixos-config-main/templates/starter/apps/
   creating: nixos-config-main/templates/starter/apps/aarch64-darwin/
  inflating: nixos-config-main/templates/starter/apps/aarch64-darwin/apply  
  inflating: nixos-config-main/templates/starter/apps/aarch64-darwin/build  
  inflating: nixos-config-main/templates/starter/apps/aarch64-darwin/build-switch  
    linking: nixos-config-main/templates/starter/apps/aarch64-linux  -> x86_64-linux 
   creating: nixos-config-main/templates/starter/apps/x86_64-linux/
  inflating: nixos-config-main/templates/starter/apps/x86_64-linux/apply  
  inflating: nixos-config-main/templates/starter/apps/x86_64-linux/build-switch  
  inflating: nixos-config-main/templates/starter/flake.nix  
   creating: nixos-config-main/templates/starter/hosts/
   creating: nixos-config-main/templates/starter/hosts/darwin/
  inflating: nixos-config-main/templates/starter/hosts/darwin/default.nix  
   creating: nixos-config-main/templates/starter/hosts/nixos/
  inflating: nixos-config-main/templates/starter/hosts/nixos/default.nix  
   creating: nixos-config-main/templates/starter/modules/
   creating: nixos-config-main/templates/starter/modules/darwin/
  inflating: nixos-config-main/templates/starter/modules/darwin/README.md  
  inflating: nixos-config-main/templates/starter/modules/darwin/casks.nix  
   creating: nixos-config-main/templates/starter/modules/darwin/dock/
  inflating: nixos-config-main/templates/starter/modules/darwin/dock/default.nix  
  inflating: nixos-config-main/templates/starter/modules/darwin/files.nix  
  inflating: nixos-config-main/templates/starter/modules/darwin/home-manager.nix  
  inflating: nixos-config-main/templates/starter/modules/darwin/packages.nix  
   creating: nixos-config-main/templates/starter/modules/nixos/
  inflating: nixos-config-main/templates/starter/modules/nixos/README.md  
   creating: nixos-config-main/templates/starter/modules/nixos/config/
  inflating: nixos-config-main/templates/starter/modules/nixos/config/login-wallpaper.png  
   creating: nixos-config-main/templates/starter/modules/nixos/config/polybar/
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/bars.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/colors.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/config.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/modules.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/user_modules.ini  
   creating: nixos-config-main/templates/starter/modules/nixos/config/rofi/
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/colors.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/confirm.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/launcher.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/message.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/networkmenu.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/powermenu.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/styles.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/disk-config.nix  
  inflating: nixos-config-main/templates/starter/modules/nixos/files.nix  
  inflating: nixos-config-main/templates/starter/modules/nixos/home-manager.nix  
  inflating: nixos-config-main/templates/starter/modules/nixos/packages.nix  
   creating: nixos-config-main/templates/starter/modules/shared/
  inflating: nixos-config-main/templates/starter/modules/shared/README.md  
   creating: nixos-config-main/templates/starter/modules/shared/cachix/
  inflating: nixos-config-main/templates/starter/modules/shared/cachix/default.nix  
   creating: nixos-config-main/templates/starter/modules/shared/config/
   creating: nixos-config-main/templates/starter/modules/shared/config/emacs/
 extracting: nixos-config-main/templates/starter/modules/shared/config/emacs/.gitignore  
  inflating: nixos-config-main/templates/starter/modules/shared/config/emacs/config.org  
  inflating: nixos-config-main/templates/starter/modules/shared/config/emacs/init.el  
  inflating: nixos-config-main/templates/starter/modules/shared/config/p10k.zsh  
  inflating: nixos-config-main/templates/starter/modules/shared/default.nix  
  inflating: nixos-config-main/templates/starter/modules/shared/files.nix  
  inflating: nixos-config-main/templates/starter/modules/shared/home-manager.nix  
  inflating: nixos-config-main/templates/starter/modules/shared/packages.nix  
   creating: nixos-config-main/templates/starter/overlays/
  inflating: nixos-config-main/templates/starter/overlays/10-feather-font.nix  
  inflating: nixos-config-main/templates/starter/overlays/README.md  
finishing deferred symbolic links:
  nixos-config-main/apps/aarch64-linux -> x86_64-linux
  nixos-config-main/templates/starter-with-secrets/apps/aarch64-linux -> x86_64-linux
  nixos-config-main/templates/starter/apps/aarch64-linux -> x86_64-linux
+ mv nixos-config-main/templates/starter nixos-config
+ cd nixos-config
+ run_apply
+ ./bin/apply
/nix/store/9vi19cpxijbhf6h0kcr07wl40d53qbzv-source/apps/x86_64-linux/install: line 25: ./bin/apply: No such file or directory

Do you know how to resolve this? Thanks for making this repository public by the way; it's been a very helpful learning resource.

Add remaining dotfiles to home-manager

Context

Deprecate my old dotfiles repository in favor of home-manager.

Review the following configs and add what is relevant. Delete the rest.

  • Polybar
  • Picom
  • Rofi
  • Tmux
  • Dunst

starter config appears to expect secrets repo

I'm trying to setup starter without secrets, but

  1. #apply asks for GitHub config anyways
  2. #build fails with what appears to be secret repo failure (of course, it doesn't exist)
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
warning: could not read HEAD ref from repo at 'ssh://[email protected]//.git', using 'master'
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
warning: could not update mtime for file '/Users/xxxx/.cache/nix/gitv3/1x7mdlzb2qbqf1vjp1i3w1vr6h3q3wa9q5b07jkbzrxi6rr0ymwk/refs/heads/master': No such file or directory
fatal: Refusing to point HEAD outside of refs/
warning: could not update cached head 'master' for 'ssh://[email protected]//.git'
error:
       … while updating the lock file of flake 'path:/Users/xxxx/nixos-config?lastModified=1708284621&narHash=sha256-pLfyOdF1o%2Bggv0sCGI6aioVu6gKbz%2B3Ql16ms%2BY8Lwg%3D'

       … while updating the flake input 'secrets'

       … while fetching the input 'git+ssh://[email protected]//.git'

       error: opening file '/Users/xxxx/.cache/nix/gitv3/1x7mdlzb2qbqf1vjp1i3w1vr6h3q3wa9q5b07jkbzrxi6rr0ymwk/refs/heads/master': No such file or directory

[Error] h-m.u.d.h.stateVersion is used but not defined

Problem:

Testing failure, un-modified main branch nix deployment on a clean mac OS.

Reproduce:

  1. Follow instructions for macos setup found in dustinlyons/nixos-config/README.md
  2. Observe failure to build flake

note: expandable logs included below [1][2][3]

Logs

CLICK TO EXPAND LOGS [1]> nix-shell -p nix-info --run "nix-info -m"
    dustin@Dustins-MBP> nix-shell -p nix-info --run "nix-info -m".                                      ~/nixos-config
     - system: `"aarch64-darwin"`
     - host os: `Darwin 22.5.0, macOS 13.4.1`
     - multi-user?: `yes`
     - sandbox: `no`
     - version: `nix-env (Nix) 2.15.1`
     - channels(root): `"nixpkgs"`
     - nixpkgs: `/Users/dustin/.nix-defexpr/channels/nixpkgs`
CLICK TO EXPAND LOGS [2]> ./bin/build
dustin@Dustins-MBP> ./bin/build                                                                                                    ~/nixos-config
+ VERSION=1.0
+ GREEN='\033[1;32m'
+ RED='\033[1;31m'
+ CLEAR='\033[0m'
+ FLAKE=Dustins-MBP
+ SYSTEM=darwinConfigurations.Dustins-MBP.system
+ export NIXPKGS_ALLOW_UNFREE=1
+ NIXPKGS_ALLOW_UNFREE=1
+++ readlink -f ./bin/darwin-build
++ dirname /Users/dustin/nixos-config/bin/darwin-build
+ cd /Users/dustin/nixos-config/bin
+ cd ..
+ echo '\033[1;32mStarting...\033[0m'
Starting...
+ nix --experimental-features 'nix-command flakes' build .#darwinConfigurations.Dustins-MBP.system --impure
error:
       … while evaluating the attribute 'value'

         at /nix/store/w9py11if12n2z4nvdgmwcarry9vclc58-source/lib/modules.nix:768:9:

          767|     in warnDeprecation opt //
          768|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          769|         inherit (res.defsFinal') highestPrio;

while calling the 'addErrorContext' builtin

         at /nix/store/w9py11if12n2z4nvdgmwcarry9vclc58-source/lib/modules.nix:768:17:

          767|     in warnDeprecation opt //
          768|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |                 ^
          769|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `home-manager.users.dustin.home.stateVersion' is used but not defined.
CLICK TO EXPAND LOGS [3]> nix build --show-trace
dustin@Dustins-MBP> nix --experimental-features 'nix-command flakes' build .#darwinConfigurations.Dustins-MBP.system --impure --show-trace 2>&1 | tee /tmp/log

error:
       … while evaluating the attribute 'config.system.build.toplevel'

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:320:9:

          319|         options = checked options;
          320|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          321|         _module = checked (config._module);while calling the 'seq' builtin

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:320:18:

          319|         options = checked options;
          320|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          321|         _module = checked (config._module);while evaluating a branch condition

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:261:9:

          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          262|           letin the left operand of the AND (&&) operator

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:261:72:

          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |                                                                        ^
          262|           letin the left operand of the AND (&&) operator

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:261:33:

          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |                                 ^
          262|           letwhile evaluating a branch condition

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:254:12:

          253|
          254|         in if declaredConfig._module.freeformType == null then declaredConfig
             |            ^
          255|           # Because all definitions that had an associated option ended in

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:242:28:

          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                            ^
          243|while calling 'mapAttrsRecursiveCond'

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/attrsets.nix:594:5:

          593|     # Attribute set to recursively map over.
          594|     set:
             |     ^
          595|     let

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:234:33:

          233|           ({ inherit lib options config specialArgs; } // specialArgs);
          234|         in mergeModules prefix (reverseList collected);
             |                                 ^
          235|while calling 'reverseList'

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/lists.nix:436:17:

          435|   */
          436|   reverseList = xs:
             |                 ^
          437|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:229:25:

          228|       merged =
          229|         let collected = collectModules
             |                         ^
          230|           class

       … while calling anonymous lambda

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:443:37:

          442|
          443|     in modulesPath: initialModules: args:
             |                                     ^
          444|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:444:7:

          443|     in modulesPath: initialModules: args:
          444|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          445|while calling 'filterModules'

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:411:36:

          410|       # modules recursively. It returns the final list of unique-by-key modules
          411|       filterModules = modulesPath: { disabled, modules }:
             |                                    ^
          412|         letwhile calling anonymous lambda

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:437:31:

          436|           disabledKeys = concatMap ({ file, disabled }: map (moduleKey file) disabled) disabled;
          437|           keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
             |                               ^
          438|         in map (attrs: attrs.module) (builtins.genericClosure {

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:398:22:

          397|           let
          398|             module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x);
             |                      ^
          399|             collectedImports = collectStructuredModules module._file module.key module.imports args;while calling anonymous lambda

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:363:11:

          362|         else
          363|           m: m;
             |           ^
          364|

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:398:35:

          397|           let
          398|             module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x);
             |                                   ^
          399|             collectedImports = collectStructuredModules module._file module.key module.imports args;while calling 'loadModule'

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:334:53:

          333|       # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
          334|       loadModule = args: fallbackFile: fallbackKey: m:
             |                                                     ^
          335|         if isFunction m then

       … from call site

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/modules.nix:335:12:

          334|       loadModule = args: fallbackFile: fallbackKey: m:
          335|         if isFunction m then
             |            ^
          336|           unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgs fallbackKey m args)

       … while calling 'isFunction'

         at /nix/store/8mp6dbzv7fc4my08zq5l30g8ihkck3d2-source/lib/trivial.nix:448:16:

          447|   */
          448|   isFunction = f: builtins.isFunction f ||
             |                ^
          449|     (f ? __functor && isFunction (f.__functor f));

       error: file 'home-manager/nix-darwin' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
       

chmod hack in `darwin-build` seems to be unnecessary

Hi. Thanks for maintaining this excellent repo. I am not using it directly, but it's guiding my own setup.

I ran into the problem that this is trying to handle:

# Check if the directory exists before running chmod
if [ -d "/opt/homebrew/Library/Taps" ]; then
sudo /bin/chmod +a "dustin allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown" /opt/homebrew/Library/Taps/homebrew/
else
echo "${RED}The directory /opt/homebrew/Library/Taps/homebrew/ does not exist. Skipping chmod.${CLEAR}"
fi

And found this discussion here zhaofengli/nix-homebrew#9 (comment). I followed the suggestion about tapping homebrew-bundle in nix, and it works. This seems like a better approach than what darwin-build is doing, as far as my understanding of the situation goes 🌞.

So, maybe you want to do the same; this is just FYI.

How can I fix this homebrew error?

I get the following error when I try to build and switch my configuration:

Error: Your Homebrew is too outdated for `brew bundle`. Please run `brew update`!

But when I run brew update I get the following error:

/nix/store/qkmybdpgm0xdmm1qnxx91sx09l3f4dij-source/.git: Permission denied

How can I fix this?

Thank you

Add -b backup to `home-manager switch`

Would it be possible to automatically backup files via -b flag to home-manager. Unfortunately I don't know how to add that into the darwin.lib.darwinSystem or /apps/ directory.

macOS - User does not own "system" or "default" profile

I'd like to be able to install packages ad-hoc without generating a whole new profile generation. Sometimes I'm test driving something, sometimes I'm just in a hurry and don't want to go through the whole process of editing a nix file and rebuilding my system. I understand that installing packages this way isn't "permanent" in the way that declaring them in my nix config is, and I still want to be able to do this.

$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-23.11-darwin
nixpkgs-23.11-darwin https://nixos.org/channels/nixpkgs-23.11-darwin

Using $ nix-env -iA nixpkgs.hello I get errors saying that nixpkgs isn't in my default search path, which is confusing to me given the output from nix-channel --list.

My next idea was to try $ nix profile install 'nixpkgs#hello', but that also has issues.

If I understand things correctly, I have 3 nix profiles: ~/.local/state/nix/profiles/home-manager, /nix/var/nix/profiles/system and /nix/var/nix/profiles/default -> /nix/var/nix/profiles/per-user/root/profile

Trying to $ nix profile install to the HM profile seems like a bad idea and not what I want, so that leaves me with the system and per-user/root profiles to try, but those both give permission denied:

$ nix profile install 'nixpkgs#hello'
error: creating symlink from '/nix/var/nix/profiles/system-76-link.tmp-47457-239703633' to '/nix/store/wp55qs45bkwd6wnvrf2syjr2abymwbxk-profile': Permission denied
$ nix profile install 'nixpkgs#hello' --profile /nix/var/nix/profiles/system
error: creating symlink from '/nix/var/nix/profiles/system-76-link.tmp-48959-324922186' to '/nix/store/wp55qs45bkwd6wnvrf2syjr2abymwbxk-profile': Permission denied
$ nix profile install 'nixpkgs#hello' --profile /nix/var/nix/profiles/default
error: creating symlink from '/nix/var/nix/profiles/default-1-link.tmp-47660-1073039347' to '/nix/store/mds25w525q6wdmcz78clz7dpqw05bnj3-profile': Permission denied
$ nix profile install 'nixpkgs#hello' --profile /nix/var/nix/profiles/per-user/root/profile
error: creating symlink from '/nix/var/nix/profiles/per-user/root/profile-3-link.tmp-47945-91487723' to '/nix/store/mds25w525q6wdmcz78clz7dpqw05bnj3-profile': Permission denied

I don't know if I've installed something incorrectly, or if I'm going about this the wrong way.

How to upgrade everything installed (Mac OSX Sonoma)?

Hi!

I have seen the video posted in the README about updating "dependencies" with one command. I am not sure the video is updated neither that this instruction will upgrade my installed packages.

  • I use to do a nix flake update, then I use git add . (if I changed anything in my config), followed by nix run .#build-switch.
  • I don't have a ./bin/ build file/directory. Is this somehow related to #40 ? Is the video oudated? I have a apps/aarch64-darwin/build and apps/aarch64-darwin/build-switch scripts though. Are these the ones that are supposed to upgrade my installed packages? It doesn't seem they are upgrading my packages (at least not the ones installed by using homebrew declaratively).
  • I did a brew upgrade && brew update && brew update --cask && brew cleanup and it DID upgraded a bunch of outdated packages, that I have installed via nix-homebrew and related.

Lastly, how can I clean up/collect some of the garbage that could be outdated in my installation, just like I would do in a NixOS installation?

Couple of issues found with the latest instructions/code

Just going to put these into one issue as improvements that can be made/noted in the README file (installing onto MacOS Sonoma):

  1. In section 8. Optional: Setup secrets, step 8a notes to create the repo and keep it empty. There are two issues here with the workflow:
    a. The code assumes that your default branch is 'master'. With the changes to GitHub lately, this is 'main' by default.
    b. The statement to leave the repository empty is a little misleading as, if you create an empty repo on GitHub, you cannot clone it using the ssh:// URL. Only the git:// format will work. Otherwise, you get a publickey denial. Adding a single file (empty README.md works) to the repository allows you to now successfully execute the 'nix run .#create-keys' command.

  2. Clarification on whether an existing standalone installation of home-manager will work with this configuration or not would be greatly appreciated. Would that be something easy to add here?

  3. Clarification on whether or not there are any issues when applying OS upgrades. Is it as simple as runnning 'nix run .#build-switch' aftwards? Is that even needed?

Thanks for the work! This is very interesting and I'm still studying the code to see what might break in my existing home-manager configuration as I'm using that across three different machines and two platforms.

aarch64-darwin/create-keys: cannot execute: No such file or directory (MacBook Pro M3 Max chip)

Hi!

I'm trying to follow the instructions for the full starter template with secrets management. However, I'm getting the following error:

$ nix run .#create-keys
Running create-keys for aarch64-darwin
/nix/store/n8qlll9v78ml2lwlp3f4yb0zq24mczsv-create-keys/bin/create-keys: line 4: /nix/store/s54dazbbdqhdc34i6cgd83d19rjjiq1f-source/apps/aarch64-darwin/create-keys: No such file or directory
/nix/store/n8qlll9v78ml2lwlp3f4yb0zq24mczsv-create-keys/bin/create-keys: line 4: exec: /nix/store/s54dazbbdqhdc34i6cgd83d19rjjiq1f-source/apps/aarch64-darwin/create-keys: cannot execute: No such file or directory

I'm following the guide using a new MacBook Pro with an M3 Max chip. Really new to nix on Darwin.

At first, I thought it might be because I installed nix (2.19.2) with the official installation method from https://nixos.org/download.html#nix-install-macos.
I deleted my previous nix installation, and used the instructions provided in this repo, that install an older version of nix. I'm getting the same error though...

Any hints?

Homebrew can't find installed packages

This prevents some of the auto-updating features to not work correctly. It was previously working before migrating my install over to using the nix-homebrew flake.

To re-install zoom, run:
  brew reinstall --cask zoom
Installing appcleaner
Installing appcleaner cask. It is not currently installed.
Warning: Cask 'appcleaner' is already installed.

To re-install appcleaner, run:
  brew reinstall --cask appcleaner
Installing syncthing
Installing syncthing cask. It is not currently installed.
Warning: Cask 'syncthing' is already installed.

To re-install syncthing, run:
  brew reinstall --cask syncthing
Installing steam
Installing steam cask. It is not currently installed.
Warning: Cask 'steam' is already installed.

To re-install steam, run:
  brew reinstall --cask steam
Installing vlc
Installing vlc cask. It is not currently installed.
Warning: Cask 'vlc' is already installed.

To re-install vlc, run:
  brew reinstall --cask vlc
Installing raycast
Installing raycast cask. It is not currently installed.
Warning: Cask 'raycast' is already installed.

To re-install raycast, run:
  brew reinstall --cask raycast
Installing asana
Installing asana cask. It is not currently installed.
Warning: Cask 'asana' is already installed.

To re-install asana, run:
  brew reinstall --cask asana
Installing google-chrome
Installing google-chrome cask. It is not currently installed.
Warning: Cask 'google-chrome' is already installed.

To re-install google-chrome, run:
  brew reinstall --cask google-chrome
Installing diffusionbee
Installing diffusionbee cask. It is not currently installed.
Warning: Cask 'diffusionbee' is already installed.

To re-install diffusionbee, run:
  brew reinstall --cask diffusionbee

error: experimental Nix feature 'nix-command' is disabled

Hi,

I'm trying to install the config on nix 2.20.1. on macOS. nix run .#apply fails:

nix run .#apply

error: experimental Nix feature 'nix-command' is disabled; add '--extra-experimental-features nix-command' to enable it

This seems to work:

nix --extra-experimental-features 'nix-command flakes' run .#apply

Fix chmod command in README

Chained chmod commands are broken:

current:
chmod +x apps/aarch64-darwin/apply && chmod +x apps/aarch64-darwin/build chmod +x apps/aarch64-darwin/build-switch

should:
chmod +x apps/aarch64-darwin/apply && chmod +x apps/aarch64-darwin/build && chmod +x apps/aarch64-darwin/build-switch

see ampersands between the second and the third chmod.

Make Emacs 100% Nix

My Emacs configuration is two files; init.el and Emacs.org.

In my nix configuration, I enable service.emacs to run the daemon on both MacOS and NixOS. It works well, with natively compiled Emacs taboot.

However, I have to do manual fiddling to get everything to work. init.el is manually symlinked to my ~/.emacs file, for example. This isn't in the spirit of immutable, reproducible code, which is the spirit of Nix and what I set out to build with this configuration.

So let's fix it.

This issue is to track the work to bring my Emacs.org over to Nix 100%.

Emacs cannot determine suitable `emacsclient` on MacOS

Context

I receive the following error when opening Emacs on my Macbook. Resolve this.

Warning (with-editor): Cannot determine a suitable Emacsclient

I need to debug the local path emacs uses on MacOS to resolve this.

Fresh install issues

When calling bin/build I get the following error

~/dev via  v21.1.0 via 🐦
❯ mkdir -p nixos-config


~/dev via  v21.1.0 via 🐦
❯ cd nixos-config && nix flake init -t github:dustinlyons/nixos-config#starte
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override

~/dev/nixos-config
❯ nix flake --extra-experimental-features nix-command --extra-experimental-features flakes init -t github:dustinlyons/nixos-config#starter
wrote: /Users/olafur/dev/nixos-config/bin/apply
wrote: /Users/olafur/dev/nixos-config/bin/nixos-build
wrote: /Users/olafur/dev/nixos-config/bin/darwin-build
wrote: /Users/olafur/dev/nixos-config/bin/build
wrote: /Users/olafur/dev/nixos-config/bin
wrote: /Users/olafur/dev/nixos-config/overlays/README.md
wrote: /Users/olafur/dev/nixos-config/overlays
wrote: /Users/olafur/dev/nixos-config/shared/home-manager.nix
wrote: /Users/olafur/dev/nixos-config/shared/files.nix
wrote: /Users/olafur/dev/nixos-config/shared/config/p10k.zsh
wrote: /Users/olafur/dev/nixos-config/shared/config/emacs/config.org
wrote: /Users/olafur/dev/nixos-config/shared/config/emacs/init.el
wrote: /Users/olafur/dev/nixos-config/shared/config/emacs/.gitignore
wrote: /Users/olafur/dev/nixos-config/shared/config/emacs
wrote: /Users/olafur/dev/nixos-config/shared/config
wrote: /Users/olafur/dev/nixos-config/shared/README.md
wrote: /Users/olafur/dev/nixos-config/shared/default.nix
wrote: /Users/olafur/dev/nixos-config/shared/packages.nix
wrote: /Users/olafur/dev/nixos-config/shared/cachix/default.nix
wrote: /Users/olafur/dev/nixos-config/shared/cachix
wrote: /Users/olafur/dev/nixos-config/shared
wrote: /Users/olafur/dev/nixos-config/flake.nix
wrote: /Users/olafur/dev/nixos-config/nixos/home-manager.nix
wrote: /Users/olafur/dev/nixos-config/nixos/disk-config.nix
wrote: /Users/olafur/dev/nixos-config/nixos/files.nix
wrote: /Users/olafur/dev/nixos-config/nixos/config/login-wallpaper.png
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/launcher.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/colors.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/confirm.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/message.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/powermenu.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/styles.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi/networkmenu.rasi
wrote: /Users/olafur/dev/nixos-config/nixos/config/rofi
wrote: /Users/olafur/dev/nixos-config/nixos/config/polybar/modules.ini
wrote: /Users/olafur/dev/nixos-config/nixos/config/polybar/bars.ini
wrote: /Users/olafur/dev/nixos-config/nixos/config/polybar/config.ini
wrote: /Users/olafur/dev/nixos-config/nixos/config/polybar/colors.ini
wrote: /Users/olafur/dev/nixos-config/nixos/config/polybar/user_modules.ini
wrote: /Users/olafur/dev/nixos-config/nixos/config/polybar
wrote: /Users/olafur/dev/nixos-config/nixos/config
wrote: /Users/olafur/dev/nixos-config/nixos/README.md
wrote: /Users/olafur/dev/nixos-config/nixos/default.nix
wrote: /Users/olafur/dev/nixos-config/nixos/packages.nix
wrote: /Users/olafur/dev/nixos-config/nixos
wrote: /Users/olafur/dev/nixos-config/darwin/home-manager.nix
wrote: /Users/olafur/dev/nixos-config/darwin/files.nix
wrote: /Users/olafur/dev/nixos-config/darwin/casks.nix
wrote: /Users/olafur/dev/nixos-config/darwin/README.md
wrote: /Users/olafur/dev/nixos-config/darwin/default.nix
wrote: /Users/olafur/dev/nixos-config/darwin/packages.nix
wrote: /Users/olafur/dev/nixos-config/darwin/dock/default.nix
wrote: /Users/olafur/dev/nixos-config/darwin/dock
wrote: /Users/olafur/dev/nixos-config/darwin

~/dev/nixos-config
❯ chmod +x bin/apply && bin/apply
\033[0;32mUsername: xxx
Email: [email protected]
Name: xxx\033[0m
\033[1;33mIs this correct? (Y/N): \033[0m
Y
\033[0;32mContinuing...\033[0m
\033[0;32mUser xxx information applied.\033[0m

~/dev/nixos-config took 2s
❯ sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
Password:
mv: rename /etc/nix/nix.conf to /etc/nix/nix.conf.before-nix-darwin: No such file or directory

~/dev/nixos-config took 2s
❯ chmod +x bin/darwin-build && chmod +x bin/build && bin/build
Starting build...
warning: creating lock file '/Users/olafur/dev/nixos-config/flake.lock'
error: flake 'path:/Users/olafur/dev/nixos-config' does not provide attribute 'packages.aarch64-darwin.darwinConfigurations.Dustins-MBP.system', 'legacyPackages.aarch64-darwin.darwinConfigurations.Dustins-MBP.system' or 'darwinConfigurations.Dustins-MBP.system'

Create easy to use Nix template

  • Reduce down set of packages and my custom config
  • Create a nix-command to sed/replace a %USER% token with the current
  • Simplify Emacs configuration
  • Test it on a fresh Macbook install
  • Update README

Permission denied with homebrew

Hi,
I've added two packages:

  "koekeishiya/formulae/yabai"
  "koekeishiya/formulae/skhd"

When running nix run .#build-switch I'm getting:

Installing yabai
==> Tapping koekeishiya/formulae
fatal: could not create leading directories of '/usr/local/Homebrew/Library/Taps/koekeishiya/homebrew-formulae': Permission denied
Error: Failure while executing; `git clone https://github.com/koekeishiya/homebrew-formulae /usr/local/Homebrew/Library/Taps/koekeishiya/homebrew-formulae --origin=origin --template= --config core.fsmonitor=false` exited with 128.
Installing yabai has failed!
Installing skhd
==> Tapping koekeishiya/formulae
fatal: could not create leading directories of '/usr/local/Homebrew/Library/Taps/koekeishiya/homebrew-formulae': Permission denied
Error: Failure while executing; `git clone https://github.com/koekeishiya/homebrew-formulae /usr/local/Homebrew/Library/Taps/koekeishiya/homebrew-formulae --origin=origin --template= --config core.fsmonitor=false` exited with 128.
Installing skhd has failed!

Not sure why this is happening - any idea?

Define user context in `flake.nix` and refactor install scripts

Currently, we run bin/apply to ask the user for some info, and run a sed replace function to replace various static tokens throughout the code.

These look like %USER%, %HOST_NAME%, etc. in the templates. We should clean these up so that it's defined once in flake.nix, and that input is provided as part of building the system.

Installation issue on NixOS with xvda boot disk

First, thank you for sharing your config! I've been setting it up on MacOS and it's been great.

I wanted to test the config in a linux cloud environment so I consulted this list of NixOS friendly hosters and decided to try Gandi.net's base VPS. NixOS is actually an image option when setting up the VPS, which I thought was great.

Anyway, when I run the install command (without secrets) ...

sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install

... I run into some issues that seem to corrupt the filesystem/server. I've included the logs below. A couple things that stood out to me were umount: /mnt: not found and umount: /nix/store: target is busy, which seems to indicate there was a problem unmounting directories (because they're in use or weren't mounted successfully).

Another thing to note is the boot drive type for the VPS is xvd. I checked disko to make sure that xvd is also supported and it looks like support was added last year.

If this is a disko issue, I apologize. I can create an issue over there if so.

Here are the logs from running the install command. I've excluded the beginning of the logs before apply is called.

Found primary network interface enX0
\033[1;33mYou're running as root. Please enter your desired username: \033[0m
ryansnyder
\033[1;33mPlease enter your email: \033[0m
[email protected]
\033[1;33mPlease enter your name: \033[0m
Ryan Snyder
\033[1;33mPlease enter a hostname for the system: \033[0m
nixos-playground
\033[1;33mAvailable disks:\033[0m
xvda  25G
\033[0;31mWARNING: All data on the chosen disk will be erased during the installation!\033[0m
\033[1;33mPlease choose your boot disk (e.g., nvme0n1, sda): \033[0m
xvda
\033[1;33mYou have selected xvda as the boot disk. This will delete everything on this disk. Are you sure? (Y/N): \033[0m
Y
\033[0;32mUsername: ryansnyder
Email: [email protected]
Name: Ryan Snyder\033[0m
\033[0;32mPrimary interface: enX0
Boot disk: xvda
Hostname: nixos-playground\033[0m
\033[1;33mIs this correct? (Y/N): \033[0m
Y
\033[0;32mContinuing...\033[0m
\033[0;32mUser ryansnyder information applied.\033[0m
+ '[' '!' -f /tmp/username.txt ']'
++ cat /tmp/username.txt
+ export USERNAME=ryansnyder
+ USERNAME=ryansnyder
+ run_disko
+ sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes github:nix-community/disko -- --mode zap_create_mount ./modules/nixos/disk-config.nix
this derivation will be built:
  /nix/store/zq74n48ndl7wvrl3rq027aja6dikhiqi-disko.drv
these 76 paths will be fetched (27.96 MiB download, 137.27 MiB unpacked):
  /nix/store/072kqjmbhfrmziz5hbs499h6czw7w4pj-jq-1.7-lib
  /nix/store/15wap48wv4rdm1jasvlncs7ivg8f3922-npth-1.6
  /nix/store/16mv7ipba73qn6aads1r2x3vm11bq12x-gnupg-2.4.1
  /nix/store/207d2mg23g6c28f8cpb471a9mc4h44iw-libnfnetlink-1.0.2
  /nix/store/2yxxbsgclg2fx2picgnfi3f4x1vglq3v-audit-3.1.2
  /nix/store/35p0hz5k0fl2fgcgdjxi138xix4bl299-util-linux-2.39.2-swap
  /nix/store/3glzfq0m5pkjywc3a5kk1zi8p6dh35l9-libbsd-unstable-2023-04-29
  /nix/store/3qkckv4scqwzf36nl8dy8rhx0j9mhh3d-shadow-4.14.2
  /nix/store/3yd7qdyl9ix3layh3dlg99qmr9y1pqsq-json-c-0.16
  /nix/store/43pl823dyb6g2i58rf5v71yszk6abfrc-unbound-1.19.0-lib
  /nix/store/4h02i6q6hfvp5avk97lympf43zvnk2d0-util-linux-2.39.2-bin
  /nix/store/4i1p5vr6iai2br2kq8d7mhwlllivf6g8-parted-3.6
  /nix/store/4qlgccn3g3mfw3i0bjibkqhq59cs0rdm-libpcap-1.10.4
  /nix/store/4r1k85y1cp857sy6ndak6327gajqrg45-jq-1.7
  /nix/store/5pwqfff4cmk3f0w6qni8p6g3ja5diw1k-linux-pam-1.5.2
  /nix/store/5pzhzzncm5w39hrsd4g024y3lf85m3ww-elfutils-0.190
  /nix/store/5ri38niq6c90g33i8dw8wd5h16ab2l9w-jq-1.7-man
  /nix/store/5rnczbi8hgzj79bgh23kzmq9aaljgnz1-kmod-31-lib
  /nix/store/69jh5m8vlfifkrvzk3gwphfhbglv2a5z-db-4.8.30
  /nix/store/6ivcrp3mzhav2sxn0c8ki5iipwp63cva-systemd-minimal-libs-254.6
  /nix/store/762lfw3pylbyqpvfx61ldivb0n68a7q3-libmnl-1.0.5
  /nix/store/7n7vhrxhlgr9qjr48zxwxmxm3d91x4s7-tcb-1.2
  /nix/store/84i8hby69rhzcpd8bb8gs2ffhcshc2gj-util-linux-2.39.2-lib
  /nix/store/8fmnax57pv1f2qnsx38ipkd7kp5b6ki6-dosfstools-4.2
  /nix/store/8nv450f5vysch3pv2fvmmfb241aziik3-libassuan-2.5.6
  /nix/store/90pxz1wkwlxd4abnjzbxz6ch25hxrcf6-libbpf-1.2.2
  /nix/store/98cclz91d6mk2sh1dmvn9n34wca5bc2r-oniguruma-6.9.9-lib
  /nix/store/992jdjy03684w846fg0h2bldnjh9v7bv-libcap-ng-0.8.3
  /nix/store/9k3sphy2cwryxq1wpkmfprykg3gw4hyn-popt-1.19
  /nix/store/9mr0pvccggsgdidpi80nyl8594mkkbza-libevent-2.1.12
  /nix/store/9skmhnmgrxqnq5k64n1gn4mmxd0gw5ry-glibc-2.38-27-getent
  /nix/store/a5gbjpq7fbvrxgj81a44nf08ab3rjv5l-util-linux-minimal-2.39.2-mount
  /nix/store/b8rdg9m7rwka4nwn3rw2xb60hqcbnzra-p11-kit-0.25.3
  /nix/store/bh4lz3c2n3qfbm2hhwjhnqcaxcjs2sm8-glibc-2.38-27-bin
  /nix/store/cg2sr37b48p5djkf91jai2c6kigphvvp-util-linux-minimal-2.39.2-lib
  /nix/store/d8d9599pqibwmil6cai7czqpmzqcv7ha-gptfdisk-1.0.9
  /nix/store/dprzgza01whqv34apwvn16ax0qk5wvc1-getent-glibc-2.38-27
  /nix/store/dz5hf9dx2660d1cqdz5a5kg3iihzkfky-jq-1.7-doc
  /nix/store/h882slh5qapvd13cmdn27r3pgk3j7iyw-libgpg-error-1.47
  /nix/store/h9v5cvh23sbhxhsdksgp0vz96pd7q25i-libnetfilter_conntrack-1.0.9
  /nix/store/iglb2fmla149fbprj6fb18swfls033q4-libseccomp-2.5.4-lib
  /nix/store/iidxwcyp8pqhrq3iji17shs4m6gin0kv-systemd-254.6
  /nix/store/iwsavni1qjnrx4gx52l1d7zc67l4wjci-gnutls-3.8.2
  /nix/store/j7fnaznwcxvd6sh5hivcdxhsfi834g9d-util-linux-2.39.2-mount
  /nix/store/k0dkcbfnaq3jb07qamafazsw862xb475-lvm2-2.03.22-lib
  /nix/store/l6l2q7c6xvlb44rxbkpajssz6cma2hwd-bash-interactive-5.2-p21
  /nix/store/lbydzhxxywg3kk4y34yl0f09nwwxiik5-gmp-with-cxx-6.3.0
  /nix/store/lmj8lfkd8h448grf1nf92lsm5gm2fnf6-libcap-2.69-lib
  /nix/store/lmyd230scwqrkym7f5b5y74gn1lmq4gr-util-linux-minimal-2.39.2-login
  /nix/store/lzd1lanwicgs3k4wnl7pms0w7dbi10mk-nettle-3.9.1
  /nix/store/mfcqapbv8qls5fdyk7jp52g8yjhh1yq7-e2fsprogs-1.47.0
  /nix/store/mjsfijxvrynlznpdyqwvgg6mzg4w4wh7-libtasn1-4.19.0
  /nix/store/mv03xraqqqpgckj70cfjrv0ps6cg7a0f-libnftnl-1.2.6
  /nix/store/p5gkxx84ck6gs5iy5hi9caimxl3r8zpj-libmd-1.1.0
  /nix/store/p7ic21469hc43byj4lzjlp7ksa5ni1jp-libcbor-unstable-2023-01-29
  /nix/store/pk2mck2nv2gmp0w7ra3nifvvj87w15s0-libfido2-1.14.0
  /nix/store/ps2ml653c5bxm5q18whsg3rdvhvxray8-pcsclite-1.9.5
  /nix/store/qir6rqd5jl9gl6h64n3729g76xkvf65d-libgcrypt-1.10.3
  /nix/store/qp6kq2m0g4ml94jrb6kb0yy4x1z8wj35-kbd-2.6.3
  /nix/store/svqgxg9q92mw6dpfy2r94pysq1vjn30h-systemd-minimal-254.6
  /nix/store/v818n6imwi4n6gc4qlyyld0n25bf38gs-kmod-31
  /nix/store/vvmm0a9g7wygwzw3rvvxjh1mi46lnw7c-util-linux-minimal-2.39.2-swap
  /nix/store/vwpki5nihab5yssssd54kd8f5c32sg7f-lz4-1.9.4
  /nix/store/w0rr0h1v1lfbjhm4blaqnkzi18wqcqvm-iptables-1.8.10
  /nix/store/wp5c5sjlvm6nxavvs1prdnw5n41mgciq-libapparmor-3.1.6
  /nix/store/wplzchq27f03b0ccw84wnxqpspnixwal-zstd-1.5.5-bin
  /nix/store/x2p2v26yc23vn6xc9j1i8yvnqniwcp01-libargon2-20190702
  /nix/store/xdmynnfk2f5c8z39wrh7h216lhh91bjq-jq-1.7-bin
  /nix/store/xdrsf841kdlf95rxd3qy6yhi57s25krr-dns-root-data-2023-11-27
  /nix/store/y2j4jzz73h9z5w295jjhd8z3agy4aizq-libmicrohttpd-0.9.71
  /nix/store/y6rlcs6v3hjd090666g6yqdpc0wq9wgn-e2fsprogs-1.47.0-bin
  /nix/store/yf0nkhph494py6049fb9031ls332bprc-cryptsetup-2.6.1
  /nix/store/ys0bfhm36c2f3bzzgj82gn85cl52kggz-libnl-3.7.0
  /nix/store/z8cfxl3ywb5knpag542lk6i8gw2yljnm-util-linux-2.39.2-login
  /nix/store/zkgzs99lbmwpgkhqfg7ck0qnwy3dfsdr-kexec-tools-2.0.26
  /nix/store/znnb7n9m1pr4j3nb1mv9x2bpmb8lzsx9-tpm2-tss-4.0.1
copying path '/nix/store/4r1k85y1cp857sy6ndak6327gajqrg45-jq-1.7' from 'https://cache.nixos.org'...
copying path '/nix/store/2yxxbsgclg2fx2picgnfi3f4x1vglq3v-audit-3.1.2' from 'https://cache.nixos.org'...
copying path '/nix/store/l6l2q7c6xvlb44rxbkpajssz6cma2hwd-bash-interactive-5.2-p21' from 'https://cache.nixos.org'...
copying path '/nix/store/69jh5m8vlfifkrvzk3gwphfhbglv2a5z-db-4.8.30' from 'https://cache.nixos.org'...
copying path '/nix/store/xdrsf841kdlf95rxd3qy6yhi57s25krr-dns-root-data-2023-11-27' from 'https://cache.nixos.org'...
copying path '/nix/store/8fmnax57pv1f2qnsx38ipkd7kp5b6ki6-dosfstools-4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/5pzhzzncm5w39hrsd4g024y3lf85m3ww-elfutils-0.190' from 'https://cache.nixos.org'...
copying path '/nix/store/bh4lz3c2n3qfbm2hhwjhnqcaxcjs2sm8-glibc-2.38-27-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/9skmhnmgrxqnq5k64n1gn4mmxd0gw5ry-glibc-2.38-27-getent' from 'https://cache.nixos.org'...
copying path '/nix/store/lbydzhxxywg3kk4y34yl0f09nwwxiik5-gmp-with-cxx-6.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/dprzgza01whqv34apwvn16ax0qk5wvc1-getent-glibc-2.38-27' from 'https://cache.nixos.org'...
copying path '/nix/store/dz5hf9dx2660d1cqdz5a5kg3iihzkfky-jq-1.7-doc' from 'https://cache.nixos.org'...
copying path '/nix/store/5ri38niq6c90g33i8dw8wd5h16ab2l9w-jq-1.7-man' from 'https://cache.nixos.org'...
copying path '/nix/store/3yd7qdyl9ix3layh3dlg99qmr9y1pqsq-json-c-0.16' from 'https://cache.nixos.org'...
copying path '/nix/store/zkgzs99lbmwpgkhqfg7ck0qnwy3dfsdr-kexec-tools-2.0.26' from 'https://cache.nixos.org'...
copying path '/nix/store/v818n6imwi4n6gc4qlyyld0n25bf38gs-kmod-31' from 'https://cache.nixos.org'...
copying path '/nix/store/5rnczbi8hgzj79bgh23kzmq9aaljgnz1-kmod-31-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/wp5c5sjlvm6nxavvs1prdnw5n41mgciq-libapparmor-3.1.6' from 'https://cache.nixos.org'...
copying path '/nix/store/x2p2v26yc23vn6xc9j1i8yvnqniwcp01-libargon2-20190702' from 'https://cache.nixos.org'...
copying path '/nix/store/90pxz1wkwlxd4abnjzbxz6ch25hxrcf6-libbpf-1.2.2' from 'https://cache.nixos.org'...
copying path '/nix/store/lmj8lfkd8h448grf1nf92lsm5gm2fnf6-libcap-2.69-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/992jdjy03684w846fg0h2bldnjh9v7bv-libcap-ng-0.8.3' from 'https://cache.nixos.org'...
copying path '/nix/store/p7ic21469hc43byj4lzjlp7ksa5ni1jp-libcbor-unstable-2023-01-29' from 'https://cache.nixos.org'...
copying path '/nix/store/9mr0pvccggsgdidpi80nyl8594mkkbza-libevent-2.1.12' from 'https://cache.nixos.org'...
copying path '/nix/store/h882slh5qapvd13cmdn27r3pgk3j7iyw-libgpg-error-1.47' from 'https://cache.nixos.org'...
copying path '/nix/store/p5gkxx84ck6gs5iy5hi9caimxl3r8zpj-libmd-1.1.0' from 'https://cache.nixos.org'...
copying path '/nix/store/8nv450f5vysch3pv2fvmmfb241aziik3-libassuan-2.5.6' from 'https://cache.nixos.org'...
copying path '/nix/store/3glzfq0m5pkjywc3a5kk1zi8p6dh35l9-libbsd-unstable-2023-04-29' from 'https://cache.nixos.org'...
copying path '/nix/store/qir6rqd5jl9gl6h64n3729g76xkvf65d-libgcrypt-1.10.3' from 'https://cache.nixos.org'...
copying path '/nix/store/762lfw3pylbyqpvfx61ldivb0n68a7q3-libmnl-1.0.5' from 'https://cache.nixos.org'...
copying path '/nix/store/207d2mg23g6c28f8cpb471a9mc4h44iw-libnfnetlink-1.0.2' from 'https://cache.nixos.org'...
copying path '/nix/store/mv03xraqqqpgckj70cfjrv0ps6cg7a0f-libnftnl-1.2.6' from 'https://cache.nixos.org'...
copying path '/nix/store/h9v5cvh23sbhxhsdksgp0vz96pd7q25i-libnetfilter_conntrack-1.0.9' from 'https://cache.nixos.org'...
copying path '/nix/store/ys0bfhm36c2f3bzzgj82gn85cl52kggz-libnl-3.7.0' from 'https://cache.nixos.org'...
copying path '/nix/store/iglb2fmla149fbprj6fb18swfls033q4-libseccomp-2.5.4-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/4qlgccn3g3mfw3i0bjibkqhq59cs0rdm-libpcap-1.10.4' from 'https://cache.nixos.org'...
copying path '/nix/store/mjsfijxvrynlznpdyqwvgg6mzg4w4wh7-libtasn1-4.19.0' from 'https://cache.nixos.org'...
copying path '/nix/store/w0rr0h1v1lfbjhm4blaqnkzi18wqcqvm-iptables-1.8.10' from 'https://cache.nixos.org'...
copying path '/nix/store/5pwqfff4cmk3f0w6qni8p6g3ja5diw1k-linux-pam-1.5.2' from 'https://cache.nixos.org'...
copying path '/nix/store/vwpki5nihab5yssssd54kd8f5c32sg7f-lz4-1.9.4' from 'https://cache.nixos.org'...
copying path '/nix/store/lzd1lanwicgs3k4wnl7pms0w7dbi10mk-nettle-3.9.1' from 'https://cache.nixos.org'...
copying path '/nix/store/15wap48wv4rdm1jasvlncs7ivg8f3922-npth-1.6' from 'https://cache.nixos.org'...
copying path '/nix/store/98cclz91d6mk2sh1dmvn9n34wca5bc2r-oniguruma-6.9.9-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/16mv7ipba73qn6aads1r2x3vm11bq12x-gnupg-2.4.1' from 'https://cache.nixos.org'...
copying path '/nix/store/072kqjmbhfrmziz5hbs499h6czw7w4pj-jq-1.7-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/b8rdg9m7rwka4nwn3rw2xb60hqcbnzra-p11-kit-0.25.3' from 'https://cache.nixos.org'...
copying path '/nix/store/xdmynnfk2f5c8z39wrh7h216lhh91bjq-jq-1.7-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/ps2ml653c5bxm5q18whsg3rdvhvxray8-pcsclite-1.9.5' from 'https://cache.nixos.org'...
copying path '/nix/store/9k3sphy2cwryxq1wpkmfprykg3gw4hyn-popt-1.19' from 'https://cache.nixos.org'...
copying path '/nix/store/6ivcrp3mzhav2sxn0c8ki5iipwp63cva-systemd-minimal-libs-254.6' from 'https://cache.nixos.org'...
copying path '/nix/store/7n7vhrxhlgr9qjr48zxwxmxm3d91x4s7-tcb-1.2' from 'https://cache.nixos.org'...
copying path '/nix/store/pk2mck2nv2gmp0w7ra3nifvvj87w15s0-libfido2-1.14.0' from 'https://cache.nixos.org'...
copying path '/nix/store/k0dkcbfnaq3jb07qamafazsw862xb475-lvm2-2.03.22-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/3qkckv4scqwzf36nl8dy8rhx0j9mhh3d-shadow-4.14.2' from 'https://cache.nixos.org'...
copying path '/nix/store/43pl823dyb6g2i58rf5v71yszk6abfrc-unbound-1.19.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/84i8hby69rhzcpd8bb8gs2ffhcshc2gj-util-linux-2.39.2-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/iwsavni1qjnrx4gx52l1d7zc67l4wjci-gnutls-3.8.2' from 'https://cache.nixos.org'...
copying path '/nix/store/4i1p5vr6iai2br2kq8d7mhwlllivf6g8-parted-3.6' from 'https://cache.nixos.org'...
copying path '/nix/store/y2j4jzz73h9z5w295jjhd8z3agy4aizq-libmicrohttpd-0.9.71' from 'https://cache.nixos.org'...
copying path '/nix/store/z8cfxl3ywb5knpag542lk6i8gw2yljnm-util-linux-2.39.2-login' from 'https://cache.nixos.org'...
copying path '/nix/store/j7fnaznwcxvd6sh5hivcdxhsfi834g9d-util-linux-2.39.2-mount' from 'https://cache.nixos.org'...
copying path '/nix/store/35p0hz5k0fl2fgcgdjxi138xix4bl299-util-linux-2.39.2-swap' from 'https://cache.nixos.org'...
copying path '/nix/store/cg2sr37b48p5djkf91jai2c6kigphvvp-util-linux-minimal-2.39.2-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/lmyd230scwqrkym7f5b5y74gn1lmq4gr-util-linux-minimal-2.39.2-login' from 'https://cache.nixos.org'...
copying path '/nix/store/yf0nkhph494py6049fb9031ls332bprc-cryptsetup-2.6.1' from 'https://cache.nixos.org'...
copying path '/nix/store/mfcqapbv8qls5fdyk7jp52g8yjhh1yq7-e2fsprogs-1.47.0' from 'https://cache.nixos.org'...
copying path '/nix/store/d8d9599pqibwmil6cai7czqpmzqcv7ha-gptfdisk-1.0.9' from 'https://cache.nixos.org'...
copying path '/nix/store/y6rlcs6v3hjd090666g6yqdpc0wq9wgn-e2fsprogs-1.47.0-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/znnb7n9m1pr4j3nb1mv9x2bpmb8lzsx9-tpm2-tss-4.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/a5gbjpq7fbvrxgj81a44nf08ab3rjv5l-util-linux-minimal-2.39.2-mount' from 'https://cache.nixos.org'...
copying path '/nix/store/vvmm0a9g7wygwzw3rvvxjh1mi46lnw7c-util-linux-minimal-2.39.2-swap' from 'https://cache.nixos.org'...
copying path '/nix/store/wplzchq27f03b0ccw84wnxqpspnixwal-zstd-1.5.5-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/qp6kq2m0g4ml94jrb6kb0yy4x1z8wj35-kbd-2.6.3' from 'https://cache.nixos.org'...
copying path '/nix/store/iidxwcyp8pqhrq3iji17shs4m6gin0kv-systemd-254.6' from 'https://cache.nixos.org'...
copying path '/nix/store/svqgxg9q92mw6dpfy2r94pysq1vjn30h-systemd-minimal-254.6' from 'https://cache.nixos.org'...
copying path '/nix/store/4h02i6q6hfvp5avk97lympf43zvnk2d0-util-linux-2.39.2-bin' from 'https://cache.nixos.org'...
building '/nix/store/zq74n48ndl7wvrl3rq027aja6dikhiqi-disko.drv'...
umount: /mnt: not found
++ realpath /dev/xvda
+ disk=/dev/xvda
+ lsblk -a -f
NAME    FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
xvda
└─xvda1 ext4   1.0   nixos f222513b-ded1-49fa-b591-20ce86a2fe7f   20.1G    13% /nix/store
                                                                               /
+ bash -x
+ lsblk --output-all --json
++ dirname /nix/store/f722nll5akkkv155midnwli1jrrqq2bk-disk-deactivate/disk-deactivate
+ jq -r --arg disk_to_clear /dev/xvda -f /nix/store/f722nll5akkkv155midnwli1jrrqq2bk-disk-deactivate/disk-deactivate.jq
+ set -fu
+ umount -R /nix/store
umount: /nix/store: target is busy.
+ umount -R /
umount: /dev/pts: target is busy.
+ wipefs --all -f /dev/xvda1
/dev/xvda1: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
++ sed -nr 's/ +name: '\''(.*)'\''/\1/p'
++ zdb -l /dev/xvda
bash: line 5: zdb: command not found
+ zpool=
+ [[ -n '' ]]
+ unset zpool
+ wipefs --all -f /dev/xvda
/dev/xvda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
+ dd if=/dev/zero of=/dev/xvda bs=440 count=1
1+0 records in
1+0 records out
440 bytes copied, 0.00373755 s, 118 kB/s
+ lsblk -a -f
NAME    FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
xvda
└─xvda1 ext4   1.0   nixos f222513b-ded1-49fa-b591-20ce86a2fe7f   20.1G    13% /nix/store
                                                                               /
++ mktemp -d
+ disko_devices_dir=/tmp/tmp.I3HOuftgoz
+ trap 'rm -rf "$disko_devices_dir"' EXIT
+ mkdir -p /tmp/tmp.I3HOuftgoz
+ device=/dev/xvda
+ imageSize=2G
+ name=vdb
+ type=disk
+ device=/dev/xvda
+ type=gpt
+ sgdisk --set-alignment=2048 --align-end --new=1:0:+100M --change-name=1:disk-vdb-ESP --typecode=1:EF00 /dev/xvda
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
+ partprobe /dev/xvda
/nix/store/k4rgz2yf5f04iplv4i5pizwsm3wnx24c-disko: line 82:  1809 Bus error               partprobe /dev/xvda
+ rm -rf /tmp/tmp.I3HOuftgoz
/nix/store/k4rgz2yf5f04iplv4i5pizwsm3wnx24c-disko: line 1: rm: command not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.