Skip to content

Commit

Permalink
treewide: use Flake outputs instead of paths where it makes sense
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Dec 21, 2024
1 parent 7ceb15e commit 306a1f5
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 23 deletions.
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
;
in
recursiveMergeAttrs [
# Templates
{
inherit lib;
templates = {
Expand All @@ -134,6 +133,9 @@
};
};
overlays.default = import ./overlays { flake = self; };
darwinModules.default = import ./modules/nix-darwin;
homeModules.default = import ./modules/home-manager;
nixosModules.default = import ./modules/nixos;
}

# NixOS configs
Expand Down
4 changes: 2 additions & 2 deletions hosts/Sekai-MacBook-Pro/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ ... }:
{ flake, ... }:

{
imports = [ ../../modules/nix-darwin ];
imports = [ flake.outputs.darwinModules.default ];

mainUser.username = "thiago.okada";

Expand Down
9 changes: 3 additions & 6 deletions hosts/hachune-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
...
}:

let
inherit (flake) inputs;
in
{
imports = [
./hardware-configuration.nix
../../modules/nixos
inputs.hardware.nixosModules.common-cpu-amd
inputs.hardware.nixosModules.common-gpu-amd
flake.inputs.hardware.nixosModules.common-cpu-amd
flake.inputs.hardware.nixosModules.common-gpu-amd
flake.outputs.nixosModules.default
];

device = {
Expand Down
7 changes: 2 additions & 5 deletions hosts/miku-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
...
}:

let
inherit (flake) inputs;
in
{
imports = [
./hardware-configuration.nix
../../modules/nixos
inputs.hardware.nixosModules.common-cpu-intel
flake.inputs.hardware.nixosModules.common-cpu-intel
flake.outputs.nixosModules.default
];

nixos = {
Expand Down
2 changes: 1 addition & 1 deletion hosts/mirai-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/nixos
flake.inputs.disko.nixosModules.disko
flake.outputs.nixosModules.default
];

disko.devices = import ./disk-config.nix;
Expand Down
7 changes: 2 additions & 5 deletions hosts/sankyuu-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
...
}:

let
inherit (flake) inputs;
in
{
imports = [
./hardware-configuration.nix
../../modules/nixos
inputs.hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
flake.inputs.hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
flake.outputs.nixosModules.default
];

device = {
Expand Down
2 changes: 1 addition & 1 deletion hosts/zachune-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ in
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/nixos
flake.inputs.disko.nixosModules.disko
flake.outputs.nixosModules.default
] ++ oci-common.imports;

boot = {
Expand Down
2 changes: 1 addition & 1 deletion hosts/zatsune-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ in
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/nixos
flake.inputs.disko.nixosModules.disko
flake.outputs.nixosModules.default
] ++ oci-common.imports;

boot = {
Expand Down
2 changes: 1 addition & 1 deletion lib/flake-helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ in
username ? "thiagoko",
homePath ? "/home",
homeDirectory ? "${homePath}/${username}",
configuration ? ../modules/home-manager,
configuration ? self.outputs.homeModules.default,
deviceType ? "desktop",
extraModules ? [ ],
system ? "x86_64-linux",
Expand Down

0 comments on commit 306a1f5

Please sign in to comment.