1
Fork 0
nixos-system-config/flake.nix

59 lines
1.9 KiB
Nix
Raw Normal View History

2023-06-18 22:52:24 +02:00
{
description = "Modular multi-purpose NixOS configuration.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
2023-07-19 22:25:34 +02:00
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2023-06-18 22:52:24 +02:00
# https://nixos.wiki/wiki/Impermanence
impermanence.url = "github:nix-community/impermanence";
2023-07-01 15:08:00 +02:00
simple-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.05";
2023-06-18 22:52:24 +02:00
};
2023-07-19 22:25:34 +02:00
outputs = { self, nixpkgs, nixpkgs-unstable, nixops, ... }@attrs: let
system = "x86_64-linux";
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
2023-07-01 15:08:00 +02:00
user = "user"; # Select user from the `./users` directory
2023-06-18 22:52:24 +02:00
in {
2023-07-01 15:08:00 +02:00
# Media homeserver
2023-06-24 23:09:01 +02:00
nixosConfigurations.homeserver = nixpkgs.lib.nixosSystem {
2023-07-19 22:25:34 +02:00
inherit system;
2023-06-24 23:09:01 +02:00
specialArgs = attrs;
modules = [
2023-07-19 22:25:34 +02:00
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-unstable ]; })
2023-06-24 23:09:01 +02:00
./users/${user}.nix
./systems/homeserver.nix
];
};
2023-07-01 15:08:00 +02:00
# dirae.org
nixosConfigurations.dirae = nixpkgs.lib.nixosSystem {
2023-07-19 22:25:34 +02:00
inherit system;
2023-07-01 15:08:00 +02:00
specialArgs = attrs;
modules = [
2023-07-19 22:25:34 +02:00
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-unstable ]; })
2023-07-01 15:08:00 +02:00
./users/${user}.nix
./systems/dirae.nix
];
};
2023-06-18 22:52:24 +02:00
# Debugging VM configuration
nixosConfigurations.qemu-vm = nixpkgs.lib.nixosSystem {
2023-07-19 22:25:34 +02:00
inherit system;
2023-06-24 20:56:54 +02:00
specialArgs = attrs;
2023-06-18 22:52:24 +02:00
modules = [
2023-07-19 22:25:34 +02:00
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-unstable ]; })
2023-06-18 22:52:24 +02:00
./users/${user}.nix
./systems/qemu-vm.nix
];
};
};
}