Skip to content

Commit

Permalink
refactor: move home manager logic into mini config
Browse files Browse the repository at this point in the history
  • Loading branch information
icecreammatt committed Mar 23, 2024
1 parent bbb4606 commit e68e5c7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 34 deletions.
35 changes: 3 additions & 32 deletions hosts/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,46 +135,17 @@
];
};

mini = lib.nixosSystem {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [
(import ../../overlay/overlay.nix)
];
};
mini = lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
inherit user username darkmode;
inherit inputs user darkmode username system nixpkgs;
};
modules = [
../../modules/options.nix
./config-common.nix
./networking.nix
./mini/configuration.nix
{
environment.systemPackages = [
helix-flake.packages."x86_64-linux".default
];
}
attic.nixosModules.atticd
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {inherit user username darkmode;};
home-manager.users."${user}" = {
home.stateVersion = "23.11";
imports = [
../../modules/options.nix
../../modules/shell/starship.nix
../../modules/shell/git.nix
../../modules/common.nix
../../modules/rust.nix
../../modules/k8s.nix
];
};
}
];
};

Expand Down
27 changes: 25 additions & 2 deletions hosts/nixos/mini/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
config,
pkgs,
user,
nixpkgs,
system,
...
}: {
}: let
pkgs = import nixpkgs {
config.allowUnfree = true;
system = "${system}";
overlays = [
(import ../../../overlay/overlay.nix)
];
};
in {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
Expand All @@ -20,6 +29,20 @@
./logging.nix
];

home-manager = {
extraSpecialArgs = {inherit pkgs;};
users."${user}" = {
imports = [
../../../modules/options.nix
../../../modules/shell/starship.nix
../../../modules/shell/git.nix
../../../modules/common.nix
../../../modules/rust.nix
../../../modules/k8s.nix
];
};
};

# nixpkgs.overlays = [
# (final: prev: {
# yazi = prev.yazi.overrideAttrs (oldAttrs: {
Expand Down

0 comments on commit e68e5c7

Please sign in to comment.