2023-07-01 09:48:31 +02:00
|
|
|
{
|
2023-07-01 09:54:42 +02:00
|
|
|
|
|
|
|
# INFORMATION
|
|
|
|
# When building for a system, remember to change the hostname variable below
|
2023-07-01 09:56:25 +02:00
|
|
|
|
2023-07-01 09:48:31 +02:00
|
|
|
description = "NixOS System Config";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
# NixOS packages
|
|
|
|
nixpkgs.url = "nixpkgs/nixos-23.05";
|
|
|
|
|
|
|
|
# Manage dotfiles in a home directory
|
|
|
|
home-manager.url = "github:nix-community/home-manager/release-23.05";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
# Secureboot Configuration
|
|
|
|
lanzaboote.url = "github:nix-community/lanzaboote";
|
|
|
|
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-01 11:09:23 +02:00
|
|
|
outputs = { nixpkgs, home-manager, lanzaboote, ... }@inputs:
|
2023-07-01 09:48:31 +02:00
|
|
|
let
|
2023-07-01 10:58:43 +02:00
|
|
|
|
|
|
|
# Variables - Remember to set these
|
2023-07-01 10:02:43 +02:00
|
|
|
hostname = "nixos-laptop";
|
2023-07-01 09:48:31 +02:00
|
|
|
system = "x86_64-linux";
|
2023-07-01 10:58:43 +02:00
|
|
|
|
2023-07-01 09:48:31 +02:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
# Tells Flake what OS version we are using
|
|
|
|
inherit system;
|
|
|
|
config = { allowUnfree = true; };
|
|
|
|
};
|
|
|
|
lib = nixpkgs.lib;
|
|
|
|
in {
|
|
|
|
# NixOS Configuration files:
|
|
|
|
nixosConfigurations = {
|
2023-07-01 11:40:59 +02:00
|
|
|
# Declare a generic configuration using the $hostname variable:
|
2023-07-01 11:39:31 +02:00
|
|
|
${hostname} = lib.nixosSystem {
|
2023-07-01 10:23:32 +02:00
|
|
|
inherit system;
|
2023-07-01 09:48:31 +02:00
|
|
|
modules = [
|
|
|
|
# Hardware Configuration
|
2023-07-01 11:15:49 +02:00
|
|
|
./hosts/${hostname}/hardware-configuration.nix
|
2023-07-01 11:40:59 +02:00
|
|
|
|
|
|
|
# Extra options for the host hardware configuration
|
2023-07-01 11:15:49 +02:00
|
|
|
./hosts/${hostname}/configuration.nix
|
2023-07-01 11:09:23 +02:00
|
|
|
|
2023-07-01 09:48:31 +02:00
|
|
|
# SecureBoot Configuration
|
|
|
|
lanzaboote.nixosModules.lanzaboote
|
|
|
|
|
2023-07-01 10:23:32 +02:00
|
|
|
# Common NixOS Configuration file
|
2023-07-01 09:48:31 +02:00
|
|
|
./configuration.nix
|
|
|
|
|
|
|
|
# Tell home-manager to use both global and user packages:
|
|
|
|
home-manager.nixosModules.home-manager {
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2023-07-01 11:58:38 +02:00
|
|
|
home-manager.users.albert = import ./users/albert/home.nix;
|
|
|
|
home-manager.users.root = import ./users/root/home.nix;
|
2023-07-01 09:48:31 +02:00
|
|
|
}
|
|
|
|
]; # modules
|
|
|
|
}; # lib.nixosSystem - nixos-laptop
|
|
|
|
}; # nixosConfiguration
|
|
|
|
};
|
|
|
|
}
|