created module
This commit is contained in:
commit
8a8fe8cfc6
11 changed files with 351 additions and 0 deletions
72
flake.nix
Normal file
72
flake.nix
Normal file
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}: let
|
||||
systems = [
|
||||
"aarch64-darwin"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"x86_64-linux"
|
||||
];
|
||||
pkgsFor = system: nixpkgs.legacyPackages.${system};
|
||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||
forEachPkgs = lambda: forEachSystem (system: lambda (pkgsFor system));
|
||||
in {
|
||||
devShells = forEachPkgs (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
# for version controlling this repo
|
||||
git
|
||||
# for formatting code in this repo
|
||||
alejandra
|
||||
# for viewing configuration options defined in this repo
|
||||
nix-inspect
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
nixosModules.default = self.nixosModules.syncthing;
|
||||
nixosModules.syncthing = import ./nixos.nix;
|
||||
|
||||
# TODO: figure out if I need modules for these projects
|
||||
# homeManagerModules.syncthing = null;
|
||||
# darwinModules.syncthing = null;
|
||||
|
||||
lib = {
|
||||
evalConfig = import ./eval-config.nix;
|
||||
syncthingConfiguration = {modules, ...}:
|
||||
self.lib.evalConfig (
|
||||
{inherit (nixpkgs) lib;}
|
||||
// {
|
||||
modules =
|
||||
modules
|
||||
++ [
|
||||
(import ./base-module.nix)
|
||||
];
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
default = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit self;};
|
||||
modules = [
|
||||
self.nixosModules.syncthing
|
||||
./example-nixos-module.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
syncthingConfiguration = self.lib.syncthingConfiguration {
|
||||
modules = [
|
||||
(import ./example-module.nix)
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue