1
0
Fork 0
nix-configuration/flake.nix

133 lines
3.7 KiB
Nix
Raw Normal View History

# Based on the Auxolotl template: https://github.com/auxolotl/templates
2024-02-29 14:53:34 +00:00
# For info on Flakes, see: https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-with-flakes-enabled
{
description = "Aires' system Flake";
2024-02-29 14:53:34 +00:00
inputs = {
# Track base packages against unstable
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2024-05-06 12:38:54 +00:00
# Replace Nix with Lix: https://lix.systems/
lix = {
url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1";
flake = false;
};
lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module";
inputs.lix.follows = "lix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-29 14:53:34 +00:00
# SecureBoot support
lanzaboote.url = "github:nix-community/lanzaboote/v0.3.0";
2024-02-29 14:53:34 +00:00
# Flatpak support
nix-flatpak.url = "github:gmodena/nix-flatpak/v0.4.1";
2024-05-04 02:36:50 +00:00
# Hardware configurations
nixos-hardware.url = "github:NixOS/nixos-hardware";
2024-02-29 14:53:34 +00:00
# Home-manager
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs"; # Use system packages list where available
};
# TODO: Add Disko - https://github.com/nix-community/disko
};
2024-02-29 14:53:34 +00:00
outputs =
inputs@{
self,
nixpkgs,
lanzaboote,
nix-flatpak,
home-manager,
nixos-hardware,
lix-module,
...
}:
let
forAllSystems =
function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system: function nixpkgs.legacyPackages.${system});
config.allowUnfree = true;
2024-02-29 14:53:34 +00:00
# Define shared modules and imports
defaultModules = {
base = [
{
_module.args = {
inherit inputs;
};
}
./hosts/default.nix
lix-module.nixosModules.default
lanzaboote.nixosModules.lanzaboote
nix-flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
{
home-manager = {
/*
When running, Home Manager will use the global package cache.
It will also back up any files that it would otherwise overwrite.
The originals will have the extension shown below.
*/
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "home-manager-backup";
};
}
];
};
in
{
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
nixosConfigurations = {
Dimaga = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules.base ++ [
nixos-hardware.nixosModules.common-cpu-intel
./hosts/Dimaga
];
};
2024-02-29 14:53:34 +00:00
Haven = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules.base ++ [
nixos-hardware.nixosModules.common-cpu-amd-pstate
./hosts/Haven
];
};
Khanda = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules.base ++ [
nixos-hardware.nixosModules.microsoft-surface-pro-intel
./hosts/Khanda
];
};
Pihole = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = defaultModules.base ++ [
nixos-hardware.nixosModules.raspberry-pi-4
./hosts/Pihole
];
};
Shura = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules.base ++ [
nixos-hardware.nixosModules.lenovo-legion-16arha7
./hosts/Shura
];
};
};
};
}