Re: [Nix-dev] disk setup for nixos installation
aszlig writes: So you could use it, but it's not yet ready for being part of the nixos installation procedure. Here is the repository: https://github.com/aszlig/nixpart And it is in nixpkgs as well. Thank you very much. I have had a play, and it looks very helpful. There is one small problem though: I want to use the nilfs2 filesystem, and kickstart does not support it out of the box. Is there any way to pass some option to tell nixpart and kickstart that nilfs2 is a valid filesystem type ? When I specify a filesystem of type nilfs2 in the kickstart file, nixpart just ignores it (it does not even complain about it). If I change the filesystem type (e.g. to ext3), then nixpart will create it. Tim ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] disk setup for nixos installation
On Sun, Aug 18, 2013 at 07:16:15PM +0200, Aristid Breitkreuz wrote: I believe Aszlig had actually done some work on automated partitioning for Nixops, but I'm not sure how far from ready for primetime it is. Well, it works already but still uses Redhat/Fedoras Kickstart syntax as the input for the device tree. my plans for 1.0 would be to have a more native configuration using the XML-output from Nix directly for the device tree. (and especially because using Kickstart syntax involves some pretty nasty monkey-patching) So you could use it, but it's not yet ready for being part of the nixos installation procedure. Here is the repository: https://github.com/aszlig/nixpart And it is in nixpkgs as well. a! -- aszlig signature.asc Description: Digital signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] disk setup for nixos installation
Hi Tim, Generally, in NixOS we achieve effects outside of the store in a two-phase process: We have derivations to create data (config files, systemd units, shell scripts, etc.) in the store that represent the end state we want (including a master activation script that joins all the rest into a whole), and then a particular system state is transitioned to by running the top level script. Generally, these derivations are generated from a declarative specification made possible by a module system implemented purely in nix. We work hard to make the generated scripts idempotent, to make it possible to transition arbitrarily between system configurations, to make the system behave identically (for the relevant aspects) if a given system configuration is switched to after having previously used thousands of different configurations compared to if a system is freshly installed with that configuration. We try to minimize the chances of inconsistent system state. But generally these things are much harder to achieve when considering an operating system as a whole rather than an immutable file store, so guarantees are obviously less stringent than what we can offer in the nix store itself. Regarding your initial question: Already, we have NixOS modules to describe the partitions/filesystems in use. There's no fundamental reason why that information couldn't be used to automatically partition and install filesystems, at least in simple cases, but currently it is only used to manage fstab, determine which filesystems to boot from the initrd, etc. IMO an automated partitioning system based on a NixOS config would be an awesome addition. Cheers, Shea On 8/17/13 7:22 AM, Tim Barbour wrote: I would like to be able to boot from nixos installation media, then do automated partitioning, LVM setup and filesystem creation, then let nixops do the rest. What is the best way to automate partitioning, LVM setup and filesystem creation ? I wrote a shell script to do this (just for one disk, so far) using parted etc., but it looks ugly, and I wonder if it would be better done using nix. Does nix / nixos provide any existing mechanisms for doing this ? I am an experienced functional programmer (Haskell, not nix), but I don't understand how to do IO in nix. Perhaps I should be modelling the disk setup as the building of some derivations, but such derivations would not produce a result in the nix store. If I made them produce a result in the store, then the disk setup would be a side-effect, and not referentially transparent. I get the feeling that this is outside the scope of nix. Tim --- GPG public key available at: http://phasechangeit.com/~trb/gpg-key or http://subkeys.pgp.net:11371 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] disk setup for nixos installation
I believe Aszlig had actually done some work on automated partitioning for Nixops, but I'm not sure how far from ready for primetime it is. Cheers, Aristid 2013/8/18 Shea Levy s...@shealevy.com Hi Tim, Generally, in NixOS we achieve effects outside of the store in a two-phase process: We have derivations to create data (config files, systemd units, shell scripts, etc.) in the store that represent the end state we want (including a master activation script that joins all the rest into a whole), and then a particular system state is transitioned to by running the top level script. Generally, these derivations are generated from a declarative specification made possible by a module system implemented purely in nix. We work hard to make the generated scripts idempotent, to make it possible to transition arbitrarily between system configurations, to make the system behave identically (for the relevant aspects) if a given system configuration is switched to after having previously used thousands of different configurations compared to if a system is freshly installed with that configuration. We try to minimize the chances of inconsistent system state. But generally these things are much harder to achieve when considering an operating system as a whole rather than an immutable file store, so guarantees are obviously less stringent than what we can offer in the nix store itself. Regarding your initial question: Already, we have NixOS modules to describe the partitions/filesystems in use. There's no fundamental reason why that information couldn't be used to automatically partition and install filesystems, at least in simple cases, but currently it is only used to manage fstab, determine which filesystems to boot from the initrd, etc. IMO an automated partitioning system based on a NixOS config would be an awesome addition. Cheers, Shea On 8/17/13 7:22 AM, Tim Barbour wrote: I would like to be able to boot from nixos installation media, then do automated partitioning, LVM setup and filesystem creation, then let nixops do the rest. What is the best way to automate partitioning, LVM setup and filesystem creation ? I wrote a shell script to do this (just for one disk, so far) using parted etc., but it looks ugly, and I wonder if it would be better done using nix. Does nix / nixos provide any existing mechanisms for doing this ? I am an experienced functional programmer (Haskell, not nix), but I don't understand how to do IO in nix. Perhaps I should be modelling the disk setup as the building of some derivations, but such derivations would not produce a result in the nix store. If I made them produce a result in the store, then the disk setup would be a side-effect, and not referentially transparent. I get the feeling that this is outside the scope of nix. Tim --- GPG public key available at: http://phasechangeit.com/~trb/gpg-key or http://subkeys.pgp.net:11371 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] disk setup for nixos installation
Excerpts from Aristid Breitkreuz's message of Sun Aug 18 19:16:15 +0200 2013: I believe Aszlig had actually done some work on automated partitioning for Nixops, but I'm not sure how far from ready for primetime it is. How to script partitionsing can be looked up in the test cases in nixos. Just grep for parted or such. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] disk setup for nixos installation
I would like to be able to boot from nixos installation media, then do automated partitioning, LVM setup and filesystem creation, then let nixops do the rest. What is the best way to automate partitioning, LVM setup and filesystem creation ? I wrote a shell script to do this (just for one disk, so far) using parted etc., but it looks ugly, and I wonder if it would be better done using nix. Does nix / nixos provide any existing mechanisms for doing this ? I am an experienced functional programmer (Haskell, not nix), but I don't understand how to do IO in nix. Perhaps I should be modelling the disk setup as the building of some derivations, but such derivations would not produce a result in the nix store. If I made them produce a result in the store, then the disk setup would be a side-effect, and not referentially transparent. I get the feeling that this is outside the scope of nix. Tim --- GPG public key available at: http://phasechangeit.com/~trb/gpg-key or http://subkeys.pgp.net:11371 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] disk setup for nixos installation
On further reflection, I think I see how it almost might work using derivations. Assume it is possible to have a derivation that is only considered to be built (hand-waving part here ...) if the required filesystem exists. Then that derivation depends on another that is only considered to be built if the necessary LVM volume exists, etc. . I still cannot see how to make the hand-waving part referentially transparent. I think nixos must have a solution to this problem, otherwise how can it install GRUB ? Tim ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] disk setup for nixos installation
I used something like this to generate an ISO image that would self-install: http://paste.ofcode.org/K9Haex6MiBxygqJDFXkSL7 On Sat, Aug 17, 2013 at 3:22 PM, Tim Barbour t...@categorical.net wrote: I would like to be able to boot from nixos installation media, then do automated partitioning, LVM setup and filesystem creation, then let nixops do the rest. What is the best way to automate partitioning, LVM setup and filesystem creation ? I wrote a shell script to do this (just for one disk, so far) using parted etc., but it looks ugly, and I wonder if it would be better done using nix. Does nix / nixos provide any existing mechanisms for doing this ? I am an experienced functional programmer (Haskell, not nix), but I don't understand how to do IO in nix. Perhaps I should be modelling the disk setup as the building of some derivations, but such derivations would not produce a result in the nix store. If I made them produce a result in the store, then the disk setup would be a side-effect, and not referentially transparent. I get the feeling that this is outside the scope of nix. Tim --- GPG public key available at: http://phasechangeit.com/~trb/gpg-key or http://subkeys.pgp.net:11371 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] disk setup for nixos installation
On further reflection, I think I see how it almost might work using derivations. Assume it is possible to have a derivation that is only considered to be built (hand-waving part here ...) if the required filesystem exists. Then that derivation depends on another that is only considered to be built if the necessary LVM volume exists, etc. . I still cannot see how to make the hand-waving part referentially transparent. I think nixos must have a solution to this problem, otherwise how can it install GRUB ? NixOS way is to generate the needed scripts (preferably, the scripts can be safely run the second time after success) and run them. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] disk setup for nixos installation
Well - the nixos isos ship with nixos-install. It should be easy to add a script which runs automatically on startup (creating llvm devices and so on) and runs the script afterwards. Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev