Skip to content

NixOS ❄️ Configuration dedicated to computer science learning

License

Notifications You must be signed in to change notification settings

Altaks/NixOS-polarflake

Repository files navigation

❄️ Polarflake

Polarflake is a NixOS configuration dedicated to computer learning. This configuration was created specifically for the IUT in La Rochelle, France.

It provides all the tools, software, services and systems needed to follow the FullStack Developer course without missing a single tool.

The aim of this NixOS configuration is to provide new students with a Linux configuration that is quick and easy to install, so that they are ready for the next three years.

Why NixOS ?

NixOS is an operating system based on the Nix package manager, it provides a way for a user to describe it's system's configuration declarativly and avoid long hours of diving into obscure linux commands to copy a Linux configuration from one computer to another

More information about this here : ❄️ Nix & NixOS ❄️

Configuration contents

This NixOS configuration provides to following content to the user's system :

  • 🛠️ Programming tools for C, C++, Java, JavaScript, TypeScript, Flutter/Dart, Rust, Swift, Python, associated debugging tools & Jetbrains IDEs
  • 📈 Math related tools (Scilab, Geogebra 6, ZeGrapher)
  • 🧰 SysAdmin utilities (compression, Network sniffers, partitions managers, SSH clients, Taskfiles, Justfiles, Git, GitHub CLI, etc...)
  • 🖌️ Developer UI/UX software (Figma, GIMP, Krita)
  • 🚀 Bootloader configuration (GRUB 2, Grub themes, Encrypted partitions support)
  • 👾 Nerd fonts
  • 🛡️ Network, Firewall configuration, Linux Hotspot
  • 🔌 Virtualization systems (Docker, Podman, VirtualBox, Vagrant, Libvirtd)
  • 🖥️ Gnome configuration w/ extensions
  • 💾 Terminal config & utils (OhMyPosh, FZF, Fastfetch & zoxide)
  • 👤 Team work tools (Teams, Slack, Discord, etc...)

Tip

This configuration is set to apply the 🇫🇷 fr_FR configuration both for the keyboard & the system's language. You can change it in the modules/locales.nix file before installing the configuration.

Warning

The base configuration available on the main branch does not provide any graphics driver. For those who want their graphic driver to be installed right away, please refer to the following :

Nvidia
AMD
Dedicated GPU
Dedicated GPU Integrated GPU
Stable
graphics/nvidia/dedicated/stable Work in progress Radeon graphics/amd/integrated
Legacy driver (390) graphics/nvidia/dedicated/legacy_390 Southern Island
Legacy driver (370) graphics/nvidia/dedicated/legacy_370 Sea Island
Legacy driver (340) graphics/nvidia/dedicated/legacy_340

Nvidia users can refer to the following registry : https://www.nvidia.com/en-us/drivers/unix/legacy-gpu/ to determine whether or not their GPU is considered legacy by Nvidia

AMD gpu users can refer to the following links : https://en.wikipedia.org/wiki/Radeon_HD_8000_series , https://en.wikipedia.org/wiki/Radeon_HD_7000_series to determine their GPU category name

Installation

To install this configuration, you first need to install NixOS yourself

After that, you will need Git to clone the configuration easily. You can temporarily install it using the following command :

nix-shell -p git

Then, within the freshly created shell, start installing this configuration by cloning the configuration files :

# Clone the configuration on your machine
git clone https://github.com/Altaks/NixOS-polarflake

Important

For those who want to get a specific branch to install their drivers at the same time, use the following command instead:

git clone https://github.com/Altaks/NixOS-polarflake -b <branch> 

Where the <branch> argument must be replaced with the needed branch name, for example for an Nvidia RTX you would use the git clone https://github.com/Altaks/NixOS-polarflake -b graphics/nvidia/dedicated/stable command.

After cloning the configuration, you only need to execute these commands :

# Warp into the configuration folder
cd NixOS-polarflake

