nix-dotfiles/flake.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

2023-12-23 06:49:01 +01:00
{
2023-12-23 07:39:10 +01:00
description = "NixOS configuration for RAD-Development Servers";
2023-12-23 06:49:01 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2023-12-24 18:48:52 +01:00
nixos-modules = {
url = "github:SuperSandro2000/nixos-modules";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
2023-12-23 06:49:01 +01:00
sops-nix = {
url = "github:Mic92/sops-nix";
2023-12-24 18:48:52 +01:00
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
};
2023-12-23 06:49:01 +01:00
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2023-12-24 18:48:52 +01:00
outputs = { nixpkgs, nixos-modules, nix-index-database, sops-nix, ... }:
let
inherit (nixpkgs) lib;
in {
2023-12-23 06:49:01 +01:00
nixosConfigurations = let
constructSystem = {
hostname,
system ? "x86_64-linux",
modules ? [],
2023-12-23 08:27:00 +01:00
users ? [],
2023-12-24 18:48:52 +01:00
}: lib.nixosSystem {
inherit system;
2023-12-23 06:49:01 +01:00
modules = [
2023-12-24 18:48:52 +01:00
nixos-modules.nixosModule
2023-12-23 06:49:01 +01:00
sops-nix.nixosModules.sops
nix-index-database.nixosModules.nix-index
2023-12-24 18:48:52 +01:00
./systems/programs.nix
./systems/configuration.nix
./systems/${hostname}/configuration.nix
] ++ modules ++ map(user: ./users/${user}) users;
2023-12-23 06:49:01 +01:00
};
in {
photon = constructSystem {
2023-12-24 18:48:52 +01:00
hostname = "photon";
2023-12-23 06:49:01 +01:00
};
2023-12-23 07:39:10 +01:00
palatine-hill = constructSystem {
2023-12-24 18:48:52 +01:00
hostname = "palatine-hill";
2023-12-23 07:39:10 +01:00
};
2023-12-23 06:49:01 +01:00
};
};
}