nixos-config/flake.nix

195 lines
4.6 KiB
Nix
Raw Normal View History

2021-02-06 03:09:11 +01:00
{
description = "Nixos configuration with flakes";
inputs = {
2021-04-19 12:49:30 +02:00
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
2023-11-30 03:46:40 +01:00
ref = "nixos-23.11";
2021-04-19 12:49:30 +02:00
};
nixpkgs-unstable-small = {
2021-05-27 20:16:14 +02:00
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable-small";
};
2022-01-17 21:56:41 +01:00
agenix = {
type = "github";
owner = "ryantm";
repo = "agenix";
};
2021-04-19 13:42:29 +02:00
home-manager = {
type = "github";
owner = "nix-community";
repo = "home-manager";
2023-11-30 03:46:40 +01:00
ref = "release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
2021-04-19 13:42:29 +02:00
};
2021-07-14 19:40:35 +02:00
flake-utils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
2024-03-03 02:01:42 +01:00
ref = "main";
2021-07-14 19:40:35 +02:00
};
nixos-hardware = {
type = "github";
owner = "NixOS";
repo = "nixos-hardware";
ref = "master";
};
2023-12-13 17:29:54 +01:00
disko = {
type = "github";
owner = "nix-community";
repo = "disko";
ref = "master";
};
2021-02-06 03:09:11 +01:00
};
2022-04-10 11:54:58 +02:00
outputs = {
self,
nixpkgs,
home-manager,
agenix,
2023-12-13 17:29:54 +01:00
disko,
2022-04-10 11:54:58 +02:00
...
} @ inputs:
{
nixosModules = {
home = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.alarsyo = import ./home;
home-manager.verbose = true;
};
nix-path = {
nix = {
nixPath = [
"nixpkgs=${inputs.nixpkgs}"
];
registry = {
nixpkgs.flake = inputs.nixpkgs;
};
};
2022-04-10 11:54:58 +02:00
};
2021-08-25 21:39:05 +02:00
};
2021-07-14 18:05:36 +02:00
2022-04-10 11:54:58 +02:00
overlays = import ./overlays;
2022-04-10 11:54:58 +02:00
nixosConfigurations = let
2021-07-14 18:05:36 +02:00
system = "x86_64-linux";
2022-04-10 11:54:58 +02:00
shared_overlays =
[
(self: super: {
packages = import ./pkgs {pkgs = super;};
# packages accessible through pkgs.unstable.package
unstable = import inputs.nixpkgs-unstable-small {
inherit system;
config.allowUnfree = true;
};
power-profiles-daemon = self.unstable.power-profiles-daemon;
2022-04-10 11:54:58 +02:00
})
2023-03-11 13:23:51 +01:00
agenix.overlays.default
2022-04-10 11:54:58 +02:00
]
++ builtins.attrValues self.overlays;
sharedModules =
[
2023-03-11 13:21:56 +01:00
agenix.nixosModules.default
home-manager.nixosModules.default
{
nixpkgs = {
2023-11-15 11:42:09 +01:00
overlays = shared_overlays;
config.permittedInsecurePackages = [];
2023-11-15 11:42:09 +01:00
};
2023-12-13 17:44:22 +01:00
hardware.enableRedistributableFirmware = true;
}
2022-04-10 11:54:58 +02:00
]
++ (nixpkgs.lib.attrValues self.nixosModules);
2021-07-14 18:06:52 +02:00
in {
2022-06-10 16:56:15 +02:00
hades = nixpkgs.lib.nixosSystem rec {
inherit system;
modules =
[
./hades.nix
]
++ sharedModules;
};
2021-07-14 18:06:52 +02:00
boreal = nixpkgs.lib.nixosSystem rec {
inherit system;
2022-04-10 11:54:58 +02:00
modules =
[
./boreal.nix
{
nixpkgs.overlays = [
# uncomment this to build everything from scratch, fun but takes a
# while
#
# (self: super: {
# stdenv = super.impureUseNativeOptimizations super.stdenv;
# })
];
}
]
++ sharedModules;
2021-07-14 18:06:52 +02:00
};
2021-07-14 18:05:36 +02:00
2023-09-23 13:35:35 +02:00
hephaestus = nixpkgs.lib.nixosSystem rec {
inherit system;
modules =
[
./hephaestus.nix
inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-gpu-amd
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-ssd
]
++ sharedModules;
};
2023-12-13 17:29:54 +01:00
2024-03-03 01:56:35 +01:00
talos = nixpkgs.lib.nixosSystem {
inherit system;
modules =
[
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
disko.nixosModules.default
./talos.nix
]
++ sharedModules;
};
2023-12-13 17:29:54 +01:00
thanatos = nixpkgs.lib.nixosSystem {
inherit system;
modules =
[
disko.nixosModules.default
./thanatos.nix
]
++ sharedModules;
};
2021-07-14 18:05:36 +02:00
};
2022-04-10 11:54:58 +02:00
}
2024-03-04 16:31:32 +01:00
// inputs.flake-utils.lib.eachDefaultSystem (system: let
2024-03-04 19:33:08 +01:00
pkgs = nixpkgs.legacyPackages.${system};
2024-03-04 16:31:32 +01:00
in {
2022-04-10 11:54:58 +02:00
packages =
inputs.flake-utils.lib.flattenTree
2024-03-04 19:33:08 +01:00
(import ./pkgs {inherit pkgs;});
2024-03-04 16:31:32 +01:00
devShells.default = pkgs.mkShellNoCC {
buildInputs = [
pkgs.alejandra
];
};
2022-04-10 11:54:58 +02:00
});
2021-02-06 03:09:11 +01:00
}