switched modules to flakes
This commit is contained in:
37
flake.nix
37
flake.nix
@ -4,9 +4,17 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
nixos-modules = {
|
||||
url = "github:SuperSandro2000/nixos-modules";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs-stable.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
nix-index-database = {
|
||||
@ -15,33 +23,36 @@
|
||||
};
|
||||
};
|
||||
|
||||
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);
|
||||
outputs = { nixpkgs, nixos-modules, nix-index-database, sops-nix, ... }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
in {
|
||||
nixosConfigurations = let
|
||||
constructSystem = {
|
||||
hostname,
|
||||
system ? "x86_64-linux",
|
||||
modules ? [],
|
||||
users ? [],
|
||||
}: nixpkgs.lib.nixosSystem {
|
||||
inherit system hostname;
|
||||
}: lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
nixos-modules.nixosModule
|
||||
sops-nix.nixosModules.sops
|
||||
nix-index-database.nixosModules.nix-index
|
||||
./system/programs.nix
|
||||
./system/configuration.nix
|
||||
./system/${hostname}/configuration.nix
|
||||
] ++ fileList "modules" ++ modules ++ map (user: ./users/${user}/default.nix ) users;
|
||||
./systems/programs.nix
|
||||
./systems/configuration.nix
|
||||
./systems/${hostname}/configuration.nix
|
||||
] ++ modules ++ map(user: ./users/${user}) users;
|
||||
|
||||
};
|
||||
in {
|
||||
photon = constructSystem {
|
||||
hostname = "photon"
|
||||
hostname = "photon";
|
||||
};
|
||||
|
||||
palatine-hill = constructSystem {
|
||||
hostname = "palatine-hill"
|
||||
hostname = "palatine-hill";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user