Refactor common module handling

This commit is contained in:
Sridhar Ratnakumar 2023-04-27 09:29:45 -04:00
parent 1935998b62
commit 0948ec8e49
4 changed files with 21 additions and 22 deletions

View file

@ -9,6 +9,7 @@
./neovim.nix
./starship.nix
./terminal.nix
./git.nix
./direnv.nix
./zellij.nix
# ./nushell.nix (intergrates extremely poorly with the system)

View file

@ -1,7 +1,7 @@
{ pkgs, lib, ... }:
# Platform-independent terminal setup
{
# Key packages required on nixos and macos
home.packages = with pkgs; [
# Unixy tools
ripgrep

View file

@ -7,18 +7,15 @@
home-manager.users.${config.people.myself} = { pkgs, ... }: {
imports = [
self.homeModules.common-darwin
../home/terminal.nix
../home/git.nix
];
};
};
default.imports = [
self.darwinModules.home-manager
self.darwinModules.myself
../nixos/nix.nix
../nixos/caches
self.nixosModules.common
];
};
};
}

View file

@ -1,27 +1,28 @@
{ self, inputs, config, ... }:
let
mkHomeModule = name: extraModules: {
users.users.${name}.isNormalUser = true;
home-manager.users.${name} = {
imports = [
self.homeModules.common-linux
../home/git.nix
] ++ extraModules;
};
};
in
{ self, config, ... }:
{
# Configuration common to all Linux systems
flake = {
nixosModules = {
myself = mkHomeModule config.people.myself [
../home/terminal.nix
myself = {
users.users.${config.people.myself}.isNormalUser = true;
home-manager.users.${config.people.myself} = {
imports = [
self.homeModules.common-linux
];
};
};
# Common to all platforms
common.imports = [
./nix.nix
./caches
];
default.imports = [
self.nixosModules.home-manager
self.nixosModules.myself
./nix.nix
./caches
self.nixosModules.common
./self-ide.nix
./ssh-authorize.nix
./current-location.nix