feat: seperate module imports

This commit is contained in:
punkfairie 2025-05-25 17:34:46 -07:00
parent 87d7454dd1
commit 809e11313a
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
6 changed files with 94 additions and 79 deletions

View file

@ -8,33 +8,23 @@
config.easy-hosts = {
shared.specialArgs.marleylib = import ../lib;
### Module Imports ###
# TODO: Move module imports to custom module
shared.modules = with inputs; [
lix.nixosModules.default
agenix.nixosModules.default
{
home-manager.sharedModules = [
nixcord.homeModules.nixcord
];
}
];
# shared.modules = with inputs; [
# # TODO: Move module imports to custom module
# {
# home-manager.sharedModules = [
# nixcord.homeModules.nixcord
# ];
# }
# ];
perClass = class: {
modules = ["${self}/modules/${class}/default.nix"];
# modules = with inputs;
# (nixpkgs.lib.optionals (class == "nixos") [
# home-manager.nixosModules.home-manager
# agenix.nixosModules.default
# stylix.nixosModules.stylix
# niri-flake.nixosModules.niri
# ])
# ++ (nixpkgs.lib.optionals (class == "darwin") [
# home-manager.darwinModules.home-manager
# agenix.darwinModules.default
# stylix.darwinModules.stylix
# ]);
};

View file

@ -1,62 +1,68 @@
{
pkgs,
inputs,
pkgs,
...
}: {
nix = {
package = pkgs.lix;
imports = [
inputs.lix.nixosModules.default # this is universal, despite the 'nixos'
];
# Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in pkgs = import <nixpkgs> {}.
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
config = {
nix = {
package = pkgs.lix;
# Pin flake registry nixpkgs to flake nixpkgs version.
# i.e. for use in nix search nixpkgs.
registry = {
nixpkgs.flake = inputs.nixpkgs;
# Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in pkgs = import <nixpkgs> {}.
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# Pin flake registry nixpkgs to flake nixpkgs version.
# i.e. for use in nix search nixpkgs.
registry = {
nixpkgs.flake = inputs.nixpkgs;
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
# @wheel/@admin are added in OS specific modules.
];
# Set up caches.
extra-substituters = [
"https://marleyos.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Disable that annoying "git tree is dirty" warning.
warn-dirty = false;
auto-optimise-store = true;
use-xdg-base-directories = true;
};
# Garbage collection.
gc.automatic = true;
# More useful repl.
environment.systemPackages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
# @wheel/@admin are added in OS specific modules.
];
# Set up caches.
extra-substituters = [
"https://marleyos.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Disable that annoying "git tree is dirty" warning.
warn-dirty = false;
auto-optimise-store = true;
use-xdg-base-directories = true;
};
# Garbage collection.
gc.automatic = true;
# More useful repl.
environment.systemPackages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
}

View file

@ -1,7 +1,15 @@
{config, ...}: let
{
config,
inputs,
...
}: let
inherit (config.marleyos.my) name;
in {
home-manager.users."${name}" = {
home.homeDirectory = "/Users/${name}";
imports = [inputs.home-manager.darwinModules.home-manager];
config = {
home-manager.users."${name}" = {
home.homeDirectory = "/Users/${name}";
};
};
}

View file

@ -1,5 +1,7 @@
{
{inputs, ...}: {
imports = [
inputs.agenix.darwinModules.default
../base
./base
];

View file

@ -1,7 +1,14 @@
{config, ...}: let
{
config,
inputs,
...
}: let
inherit (config.marleyos.my) name;
in {
home-manager.users."${name}" = {
home.homeDirectory = "/home/${name}";
imports = [inputs.home-manager.nixosModules.home-manager];
config = {
home-manager.users."${name}" = {
home.homeDirectory = "/home/${name}";
};
};
}

View file

@ -1,5 +1,7 @@
{
{inputs, ...}: {
imports = [
inputs.agenix.nixosModules.default
../base
./base