97 lines
No EOL
2.8 KiB
Nix
97 lines
No EOL
2.8 KiB
Nix
{
|
|
|
|
# INFORMATION
|
|
# When building for a system, remember to change the hostname variable below
|
|
|
|
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";
|
|
};
|
|
|
|
outputs = { nixpkgs, home-manager, lanzaboote, ... }:
|
|
let
|
|
hostname = "nixos-laptop";
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs {
|
|
# Tells Flake what OS version we are using
|
|
inherit system;
|
|
config = { allowUnfree = true; };
|
|
};
|
|
|
|
lib = nixpkgs.lib;
|
|
in {
|
|
# Set up users with home-manager
|
|
homeManagerConfigurations = {
|
|
# Configuration for user "Albert"
|
|
albert = home-manager.lib.homeManagerConfiguration {
|
|
inherit system pkgs;
|
|
username = "albert";
|
|
homeDirectory = "/home/albert";
|
|
configuration.imports = [ ./users/albert/home.nix ];
|
|
};
|
|
# Configuration for user "root"
|
|
root = home-manager.lib.homeManagerConfiguration {
|
|
inherit system pkgs;
|
|
username = "root";
|
|
homeDirectory = "/root";
|
|
configuration.imports = [ ./users/rootd/home.nix ];
|
|
};
|
|
};
|
|
|
|
# NixOS Configuration files:
|
|
nixosConfigurations = {
|
|
# Declare the configuration for my laptop
|
|
nixos-p1 = lib.nixosSystem {
|
|
inherit system hostname;
|
|
modules = [
|
|
# Hardware Configuration
|
|
./hardware/lenovo-p1.nix
|
|
|
|
# SecureBoot Configuration
|
|
lanzaboote.nixosModules.lanzaboote
|
|
|
|
# NixOS Configuration file
|
|
./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;
|
|
}
|
|
]; # modules
|
|
}; # lib.nixosSystem - nixos-laptop
|
|
|
|
# Declare the configuration for my desktop
|
|
nixos-desktop = lib.nixosSystem {
|
|
inherit system hostname;
|
|
modules = [
|
|
# Hardware Configuration
|
|
./hardware/desktop.nix
|
|
|
|
# SecureBoot Configuration
|
|
lanzaboote.nixosModules.lanzaboote
|
|
|
|
# NixOS Configuration file
|
|
./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;
|
|
}
|
|
]; # modules
|
|
}; # lib.nixosSystem - nixos-laptop
|
|
|
|
}; # nixosConfiguration
|
|
};
|
|
} |