feat: rework to modular
This commit is contained in:
20
lib/defaults.nix
Normal file
20
lib/defaults.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ lib }:
|
||||
let
|
||||
supportedSystems = [
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
"x86_64-linux"
|
||||
];
|
||||
in
|
||||
{
|
||||
inherit supportedSystems;
|
||||
|
||||
forAllSystems = f: lib.genAttrs supportedSystems f;
|
||||
|
||||
companySessionVariables = {
|
||||
BAO_ADDR = "https://secrets.api.nodeiwest.se";
|
||||
SOME_REGISTRY = "git.dgren.dev";
|
||||
};
|
||||
|
||||
stateVersion = "24.11";
|
||||
}
|
||||
7
lib/mkProfile.nix
Normal file
7
lib/mkProfile.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
modules ? [ ],
|
||||
extraModules ? [ ],
|
||||
}:
|
||||
{
|
||||
imports = modules ++ extraModules;
|
||||
}
|
||||
15
lib/mkSystem.nix
Normal file
15
lib/mkSystem.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ systems }:
|
||||
{
|
||||
target,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
adapter =
|
||||
if target == "darwin" then
|
||||
systems.darwin
|
||||
else if target == "linux" then
|
||||
systems.linux
|
||||
else
|
||||
throw "Unsupported target `${target}`. Expected `darwin` or `linux`.";
|
||||
in
|
||||
adapter (builtins.removeAttrs args [ "target" ])
|
||||
Reference in New Issue
Block a user