mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
Refactor common module handling
This commit is contained in:
parent
1935998b62
commit
0948ec8e49
4 changed files with 21 additions and 22 deletions
|
|
@ -9,6 +9,7 @@
|
|||
./neovim.nix
|
||||
./starship.nix
|
||||
./terminal.nix
|
||||
./git.nix
|
||||
./direnv.nix
|
||||
./zellij.nix
|
||||
# ./nushell.nix (intergrates extremely poorly with the system)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
# Platform-independent terminal setup
|
||||
{
|
||||
# Key packages required on nixos and macos
|
||||
home.packages = with pkgs; [
|
||||
# Unixy tools
|
||||
ripgrep
|
||||
|
|
|
|||
|
|
@ -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
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue