Compare commits
No commits in common. "4edd18ad6cd4b6649fc4d9dae1de613c4d43bd55" and "93f438a5d1a1529023d6d83da92580eaad99adcf" have entirely different histories.
4edd18ad6c
...
93f438a5d1
3 changed files with 51 additions and 76 deletions
72
flake.nix
72
flake.nix
|
@ -37,12 +37,33 @@
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{ self, nixpkgs, ... }@inputs:
|
{ self, nixpkgs, ... }@inputs:
|
||||||
let
|
|
||||||
builders = import ./lib/builders.nix inputs;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
builders.compileSystems
|
let
|
||||||
|
lib = import ./lib nixpkgs.lib;
|
||||||
|
|
||||||
|
toPartialNixosConfig =
|
||||||
|
{ hostname, system }:
|
||||||
|
{
|
||||||
|
name = hostname;
|
||||||
|
value = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = { inherit inputs; };
|
||||||
|
modules = [
|
||||||
|
./hosts/${hostname}/hardware-configuration.nix
|
||||||
|
./hosts/${hostname}/configuration.nix
|
||||||
|
inputs.home-manager.nixosModules.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
compileSystems =
|
||||||
|
systems:
|
||||||
|
lib.right
|
||||||
|
builtins.listToAttrs
|
||||||
|
(map toPartialNixosConfig)
|
||||||
|
systems;
|
||||||
|
in
|
||||||
|
compileSystems
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
hostname = "snowhawk";
|
hostname = "snowhawk";
|
||||||
|
@ -57,24 +78,29 @@
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
homeConfigurations =
|
homeConfigurations."zynh@msiserver" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
builders.compileHomes
|
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||||
[
|
extraSpecialArgs = { inherit inputs; };
|
||||||
{
|
|
||||||
user = "zynh";
|
modules = [
|
||||||
hostname = "msiserver";
|
./hosts/msiserver/home.nix
|
||||||
system = "x86_64-linux";
|
];
|
||||||
}
|
};
|
||||||
{
|
homeConfigurations."val@caveserver" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
user = "val";
|
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||||
hostname = "caveserver";
|
extraSpecialArgs = { inherit inputs; };
|
||||||
system = "x86_64-linux";
|
|
||||||
}
|
modules = [
|
||||||
{
|
./hosts/caveserver/home.nix
|
||||||
user = "zynh";
|
];
|
||||||
hostname = "little-lightning";
|
};
|
||||||
system = "aarch64-darwin";
|
homeConfigurations."zynh@little-lightning" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
}
|
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
|
||||||
];
|
extraSpecialArgs = { inherit inputs; };
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
./hosts/little-lightning/home.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
{ nixpkgs, ... }@inputs:
|
|
||||||
|
|
||||||
let
|
|
||||||
lib = nixpkgs.lib.extend (import ../lib);
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
toPartialNixosConfig =
|
|
||||||
{ hostname, system }:
|
|
||||||
{
|
|
||||||
name = hostname;
|
|
||||||
value = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
modules = [
|
|
||||||
../hosts/${hostname}/hardware-configuration.nix
|
|
||||||
../hosts/${hostname}/configuration.nix
|
|
||||||
inputs.home-manager.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
compileSystems =
|
|
||||||
systems:
|
|
||||||
lib.right
|
|
||||||
builtins.listToAttrs
|
|
||||||
(map toPartialNixosConfig)
|
|
||||||
systems;
|
|
||||||
|
|
||||||
toPartialHomeManagerConfig =
|
|
||||||
{ user, system, hostname ? "", configHostname ? "" }:
|
|
||||||
let
|
|
||||||
configHost = if builtins.stringLength configHostname > 0 then configHostname else hostname;
|
|
||||||
hostStr = lib.strings.optionalString (builtins.stringLength hostname > 0) "@${hostname}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name = "${user}${hostStr}";
|
|
||||||
value = inputs.home-manager.lib.homeManagerConfiguration {
|
|
||||||
pkgs = nixpkgs.legacyPackages."${system}";
|
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
../hosts/${configHost}/home.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
compileHomes =
|
|
||||||
systems:
|
|
||||||
lib.right
|
|
||||||
builtins.listToAttrs
|
|
||||||
(map toPartialHomeManagerConfig)
|
|
||||||
systems;
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
final: prev:
|
lib:
|
||||||
with prev;
|
with lib;
|
||||||
rec {
|
rec {
|
||||||
# Ternary operator
|
# Ternary operator
|
||||||
# Exaample:
|
# Exaample:
|
||||||
|
|
Loading…
Reference in a new issue