Compare commits

..

No commits in common. "94377f748706d6fa9950eb839bf0bb3d06fac917" and "8ca6adecb4fb3744285c8382740912885999d751" have entirely different histories.

3 changed files with 39 additions and 49 deletions

View file

@ -2,22 +2,19 @@
A ready-to-run NixOS configuration with opinionated defaults. A ready-to-run NixOS configuration with opinionated defaults.
The goal of this config is to make it as easy as possible to build a NixOS system for an out-of-the-box experience similar to user-friendly distributions like Ubuntu, Fedora, or Mint. Nearly all configuration is done by editing `host/configuration.nix`. Where possible, we provided simple boolean (true/false) flags for enabling things like GPU drivers and desktop environments. These options are made available under the `aux.system` namespace. You can, of course, extend this template however you'd like. The goal of this config is to make it as easy as possible to build a NixOS system for an out-of-the-box experience similar to user-friendly distributions like Ubuntu, Fedora, or Mint. Options are available under the `aux.system` top-level namespace. Where possible, we provided simple boolean (true/false) flags for enabling things like GPU drivers and desktop environments. You can, of course, extend this template however you'd like.
## Getting Started ## Getting Started
1. [Install a fresh copy of NixOS and boot into your new system](https://nixos.org/manual/nixos/stable/index.html#ch-installation). 1. Install a fresh copy of NixOS and boot into your new system.
2. Open a terminal and create a new copy of this template by running `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t github:auxolotl/templates#system nixos-config`. 2. Download, copy, or clone this repository onto your new system.
3. Change into the new folder using `cd nixos-config`. 3. Run `nixos-generate-config --show-hardware-config` to generate your system's `hardware-configuration.nix` file. Copy this file into the `host` folder, overwriting the existing `hardware-configuration.nix` file.
4. Run `nixos-generate-config --show-hardware-config` to generate your system's `hardware-configuration.nix` file. Copy this file into the `host` folder, overwriting the existing `hardware-configuration.nix` file. 4. Edit `flake.nix` and set the following variables:
5. Edit `flake.nix` and set the following variables:
1. Change `hostName` to the hostname you want to give this system. 1. Change `hostName` to the hostname you want to give this system.
2. If your system is running on an architecture other than 64-bit Linux, change `platform` to the architecture that you're using. Details on the various options are documented in `flake.nix`. 2. If your system is running on an architecture other than 64-bit Linux, change `platform` to the architecture that you're using. Details on the various options are documented in `flake.nix`.
6. Edit the `host/configuration.nix` file to suit your needs. This file documents all of the different options available. In most cases, you can enable an option by changing `false` to `true`. 4. Edit the `host/configuration.nix` file to suit your needs. This file documents all of the different options available.
1. Change the `username` variable. If you installed NixOS using the standard install medium, you can change this to match the username you chose during installation. Otherwise, it will create a new user account. 5. Run `nixos-rebuild boot --flake .#<your hostname>` and restart.
2. If you're creating a new user account, don't forget to set its password by running `sudo passwd <username>`. 6. Enjoy your new NixOS system!
7. Run `sudo nixos-rebuild boot --flake .#<your hostname>` and restart.
8. Enjoy your new NixOS system!
## Additional options ## Additional options
@ -41,11 +38,11 @@ For users with a hybrid Nvidia GPU setup (e.g. laptop users), there's some addit
### Secure Boot support ### Secure Boot support
This configuration supports [Secure Boot](https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot) systems, but with some additional setup required. Secure Boot is a UEFI standard meant to prevent tampering with the pre-boot process, e.g. by a malicious third-party replacing your kernel image with a compromised image. In NixOS, Secure Boot support is provided by the [Lanzaboote](https://github.com/nix-community/lanzaboote) project. This configuration supports [Secure Boot](https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot) systems, but with some additional setup required. Secure Boot is a UEFI standard meant to prevent the pre-boot process by requiring boot images to be signed by a trusted authority. The goal is to prevent tampering, e.g. by a malicious third-party replacing your kernel image with a compromised image. In NixOS, Secure Boot support is provided by the [Lanzaboote](https://github.com/nix-community/lanzaboote) project.
To enable Secure Boot support: To enable Secure Boot support:
1. Install NixOS using the default `systemd-boot` bootloader, and with Secure Boot disabled via UEFI. To confirm this, run `bootctl status` on a fresh NixOS installation and look for output similar to the following: 1. Install NixOS using the default `systemd-boot` bootloader, and with Secure Boot disabled via UEFI. To confirm this, run `bootctl status` and look for output similar to the following:
```sh ```sh
$ bootctl status $ bootctl status
System: System:

View file

@ -1,31 +1,20 @@
{ {
description = "A system flake with various options for bootstrapping a complete NixOS install."; description = "A system flake with various options for bootstrapping a complete Aux install.";
inputs = { inputs = {
# Import the desired Nix channel. Defaults to unstable, which uses a fully tested rolling release model.
# You can find a list of channels at https://nixos.wiki/wiki/Nix_channels
# To follow a different channel, replace `nixos-unstable` with the channel name, e.g. `nixos-24.05`.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Use Lix in place of Nix.
# If you'd rather use regular Nix, remove `lix-module.nixosModules.default` from the `modules` section below.
# To learn more about Lix, see https://lix.systems/
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0-rc1.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
# Flatpak support # Flatpak support
nix-flatpak.url = "github:gmodena/nix-flatpak/v0.4.1"; nix-flatpak.url = "github:gmodena/nix-flatpak/v0.4.1";
# Import the desired Nixpkgs repo. Defaults to unstable.
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# SecureBoot support # SecureBoot support
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.0"; lanzaboote.url = "github:nix-community/lanzaboote/v0.4.0";
# NixOS hardware quirks # NixOS hardware quirks
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Home-manager support # Add Home-manager support
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -38,7 +27,6 @@
auxlib, auxlib,
home-manager, home-manager,
lanzaboote, lanzaboote,
lix-module,
nix-flatpak, nix-flatpak,
nixos-hardware, nixos-hardware,
nixpkgs, nixpkgs,
@ -59,16 +47,14 @@
aarch64-darwin - M-series Macs. aarch64-darwin - M-series Macs.
*/ */
platform = "x86_64-linux"; platform = "x86_64-linux";
in
baseModules = [
./modules/autoimport.nix
home-manager.nixosModules.home-manager
lanzaboote.nixosModules.lanzaboote
nix-flatpak.nixosModules.nix-flatpak
# Set global home-manager settings
{ {
nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
};
modules = [
{
networking.hostName = hostName;
nixpkgs.hostPlatform = platform;
home-manager = { home-manager = {
/* /*
When running, Home Manager will use the global package cache. When running, Home Manager will use the global package cache.
@ -80,11 +66,18 @@
backupFileExtension = "home-manager_backup"; backupFileExtension = "home-manager_backup";
}; };
} }
./modules/autoimport.nix ];
home-manager.nixosModules.home-manager in
lanzaboote.nixosModules.lanzaboote {
lix-module.nixosModules.default nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
nix-flatpak.nixosModules.nix-flatpak specialArgs = {
inherit inputs;
};
modules = baseModules ++ [
{
networking.hostName = hostName;
nixpkgs.hostPlatform = platform;
}
./host/configuration.nix ./host/configuration.nix
# NixOS-Hardware # NixOS-Hardware

View file

@ -10,7 +10,7 @@ let
stateVersion = "24.11"; stateVersion = "24.11";
# Set the username for the initial user. # Set the username for the initial user.
username = builtins.abort "Please set your username via the 'username' variable in configuration.nix"; username = "axol";
in in
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
@ -22,7 +22,7 @@ in
# To see all available timezones, run `timedatectl list-timezones`. # To see all available timezones, run `timedatectl list-timezones`.
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
# Define your user account(s). If this user doesn't already have a password, don't forget to set one using `passwd`. # Define your user account(s). Don't forget to set a password with `passwd`.
users.users.${username} = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
@ -106,7 +106,7 @@ in
# https://buddiesofbudgie.org/ # https://buddiesofbudgie.org/
budgie.enable = false; budgie.enable = false;
# Enable the Hyprland desktop environment. # Enable the Hyperland desktop environment.
# https://hyprland.org/ # https://hyprland.org/
hyprland.enable = false; hyprland.enable = false;