base configuration
This commit is contained in:
43
flake.nix
Normal file
43
flake.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
description = "NixOS configuration for Wavelens Servers";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-index-database = {
|
||||
url = "github:Mic92/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, nix-index-database, sops-nix, ... }: {
|
||||
src = builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) ./.;
|
||||
ls = dir: lib.attrNames (builtins.readDir (src + "/${dir}"));
|
||||
fileList = dir: map (file: ./. + "/${dir}/${file}") (ls dir);
|
||||
nixosConfigurations = let
|
||||
constructSystem = {
|
||||
hostname,
|
||||
system ? "x86_64-linux",
|
||||
modules ? [],
|
||||
}: nixpkgs.lib.nixosSystem {
|
||||
inherit system hostname;
|
||||
modules = [
|
||||
sops-nix.nixosModules.sops
|
||||
nix-index-database.nixosModules.nix-index
|
||||
./system/programs.nix
|
||||
./system/configuration.nix
|
||||
./system/${hostname}/configuration.nix
|
||||
] ++ fileList "modules" ++ modules;
|
||||
};
|
||||
in {
|
||||
photon = constructSystem {
|
||||
hostname = "photon"
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user