Giter VIP home page Giter VIP logo

Comments (11)

dustinlyons avatar dustinlyons commented on May 2, 2024 1

Hi, yes the current scripts will just do one partition. Before running the commands however you can swap out the disk-config with something like mine:

https://github.com/dustinlyons/nixos-config/blob/main/modules/nixos/disk-config.nix

_: {
  # This is the disk layout for a dual-boot system with Windows 10.
  disko.devices = {
    disk = {
      nvme0n1 = {
        device = "/dev/nvme0n1";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";  # EFI partition type.
              size = "500M";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            root = {
              start = "901G";  # Start immediately after Windows partition.
              size = "100%";  # Takes the remaining half of the disk space.
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

I had to first install Windows on the drive, then run the NixOS installer. I also had to manually add the place on the drive NixOS should start (901GB for me). Here is some info on that:

https://chat.openai.com/share/80ef0023-f68b-47af-bd6e-824861deca8e

Before running the final 3. Install configuration step, you'll have to swap out the disk-config in modules for the one you see above, and custom to your particular drive. Unfortunately I can't support this any further as it's not part of the standard install, but hopefully this info is enough.

  1. Secrets just mean you can keep sensitive data in your Nix configuration, like keys, certs, etc. So that when you install it, you don't have to manually set that stuff up. It's helpful to have a configuration that just "works out of the box".

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024 1

If you're just starting out I would not worry about secrets for now, just get a config without secrets working first and understand it.

It's not that big of a deal to manually copy over some keys after the install is done.

NixOS uses systemd-boot with UEFI

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024 1

Also

nix run .#build-switch -- what does it do?

So Nix works by building everything as an isolated package on its own volume (the Nix "Store").

So when you build your configuration and switch to it, you're saying to your machine:

  • create everything I've defined in my config as a package in the Nix store, referencing its build instructions on how to build it (usually defined in nixpkgs), and then
  • switch all my local packagss to a symlink that references the package in the Nix Store, instead of the actual package on my drive somewhere (probably installed by brew or its own installer).

nix flake update -- this updates the system right?

Yes, it says, update all inputs defined in the flake (nix-darwin, nixpkgs, etc) to the latest git hash.

Doesn't build or switch anything, but next time you build you'll grab the latest flake inputs.

editing your system configuration

building the (system closure)

creating and switching to it (i.e creating a new generation)

What do you mean by it?

Basically what I'm discussing above.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024 1

The README for this repository outlines a set of steps to use a template for NixOS. Once you've followed those instructions and created your Nix configuration, before running nix run #build-switch you should swap out the disk-config.nix located at modules/nixos/disk-config.nix with the one you created.

from nixos-config.

Rafi1018 avatar Rafi1018 commented on May 2, 2024

Hi, yes the current scripts will just do one partition. Before running the commands however you can swap out the disk-config with something like mine:

https://github.com/dustinlyons/nixos-config/blob/main/modules/nixos/disk-config.nix

_: {
  # This is the disk layout for a dual-boot system with Windows 10.
  disko.devices = {
    disk = {
      nvme0n1 = {
        device = "/dev/nvme0n1";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";  # EFI partition type.
              size = "500M";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            root = {
              start = "901G";  # Start immediately after Windows partition.
              size = "100%";  # Takes the remaining half of the disk space.
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

I had to first install Windows on the drive, then run the NixOS installer. I also had to manually add the place on the drive NixOS should start (901GB for me). Here is some info on that:

https://chat.openai.com/share/80ef0023-f68b-47af-bd6e-824861deca8e

Before running the final 3. Install configuration step, you'll have to swap out the disk-config in modules for the one you see above, and custom to your particular drive. Unfortunately I can't support this any further as it's not part of the standard install, but hopefully this info is enough.

2. Secrets just mean you can keep sensitive data in your Nix configuration, like keys, certs, etc. So that when you install it, you don't have to manually set that stuff up. It's helpful to have a configuration that just "works out of the box".
  1. Gotcha thanks I think I can figure it out.
  2. so to get that out of the box experience I have to do all the installation steps?

And also what bootloader it uses?

from nixos-config.

Rafi1018 avatar Rafi1018 commented on May 2, 2024

Also

nix run .#build-switch -- what does it do?

nix flake update -- this updates the system right?

editing your system configuration
building the (system closure)
creating and switching to it (i.e creating a new generation)

What do you mean by it?

from nixos-config.

Rafi1018 avatar Rafi1018 commented on May 2, 2024

Also
nix run .#build-switch -- what does it do?

So Nix works by building everything as an isolated package on its own volume (the Nix "Store").

So when you build your configuration and switch to it, you're saying to your machine:

* create everything I've defined in my config as a package in the Nix store, referencing its build instructions on how to build it (usually defined in nixpkgs), and then

* switch all my local packagss to a symlink that references the package in the Nix Store, instead of the actual package on my drive somewhere (probably installed by brew or its own installer).

nix flake update -- this updates the system right?

Yes, it says, update all inputs defined in the flake (nix-darwin, nixpkgs, etc) to the latest git hash.

Doesn't build or switch anything, but next time you build you'll grab the latest flake inputs.

editing your system configuration

building the (system closure)

creating and switching to it (i.e creating a new generation)

What do you mean by it?

Basically what I'm discussing above.

Got it thanks

from nixos-config.

Rafi1018 avatar Rafi1018 commented on May 2, 2024

Hey @dustinlyons sorry just one last thing I have made the disk configuration now How do I implement it?

from nixos-config.

Rafi1018 avatar Rafi1018 commented on May 2, 2024

Here's the disk config I created btw if you can review it for me :)

#Disk configuration for dual-booting NixOS with Windows 10
  disko.devices = {
    disk = {
      nvme0n1 = {
        device = "/dev/nvme0n1";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            # Windows partitions (existing)
            ESP = {
              type = "EF00";  # EFI partition type
              size = "100M";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            # NixOS partitions
            swap = {
              start = "373.766G";  # start point for swap
              size = "40G";
              content = {
                type = "swap";
              };
            };
            root = {
              start = "413.766G";  # After swap partition
              size = "100%";  # Take all remaining space
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Look in your modules/nixos directory. You should see a disk-config.nix file. Replace it with your configuration above.

from nixos-config.

Rafi1018 avatar Rafi1018 commented on May 2, 2024

Look in your modules/nixos directory. You should see a disk-config.nix file. Replace it with your configuration above.

Yes I meant then I have to create another repo then right? & does the disk-config look good?

from nixos-config.

Related Issues (20)

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.