Skip to content

A Nix wrapper for the Argon40's case configuration scripts

Notifications You must be signed in to change notification settings

Guusvanmeerveld/argon40-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Argon40 scripts for NixOS

This flake aims to package the Argon40 install script for NixOS so that it can be easily installed on a Raspberry Pi running NixOS. The install script was written for Raspberry Pi OS and its derivatives and thus expects to be run in an FHS compliant environment. This flake was written using the install script as a main inspiration. Using this flake also has the advantage of declaritively specifying the fan speed mappings of the case, which is preferable when using NixOS. I personally have the Argon ONE M.2 Case for Raspberry Pi 4 and the Argon EON Pi NAS and have tested this flake on both.

Installation

With flakes

Add the following into the desired flake.nix file.

{
    inputs.argon40-nix.url = "github:guusvanmeerveld/argon40-nix";
}

Usage

Module import

Simply import the NixOS module as follows:

{ inputs, ... }: {
    imports = [inputs.argon40-nix.nixosModules.default];
}

Example configuration for Argon ONE case

{ inputs, ... }: {
    imports = [inputs.argon40-nix.nixosModules.default];

    config = {
        programs.argon.one = {
            enable = true;

            settings = {
                # Is 'celsius' by default, can also be set to 'fahrenheit'
                displayUnits = "celsius";

                # This is the same config as the original Argon40 config.
                # This is also the default config for this flake.
                fanspeed = [
                    {
                        # This the temperature threshold at which this fan speed will activate.
                        # The temperature is in the above specified unit.
                        temperature = 55;
                        # This is speed percentage at which the fan will spin.
                        speed = 30;
                    }
                    {
                        temperature = 60;
                        speed = 55;
                    }
                    {
                        temperature = 65;
                        speed = 100;
                    }
                ];
            };
        };
    };
}

Example configuration for Argon EON case

{ inputs, ... }: {
    imports = [inputs.argon40-nix.nixosModules.default];

    config = {
        programs.argon = {
            # IMPORTANT: Note that the module for the Argon ONE also has to be enabled in order for the OLED screen on the EON to work, since that functionality is part of the Argon ONE service.
            one = {
                enable = true;

                settings = {
                    oled = {
                        # Configure what modules will show up on the OLED screen.
                        screenList = ["clock" "cpu" "storage" "raid" "ram" "temp" "ip"];
                        # Configure how long it takes to switch between modules.
                        switchDuration = 30;
                    };
                };
            };

            # All this does is enable the RTC service.
            eon.enable = true;
        };
    };
}

Thanks to

  • Argon40 for providing such an awesome case, continuously providing updates and open sourcing their projects.
  • okunze's repo containing an up to date version of the argon40 install script.

About

A Nix wrapper for the Argon40's case configuration scripts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published