Compare commits

..

No commits in common. "150d2f2e07ec82b21ee126a00418fc329a521cb1" and "6441652b8cb53c59b795f7652b4ff211991fe386" have entirely different histories.

11 changed files with 125 additions and 116 deletions

View File

@ -30,22 +30,61 @@
}; };
outputs = inputs: outputs = inputs:
let gen = import ./generator.nix { inherit inputs; }; let gen = import ./generator.nix { inherit inputs; };
in { in {
devShells = import ./shells { inherit inputs; }; devShells = import ./shells { inherit inputs; };
nixosConfigurations = { nixosConfigurations = {
valinor = gen.generate { host = "valinor"; }; valinor = gen.generate {
iriy = gen.generate { host = "iriy"; }; type = "nixos";
efir = gen.generate { host = "efir"; }; system = "x86_64-linux";
avalon = gen.generate { host = "avalon"; }; host = "valinor";
ci = gen.generate { host = "ci"; }; };
sandbox = gen.generate { host = "sandbox"; }; iriy = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "iriy";
};
efir = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "efir";
};
avalon = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "avalon";
};
ci = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "ci";
};
sandbox = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "sandbox";
};
};
darwinConfigurations = {
asgard = gen.generate {
type = "macos";
system = "x86_64-darwin";
host = "asgard";
};
}; };
darwinConfigurations = { asgard = gen.generate { host = "asgard"; }; };
homeConfigurations = { homeConfigurations = {
yomi = gen.generate { host = "example"; }; yomi = gen.generate {
example = gen.generate { host = "example"; }; type = "home";
system = "arm-64";
host = "example";
};
example = gen.generate {
type = "home";
system = "-"; # supports any
host = "example";
};
}; };
}; };

View File

@ -1,11 +1,11 @@
{ inputs, ... }: { { inputs, ... }: {
generate = { host }: generate = { type, system, host }:
let let
syscfg = import ./systems/${host}/cfg.nix;
nameValuePair = name: value: { inherit name value; }; nameValuePair = name: value: { inherit name value; };
syscfg = import ./systems/${host}/cfg.nix;
in ({ in ({
"nixos" = inputs.nixpkgs.lib.nixosSystem { "nixos" = inputs.nixpkgs.lib.nixosSystem {
system = syscfg.syscfg.system; system = system;
modules = [ modules = [
./modules/shared/syscfg ./modules/shared/syscfg
./modules/shared/sops ./modules/shared/sops
@ -33,33 +33,29 @@
} }
]; ];
}; };
"macos" = inputs.darwin.lib.darwinSystem { "macos" = inputs.darwin.lib.darwinSystem {
system = syscfg.system; system = system;
modules = [ modules = [
./modules/shared/syscfg
./modules/shared/sops
syscfg
./systems/${host}
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
./systems/${host}
inputs.home-manager.darwinModules.home-manager inputs.home-manager.darwinModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users = builtins.listToAttrs (map (userConfig: home-manager.users.sora = {
nameValuePair userConfig.username {
imports = [ imports = [
inputs.nix-colors.homeManagerModule inputs.nix-colors.homeManagerModule
inputs.hyprland.homeManagerModules inputs.hyprland.homeManagerModules
./systems/${host}/home.nix
]; ];
}) syscfg.syscfg.users); };
} }
]; ];
}; };
"home" = inputs.home-manager.lib.homeManagerConfiguration { "home" = inputs.home-manager.lib.homeManagerConfiguration {
modules = [ ./modules/home ]; modules = [ ./modules/home ./systems/${host}/home.nix ];
}; };
_ = throw "Unsupported system"; _ = throw "Unsupported system";
}.${syscfg.syscfg.type}); }.${type});
} }

View File

@ -63,6 +63,5 @@
XDG_TEMPLATES_DIR="$HOME/media/templates" XDG_TEMPLATES_DIR="$HOME/media/templates"
XDG_VIDEOS_DIR="$HOME/media/video" XDG_VIDEOS_DIR="$HOME/media/video"
''; '';
}) })];
];
} }

View File

@ -1,4 +1,4 @@
{ ... }: { ... }:
{ {
# virtualisation.arion.projects. virtualisation.arion.projects.
} }

View File

@ -98,14 +98,6 @@ in with lib; {
options.usercfg = userOpt; options.usercfg = userOpt;
options.syscfg = { options.syscfg = {
hostname = mkOption { type = types.str; }; hostname = mkOption { type = types.str; };
type = mkOption {
type = types.enum [ "nixos" "macos" "home" ];
default = "nixos";
};
system = mkOption {
type = types.enum [ "x86_64-linux" "x86_64-darwin" "-" ];
default = "x86_64-linux";
};
defaultUser = mkOption { type = types.str; }; defaultUser = mkOption { type = types.str; };
make = makeOpt; make = makeOpt;
net = netOpt; net = netOpt;

View File

@ -1,8 +0,0 @@
{
syscfg = {
hostname = "asguard";
defaultUser = "sora";
type = "macos";
system = "x86_64-darwin";
};
}

View File

@ -1,8 +1,6 @@
{ {
syscfg = { syscfg = {
hostname = "avalon"; hostname = "avalon";
system = "x86_64-linux";
type = "nixos";
defaultUser = "sora"; defaultUser = "sora";
users = [ users = [
{ {
@ -38,6 +36,7 @@
enable = true; enable = true;
ip4 = "10.10.1.2/32"; ip4 = "10.10.1.2/32";
ip6 = "fd10:10:10::2/128"; ip6 = "fd10:10:10::2/128";
pk = config.sops.secrets.avalon_wg_priv.path;
}; };
}; };
} }

View File

@ -1,8 +1,6 @@
{ {
syscfg = { syscfg = {
hostname = "ci"; hostname = "ci";
type = "nixos";
system = "x86_64-linux";
defaultUser = "ci"; defaultUser = "ci";
users = [{ users = [{
username = "ci"; username = "ci";

View File

@ -1,8 +1,6 @@
{ {
syscfg = { syscfg = {
hostname = "iriy"; hostname = "iriy";
type = "nixos";
system = "x86_64-linux";
defaultUser = "sora"; defaultUser = "sora";
users = [{ users = [{
username = "sora"; username = "sora";

View File

@ -1,8 +1,6 @@
{ {
syscfg = { syscfg = {
hostname = "sandbox"; hostname = "sandbox";
type = "nixos";
system = "x86_64-linux";
defaultUser = "sora"; defaultUser = "sora";
users = [{ users = [{
username = "sora"; username = "sora";

View File

@ -1,8 +1,6 @@
{ {
syscfg = { syscfg = {
hostname = "valinor"; hostname = "valinor";
type = "nixos";
system = "x86_64-linux";
defaultUser = "sora"; defaultUser = "sora";
users = [{ users = [{
username = "sora"; username = "sora";