Skip to content

Commit

Permalink
*: remove use of top-level modules
Browse files Browse the repository at this point in the history
including them twice causes conflicting declaration errors
maybe https://github.com/NixOS/nix/issues/7270(?)
  • Loading branch information
denbeigh2000 committed Aug 26, 2023
1 parent a74fd20 commit 306f7b1
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 23 deletions.
22 changes: 13 additions & 9 deletions configs/nixos/bruce.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
}
({ self, ... }:
{
imports = with self.nixosModules; [
cloud
www
ahoy
ci
nix-cache
standard
tailscale
terraform
imports = [
# NOTE: Deduping imports from flake modules is broken(?)
# https://github.com/NixOS/nix/issues/7270
# Can't easily re-use from self.nixosModules (either here
# or within) until resolved
../../modules/nixos/cloud
../../modules/nixos/nginx
../../modules/nixos/ahoy.nix
../../modules/nixos/ci.nix
../../modules/nixos/nix-cache.nix
../../modules/nixos/standard.nix
../../modules/nixos/tailscale.nix
../../modules/nixos/terraform.nix
];
config = {
denbeigh = {
Expand Down
6 changes: 5 additions & 1 deletion configs/nixos/coder-ec2-aarch64-plain.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
modules = [
({ self, ... }:
{
imports = with self.nixosModules; [ standard cloud aws-aarch64 ];
imports = [
../../modules/nixos/standard.nix
../../modules/nixos/cloud
../../modules/nixos/cloud/aws-aarch64
];
config = {
denbeigh.machine.hostname = "plain";
denbeigh.user.enable = false;
Expand Down
5 changes: 4 additions & 1 deletion configs/nixos/coder-ec2-aarch64.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
modules = [
({ self, ... }:
{
imports = with self.nixosModules; [ standard aws-aarch64 ];
imports = [
../../modules/nixos/standard.nix
../../modules/nixos/cloud/aws/aarch64.nix
];
config = {
denbeigh.machine.hostname = "dev";
};
Expand Down
6 changes: 5 additions & 1 deletion configs/nixos/coder-ec2-x86.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
modules = [
({ self, ... }:
{
imports = with self.nixosModules; [ standard aws cloud ];
imports = [
../../modules/nixos/standard.nix
../../modules/nixos/cloud/aws
../../modules/nixos/cloud
];
config = {
denbeigh.machine.hostname = "dev";
};
Expand Down
6 changes: 3 additions & 3 deletions configs/nixos/faye.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
modules = [
({ self, ... }:
{
imports = with self.nixosModules; [
standard
router
imports = [
../../modules/nixos/standard.nix
../../modules/nixos/router
];
config = {
boot = {
Expand Down
8 changes: 4 additions & 4 deletions configs/nixos/feliccia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
modules = [
({ self, ... }:
{
imports = with self.nixosModules; [
standard
development
gaming
imports = [
../../modules/nixos/standard.nix
../../modules/nixos/development.nix
../../modules/nixos/gaming.nix
];
config = {
boot.loader.grub = {
Expand Down
4 changes: 2 additions & 2 deletions configs/nixos/live.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
}
({ self, modulesPath, ... }: {
imports = [
self.nixosModules.cloud
self.nixosModules.standard
../../modules/nixos/cloud
../../modules/nixos/standard.nix
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
];
})
Expand Down
1 change: 0 additions & 1 deletion modules/nixos/standard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ in

../common/standard.nix
../common/variables.nix
# TODO: Expose these as top-level modules, import them through `self.nixosModules`
./denbeigh.nix
./utils.nix
./graphical.nix
Expand Down
5 changes: 4 additions & 1 deletion modules/nixos/use-nix-cache.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ in
{
# Ensures services.nix-cache options are defined
# (but they're disabled by default)
imports = [ ./nix-cache.nix ../common/use-nix-cache.nix ];
imports = [
./nix-cache.nix
../common/use-nix-cache.nix
];

config.denbeigh.nix-cache.enable = mkDefault (!config.denbeigh.services.nix-cache.enable);
}

0 comments on commit 306f7b1

Please sign in to comment.