mirror of
https://github.com/semere-meb/dotfiles-nix.git
synced 2026-08-03 10:24:36 +00:00
auto-discovered host config
This commit is contained in:
parent
edbbc0dbc2
commit
3e14a0acb8
4 changed files with 40 additions and 30 deletions
28
flake.nix
28
flake.nix
|
|
@ -16,15 +16,20 @@
|
|||
let
|
||||
lib = nixpkgs.lib;
|
||||
userVars = import ./vars.nix;
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
nabro = lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit userVars; };
|
||||
modules = [
|
||||
./hosts/nabro/configuration.nix
|
||||
|
||||
hostsDir = ./hosts;
|
||||
hostNames = builtins.attrNames (
|
||||
lib.filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir)
|
||||
);
|
||||
|
||||
nixosConfigurations = lib.genAttrs hostNames (name:
|
||||
let
|
||||
hostConfig = import (./hosts + "/${name}");
|
||||
in
|
||||
lib.nixosSystem {
|
||||
system = hostConfig.system;
|
||||
specialArgs = { inherit userVars; };
|
||||
modules = [ hostConfig.configModule ] ++ [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
|
|
@ -35,7 +40,10 @@
|
|||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
inherit nixosConfigurations;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules
|
||||
];
|
||||
|
||||
networking.hostName = "nabro";
|
||||
|
||||
# Enable host-specific feature branches (dendrites)
|
||||
dotfiles = {
|
||||
core.enable = true;
|
||||
user.enable = true;
|
||||
desktop.enable = true;
|
||||
dev.enable = true;
|
||||
shell.enable = true;
|
||||
};
|
||||
}
|
||||
19
hosts/nabro/default.nix
Normal file
19
hosts/nabro/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
system = "x86_64-linux";
|
||||
configModule = { config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules
|
||||
];
|
||||
|
||||
networking.hostName = "nabro";
|
||||
|
||||
dotfiles = {
|
||||
core.enable = true;
|
||||
user.enable = true;
|
||||
desktop.enable = true;
|
||||
dev.enable = true;
|
||||
shell.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -60,9 +60,11 @@ in
|
|||
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
settings = {
|
||||
theme = "ayu_dark";
|
||||
editor = {
|
||||
line-numbers = "relative";
|
||||
line-number = "relative";
|
||||
lsp.display-messages = true;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue