lotsa reorganization

This commit is contained in:
CherryKitten 2024-03-24 19:03:41 +01:00
parent 48bbfe3b4b
commit 9f5a9af650
Signed by: sammy
GPG key ID: 98D8F75FB0658276
28 changed files with 15 additions and 6 deletions

View file

@ -42,7 +42,7 @@
};
defaults = { lib, config, name, ... }: {
imports = [ ./hosts/${name}/configuration.nix ./modules/nixos/common.nix (import "${home-manager}/nixos") ];
imports = [ ./hosts/${name} ./hosts/common (import "${home-manager}/nixos") ];
deployment = {
targetUser = "sammy";
@ -53,6 +53,8 @@
inherit inputs outputs;
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
};
cherrykitten.hostname = name;
};
bengal = { };
@ -63,7 +65,7 @@
test = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
modules = [ ./modules/nixos/common.nix ./hosts/test-vm/configuration.nix (import "${home-manager}/nixos") ];
modules = [ ./hosts/test-vm ./hosts/common (import "${home-manager}/nixos") ];
};
} // colmenaHive.nodes;
@ -73,7 +75,7 @@
mkHome = { user ? "sammy", hostname ? null }:
lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./modules/home/users/${user}.nix ] ++ lib.optional (!isNull hostname) ./modules/home/hosts/${hostname}.nix;
modules = [ ./users/${user}.nix ] ++ lib.optional (!isNull hostname) (./. + "/users/${user}@${hostname}.nix");
extraSpecialArgs = {
inherit inputs outputs;
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };

View file

@ -1,5 +1,10 @@
{ lib, pkgs, ... }: {
options.cherrykitten.common = {
options.cherrykitten = {
hostname = lib.mkOption {
type = lib.types.str;
default = "";
description = "the hostname, this is already set for every host by the flake config";
};
test = lib.mkOption {
type = lib.types.str;
default = "nya";

View file

@ -1,6 +1,7 @@
{ pkgs, config, lib, ... }:
let
cfg = config.cherrykitten.users;
hostname = config.cherrykitten.hostname;
in
{
options.cherrykitten.users = {
@ -16,6 +17,7 @@ in
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZyQSZw+pExsx2RXB+yxbaJGB9mtvudbQ/BP7E1yKvr openpgp:0x6068FEBB" ];
};
home-manager.users.sammy = lib.mkIf cfg.sammy.enable (import ../home/users/sammy.nix);
home-manager.users.sammy = lib.mkIf cfg.sammy.enable (import ../../users/sammy.nix)
// lib.mkIf (lib.pathExists (../../users + "/sammy@${hostname}.nix")) (import ../../users + "sammy@${hostname}.nix");
};
}

View file

@ -1,5 +1,5 @@
{ ... }: {
imports = [ ../default.nix ];
imports = [ ./common ];
programs.git = {
userName = "CherryKitten";