Skip to content

Commit

Permalink
use relative path imports instead of self.*Modules
Browse files Browse the repository at this point in the history
workaround for NixOS/nix#7270
  • Loading branch information
ngkz committed Jan 15, 2024
1 parent b25e65c commit afdc7b7
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 91 deletions.
8 changes: 4 additions & 4 deletions home/base/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ inputs, pkgs, ... }: {
imports = with inputs.self.homeManagerModules; [
tmpfs-as-home
{ pkgs, ... }: {
imports = [
../tmpfs-as-home.nix
./zsh
./tealdeer.nix
neovim
../neovim
];

xdg.enable = true;
Expand Down
17 changes: 8 additions & 9 deletions hosts/burner/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# configuration for ctfvm

{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, ... }:
let
inherit (lib) mkForce;
inherit (inputs) self;
in
{
networking.hostName = "burner";

imports = with self.nixosModules; [
base
sshd
libvirt-vm
hacking
imports = [
../../modules/base
../../modules/sshd.nix
../../modules/libvirt-vm
../../modules/hacking.nix
];

modules.libvirt-vm = {
Expand Down Expand Up @@ -175,8 +174,8 @@ in
};

home-manager.users.user = {
imports = with self.homeManagerModules; [
hacking
imports = [
../../home/hacking
];
};

Expand Down
47 changes: 23 additions & 24 deletions hosts/noguchi-pc/default.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
# configuration for noguchi-pc

{ config, lib, inputs, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
inherit (inputs) self nixos-hardware;
inherit (lib) mkAfter;
in
{
networking.hostName = "noguchi-pc";

imports = with self.nixosModules; [
agenix
base
grub-secureboot # workaround for buggy firmware
ssd
workstation
sway-desktop
vmm
btrfs-maintenance
nix-maintenance
zswap
bluetooth
hacking

profiles-laptop
profiles-intel-cpu
profiles-intel-wifi
imports = [
../../modules/agenix.nix
../../modules/base
../../modules/grub-secureboot
../../modules/ssd.nix
../../modules/workstation
../../modules/sway-desktop.nix
../../modules/vmm.nix
../../modules/btrfs-maintenance
../../modules/nix-maintenance
../../modules/zswap.nix
../../modules/bluetooth.nix
../../modules/hacking.nix

../../modules/profiles/laptop.nix
../../modules/profiles/intel-cpu.nix
../../modules/profiles/intel-wifi.nix
];

# hardware configuration
Expand Down Expand Up @@ -111,11 +110,11 @@ in
users.users.user.hashedPasswordFile = config.age.secrets.user-password-hash-noguchi-pc.path;

home-manager.users.user = {
imports = with self.homeManagerModules; [
workstation
sway-desktop
hacking
vmm
imports = [
../../home/workstation
../../home/sway-desktop
../../home/hacking
../../home/vmm.nix
];
};

Expand Down
53 changes: 25 additions & 28 deletions hosts/peregrine/default.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
# configuration for peregrine

{ config, lib, pkgs, inputs, ... }:
let
inherit (inputs) self nixos-hardware;
in
{
networking.hostName = "peregrine";

imports = with self.nixosModules; with nixos-hardware.nixosModules; [
agenix
base
grub-secureboot
ssd
sshd
workstation
sway-desktop
undervolt
nm-config-home
vmm
btrfs-maintenance
nix-maintenance
zswap
bluetooth
hacking

profiles-laptop
imports = with inputs.nixos-hardware.nixosModules; [
../../modules/agenix.nix
../../modules/base
../../modules/grub-secureboot
../../modules/ssd.nix
../../modules/sshd.nix
../../modules/workstation
../../modules/sway-desktop.nix
../../modules/undervolt.nix
../../modules/nm-config-home.nix
../../modules/vmm.nix
../../modules/btrfs-maintenance
../../modules/nix-maintenance
../../modules/zswap.nix
../../modules/bluetooth.nix
../../modules/hacking.nix

../../modules/profiles/laptop.nix
common-pc-laptop-acpi_call
profiles-intel-cpu
profiles-intel-wifi
../../modules/profiles/intel-cpu.nix
../../modules/profiles/intel-wifi.nix
];

# hardware configuration
Expand Down Expand Up @@ -116,11 +113,11 @@ in
users.users.user.hashedPasswordFile = config.age.secrets.user-password-hash-peregrine.path;

home-manager.users.user = {
imports = with self.homeManagerModules; [
workstation
sway-desktop
hacking
vmm
imports = [
../../home/workstation
../../home/sway-desktop
../../home/hacking
../../home/vmm.nix
];
};

Expand Down
17 changes: 8 additions & 9 deletions hosts/rednecked/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

{ inputs, lib, ... }:
let
inherit (inputs) self nixos-hardware;
inherit (lib) mkDefault;
in
{
imports = with self.nixosModules; with nixos-hardware.nixosModules; [
agenix
base
ssd
sshd
btrfs-maintenance
nix-maintenance
zswap
imports = with inputs.nixos-hardware.nixosModules; [
../../modules/agenix.nix
../../modules/base
../../modules/ssd.nix
../../modules/sshd.nix
../../modules/btrfs-maintenance
../../modules/nix-maintenance
../../modules/zswap.nix

common-pc
common-cpu-amd #common-cpu-amd-pstate zen2 onward
Expand Down
7 changes: 3 additions & 4 deletions hosts/rednecked/test-vm.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{ config, pkgs, inputs, lib, ... }:
{ config, pkgs, lib, ... }:
let
inherit (inputs) self;
inherit (lib) mkForce;
in
{
imports = with self.nixosModules; [
libvirt-vm
imports = [
../../modules/libvirt-vm
];

modules.libvirt-vm = {
Expand Down
2 changes: 1 addition & 1 deletion hosts/rednecked/user.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ in
users.users.user.hashedPasswordFile = config.age.secrets.user-password-hash-rednecked.path;

# home-manager.users.user = {
# imports = with self.homeManagerModules; [
# imports = [
# ];
# };
}
Expand Down
12 changes: 6 additions & 6 deletions modules/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{ config, lib, pkgs, utils, inputs, ... }:
let
inherit (lib) mapAttrs filterAttrs mapAttrsToList mkIf types mkOption;
inherit (inputs) self agenix home-manager;
inherit (inputs) self home-manager;
in
{
imports = with self.nixosModules; [
imports = [
home-manager.nixosModule
tmpfs-as-root
../tmpfs-as-root.nix
];

options.modules.base.pythonPackages = mkOption {
Expand Down Expand Up @@ -110,9 +110,9 @@ in
# install per-user packages to /etc/profiles to make nixos-rebuild build-vm work
useUserPackages = true;
users.user = {
imports = with self.homeManagerModules; [
nixos
base
imports = [
../../home/nixos.nix
../../home/base
];
};
extraSpecialArgs = {
Expand Down
8 changes: 4 additions & 4 deletions modules/sway-desktop.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# sway + greetd
{ inputs, config, pkgs, lib, ... }:
{ config, pkgs, lib, ... }:
{
# Sway wayland tiling compositor
programs.sway = {
Expand Down Expand Up @@ -80,9 +80,9 @@
nix.settings.allowed-users = [ "greeter" ];

home-manager.users.greeter = {
imports = with inputs.self.homeManagerModules; [
nixos
theming
imports = [
../home/nixos.nix
../home/theming
];
};

Expand Down
4 changes: 2 additions & 2 deletions modules/workstation/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ inputs, config, pkgs, lib, ... }:
{ config, pkgs, lib, ... }:
let
inherit (lib.ngkz) rot13;
in
{
imports = with inputs.self.nixosModules; [
imports = [
./printing.nix
./network-manager
./gpg.nix
Expand Down

0 comments on commit afdc7b7

Please sign in to comment.