Clean branch
This commit is contained in:
commit
de986accc2
42 changed files with 1959 additions and 0 deletions
62
flake.nix
Normal file
62
flake.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
description = "Entrypoint of all nix configurations";
|
||||
|
||||
inputs = {
|
||||
darkmatter.url = "gitlab:VandalByte/darkmatter-grub-theme";
|
||||
darwin.url = "github:lnl7/nix-darwin";
|
||||
disko.url = "github:nix-community/disko";
|
||||
hardware.url = "github:nixos/nixos-hardware";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nix-custom.url = "git+https://forgejo.invariantspace.com/macronova/nix-custom";
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, darwin, nixpkgs, ... }:
|
||||
let
|
||||
darwinConfigDir = ./darwin;
|
||||
linuxConfigDir = ./linux;
|
||||
templateDir = ./template;
|
||||
systemArgs = archPath: instance: {
|
||||
modules = [
|
||||
# Import config from folder
|
||||
(archPath + "/${instance}")
|
||||
# Setup Nix
|
||||
({ pkgs, ... }: {
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
};
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
})
|
||||
];
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
in
|
||||
{
|
||||
darwinConfigurations = builtins.mapAttrs
|
||||
(instance: _:
|
||||
darwin.lib.darwinSystem (systemArgs darwinConfigDir instance // {
|
||||
system = "aarch64-darwin";
|
||||
}))
|
||||
(builtins.readDir darwinConfigDir);
|
||||
nixosConfigurations = builtins.mapAttrs
|
||||
(instance: _:
|
||||
nixpkgs.lib.nixosSystem (systemArgs linuxConfigDir instance))
|
||||
(builtins.readDir linuxConfigDir);
|
||||
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