Creating a GUIX System inside a GUIX Mother System

Mother System

      avk@melina ~$ neofetch
         ..                             `.   avk@melina
         `--..```..`           `..```..--`   ----------
           .-:///-:::.       `-:::///:-.     OS: Guix System x86_64
              ````.:::`     `:::.````        Host: 20L6SB1700 ThinkPad T480
                   -//:`    -::-             Kernel: 6.16.11
                    ://:   -::-              Uptime: 6 hours, 8 mins
                    `///- .:::`              Packages: 192 (guix-system), 6 (guix-user)
                     -+++-:::.               Shell: bash 5.2.37
                      :+/:::-                Resolution: 1920x1080
                      `-....`                DE: i3
                                             Icons: breeze-dark [GTK2/3]
                                             Terminal: terminology
                                             CPU: Intel i7-8550U (8) @ 4.000GHz
                                             GPU: Intel UHD Graphics 620
                                             Memory: 3188MiB / 31859MiB
    

create a folder to work in the new system

mkdir gondolinium
cd gondolinium

inside the folder, we must create a file called manifest.scm this file will define the new guix child system

touch manifest.scm

enter to the file for editing

vim ./manifest.scm

write this into manifest.scm

      (use-modules (gnu))
      (operating-system
        (host-name "valinor-one") ;;any name you want
        (timezone "America/Santiago") ;; any timezone you need
        (locale "en_US.utf8") 
        (bootloader (bootloader-configuration
      	        (bootloader grub-bootloader)
      	        (targets (list "/dev/sdX"))))
        (file-systems %base-file-systems)
        (users %base-user-accounts)
        (packages %base-packages)
      )    
    

now, inside the folder where you created this file, execute the following line

    guix system container --network manifest.scm
  

GUIX Mother will tell you the location of the new GUIX Child System Container

    /gnu/store/hjzj37lyq4mj9xz74a4n3ysyy87p2vcl-run-container
  

execute that file as root

avk@melina ~/Gondolinium$ sudo /gnu/store/hjzj37lyq4mj9xz74a4n3ysyy87p2vcl-run-container
      Password:
      system container is running as PID 14985
      WARNING: (guile-user): imported module (guix build utils) overrides core binding `delete'
      Run 'sudo guix container exec 14985 /run/current-system/profile/bin/bash --login'
      or run 'sudo nsenter -a -t 14985' to get a shell into it.
      
      WARNING: (guile-user): imported module (guix build utils) overrides core binding `delete'
      making '/gnu/store/23iyhpbbmdbs88rg3cx5hnkfx4c0g85j-system' the current system...
      populating /etc from /gnu/store/3yvrb7sqnl2hmaqf35xrxz788xjsm2k5-etc...
      setting up privileged programs in '/run/privileged/bin'...
      Please wait while gathering entropy to generate the key pair;
      this may take time...
      shepherd[1]: GNU Shepherd 1.0.7 (Guile 3.0.9, Fibers 1.4.1, x86_64-unknown-linux-gnu)
      shepherd[1]: Starting service root...
      shepherd[1]: Service root started.
      shepherd[1]: Service root running with value <<process>id: 1 command: #f>.
      shepherd[1]: Service root has been started.
      shepherd[1]: starting services...
      shepherd[1]: Configuration successfully loaded from '/gnu/store/j9pyxi54zlk1fxqvv9hixlxp5f7fnvgi-shepherd.conf'.
      shepherd[1]: Starting service user-file-systems...
      shepherd[1]: Starting service root-file-system...
      shepherd[1]: Starting service host-name...
      shepherd[1]: Starting service pam...
      shepherd[1]: Starting service sysctl...
      shepherd[1]: Starting service log-rotation...
      shepherd[1]: Starting service loopback...
      shepherd[1]: Service user-file-systems started.
      shepherd[1]: Service root-file-system started.
      shepherd[1]: Service host-name started.
      shepherd[1]: Service pam started.
      shepherd[1]: Service log-rotation started.
  

enter into the child system container

      sudo guix container exec 14985 /run/current-system/profile/bin/bash --login
      Password:
      root@valinor-one /#