# Install the configuration
# This will ask for sudo mode access. 
./install.sh

Caution

Use Ctrl + Z to cancel the installation. If you stopped the script during the generation build/switch phase, you might encounter bugs/crashes/corrupted files.

Once the script ends, you've installed the configuration, the last thing you need to do is to reboot your system, using the sudo reboot now command or the UI.

Upon rebooting your system, make sure your new first boot entry in your BIOS/UEFI is set on NixOS boot (which corresponds to GRUB) and not Linux Boot Manager (which corresponds to system-boot, the default installed bootloader which won't boot onto the right configuration)

Important

Updates :

Once you've installed the configuration, you won't get updates without re-executing the ./install.sh script. The system will create a new generation providing newer versions of the software and use them instead of the previously installed versions.

If you want the updated version of this configuration and not only the software within it, simply git pull in this folder and you'll be able to fetch the new configuration if there's any new content

Removing previous generations :

During a system rebuild, NixOS keeps the old configuration in a generation, that stays on your PC until you tell the OS to remove the fallback generations. These generation take up a lot of storage capacity, because there are copies/duplicates of the same software libraries etc...

You can earn your storage back in four different ways :

  • The main way is using the sudo nix-collect-garbage command that will delete every generation and requires you to rebuild your system once it's finished. You can rebuild it using the ./install.sh script or the sudo nixos-rebuild switch command. (Source)

  • The next most used way is to use the nix-store --optimise -v command, which will create internal symlinks in the /nix/store folder, that stores every software installed on your system. It removes duplicates and keeps only one instance of a software version. (Source)

  • Modifying this project configuration.nix and adding the following : nix.settings.auto-optimise-store = true; to the file which will make NixOS optimize the store during the system rebuild. Then reinstall the configuration and reboot. (Source)

  • Modifying this project configuration.nix and adding the following nix.optimise.automatic = true; which will make NixOS optimize the Nix store during uptime. Then reinstall the configuration and reboot. (Source)

Important

Using backups

This installation scripts generates backups of generations between switches, to avoid the pain of changing something and it wrecks the whole configuration. In case you've changed something in the configuration and failed to reinstall it, you can reinstall a backup using the following method :

Backup of the system configuration :

# Warp into the system root folder
cd /

# Clear the NixOS configuration folder before installing the backup 
sudo rm -rf /etc/nixos/

# Extracting the configuration backup, since the installation script keeps the absolute paths when creating backups. 
sudo tar -Jxvf /etc/nixos_backups/backup_<timestamp>.tar.xz

Backup of the custom software configurations :

# Warp into the system root folder
cd /

# Clear the system configurations folder before installing the backup 
sudo rm -rf /etc/nixos/

# Extracting the softawre configurations backup, since the installation script keeps the absolute paths when creating backups
sudo tar -Jxvf /etc/.dotfiles_backups/backup_<timestamp>.tar.xz

The backup names use the pattern : backup_YYYYMMDD_HHMMSS.tar.xz so a backup named backup_20241231_002816.tar.xz would have been created the 31th of December 2024 at 00:28:16 in the 24 hours format.

Switching the system on the backup :

sudo nixos-rebuild switch --upgrade-all

Once this command is finished, reboot using the sudo reboot now command or the system's UI.

Removing previous configuration backups :

If you want to delete the backups whose been generated, in order to earn some more storage space, you only need to clear the following folders :

  • System configurations backups : /etc/nixos_backups/ using sudo rm -rf /etc/nixos_backups/
  • Custom configurations backups : ~/.dotfiles_backups/ using sudo rm -rf ~/.dotfiles_backups/

Sources

Official sources :

Community managed sources :

Contributions

Alt

Contributing

In order to contribute to this project, you can fork the project and create pull request against the main repository.

Keep in mind that this configuration is dedicated to computer science learning, and doesn't want any user-specific configuration.

License

This project is licensed under the MIT License

About

NixOS ❄️ Configuration dedicated to computer science learning

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published