Giter VIP home page Giter VIP logo

Comments (5)

Mic92 avatar Mic92 commented on May 23, 2024

I am not 100% sure I get your intention but you can build parts of your nixos system like this:

$ nix repl
Welcome to Nix 2.10.3. Type :? for he
nix-repl> :lf github:Mic92/dotfiles
nix-repl> :b nixosConfigurations.<PRESS_TAB> ...
nix-repl> :b nixosConfigurations.turingmachine.config.system.build.vm

# same as
$ nix build github:Mic92/dotfiles#nixosConfigurations.turingmachine.config.system.build.vm

This assumes that whatever is part of your nixos system is also exposed as an option.
If you want to build tsp-create from your nixos configuration you might need to expose it through a nixos module option:

{
  options.myoption = mkOption {                
     type = types.str;                                     
     default = tsp-create;
  };                                                      
}
$ nix build github:Mic92/dotfiles#nixosConfigurations.turingmachine.config.myoption

However it seems far easier to just expose it through a packages flake output and than just use.

nix run github:Mic92/dotfiles#tsp-create

Notice that when you use pkgs.callPackage you can reuse your partitioning script in both your nixos configuration and in packages.

I am going to close this issue, since it is not disko related. But you can continue to ask questions.

from disko.

Baitinq avatar Baitinq commented on May 23, 2024

Thank you so much for your help, I'll definitely try your suggestion when I get access to my pc.

However it seems far easier to just expose it through a packages flake output and than just use.

Definitely, the problem is that I have three hosts and I wouldnt want to have to expose three different new outputs for each of their disko configurations. Do you know of any way to abstract this?

from disko.

Baitinq avatar Baitinq commented on May 23, 2024

@Mic92 Right now Im trying to follow your option recommendation. This is it (currently a WIP) in case anyone wants to take a look in the future for documentation purposes. (Baitinq/nixos-config#2)

from disko.

Baitinq avatar Baitinq commented on May 23, 2024

@Mic92 Im done with my implementation, maybe we should consider adding some documentation on how this would be achieved? @Lassulus (As it seems like it would be one of the main use cases for disko) For reference (https://github.com/Baitinq/nixos-config/blob/master/hosts/luna/disks.nix) (nix run .#nixosConfigurations.luna.config.disko-create) (nix run .#nixosConfigurations.luna.config.disko-mount)

from disko.

Mic92 avatar Mic92 commented on May 23, 2024

Yeah, looks a nice example.

from disko.

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.