Reformat with alejandra
This commit is contained in:
parent
7b2b5b3b80
commit
52a81ddb21
53 changed files with 764 additions and 746 deletions
84
flake.nix
84
flake.nix
|
|
@ -13,47 +13,51 @@
|
|||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, nix-custom, ... }:
|
||||
let
|
||||
linuxCfgDir = ./linux;
|
||||
templateDir = ./template;
|
||||
in
|
||||
{
|
||||
nixosConfigurations = builtins.mapAttrs
|
||||
(instance: _:
|
||||
nixpkgs.lib.nixosSystem ({
|
||||
modules = [
|
||||
# Import config from folder
|
||||
(linuxCfgDir + "/${instance}")
|
||||
# Setup Nix
|
||||
({ pkgs, ... }: {
|
||||
networking.hostName = instance;
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
trusted-substituters = [ "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" ];
|
||||
};
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nix-custom,
|
||||
...
|
||||
}: let
|
||||
linuxCfgDir = ./linux;
|
||||
templateDir = ./template;
|
||||
in {
|
||||
nixosConfigurations =
|
||||
builtins.mapAttrs
|
||||
(instance: _:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
# Import config from folder
|
||||
(linuxCfgDir + "/${instance}")
|
||||
# Setup Nix
|
||||
({pkgs, ...}: {
|
||||
networking.hostName = instance;
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
nixpkgs = {
|
||||
config.allowUnfree = true;
|
||||
overlays = [ nix-custom.overlays.default ];
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
trusted-substituters = ["https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"];
|
||||
};
|
||||
})
|
||||
];
|
||||
specialArgs = { inherit inputs; };
|
||||
}))
|
||||
(builtins.readDir linuxCfgDir);
|
||||
templates = builtins.mapAttrs
|
||||
(template: _: {
|
||||
path = templateDir + "/${template}";
|
||||
description = "Template flake setup: ${template}";
|
||||
};
|
||||
nixpkgs = {
|
||||
config.allowUnfree = true;
|
||||
overlays = [nix-custom.overlays.default];
|
||||
};
|
||||
})
|
||||
];
|
||||
specialArgs = {inherit inputs;};
|
||||
})
|
||||
(builtins.readDir templateDir);
|
||||
};
|
||||
|
||||
(builtins.readDir linuxCfgDir);
|
||||
templates =
|
||||
builtins.mapAttrs
|
||||
(template: _: {
|
||||
path = templateDir + "/${template}";
|
||||
description = "Template flake setup: ${template}";
|
||||
})
|
||||
(builtins.readDir templateDir);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue