Browse Source

Use modulesPath where appropriate

master
Emery Hemingway 1 month ago
parent
commit
7ce33808f2

+ 21
- 4
flake.nix View File

@@ -11,11 +11,28 @@
11 11
 
12 12
     nixosConfigurations = {
13 13
 
14
+      glotzbert = nixpkgs.lib.nixosSystem {
15
+        modules = [ ./hosts/glotzbert/configuration.nix ];
16
+        system = "x86_64-linux";
17
+      };
18
+
19
+      hydra = nixpkgs.lib.nixosSystem {
20
+        modules = [ ./hosts/hydra/configuration.nix ];
21
+        system = "x86_64-linux";
22
+      };
23
+
24
+      kibana = nixpkgs.lib.nixosSystem {
25
+        modules = [ ./hosts/containers/kibana/configuration.nix ];
26
+        system = "x86_64-linux";
27
+      };
28
+
29
+      pulsebert = nixpkgs.lib.nixosSystem {
30
+        modules = [ ./hosts/pulsebert/configuration.nix ];
31
+        system = "aarch64-linux";
32
+      };
33
+
14 34
       server7 = nixpkgs.lib.nixosSystem {
15
-        modules = [
16
-          ./hosts/server7
17
-          hydra.nixosModules.hydra
18
-        ];
35
+        modules = [ ./hosts/server7 hydra.nixosModules.hydra ];
19 36
         system = "x86_64-linux";
20 37
       };
21 38
 

+ 8
- 9
hosts/containers/freifunk/configuration.nix View File

@@ -1,4 +1,4 @@
1
-{ config, pkgs, lib, ... }:
1
+{ config, pkgs, lib, modulesPath, ... }:
2 2
 
3 3
 let
4 4
   coreAddress = "172.20.72.40";
@@ -11,16 +11,15 @@ let
11 11
   ddmeshNode = 51073;
12 12
   ddmeshAddrPart = "200.74";
13 13
   rt_table = 7;
14
-  bmxd = import (toString <lib/pkgs/bmxd.nix>) { inherit pkgs; };
15
-  sysinfo-json = import <this-host/sysinfo-json.nix> {
16
-    inherit pkgs bmxd ddmeshNode;
17
-  };
14
+  bmxd = import  ../../../lib/pkgs/bmxd.nix { inherit pkgs; };
15
+  sysinfo-json =
16
+    import ./sysinfo-json.nix { inherit pkgs bmxd ddmeshNode; };
18 17
 in {
19 18
   imports = [
20
-    <nixpkgs/nixos/modules/profiles/minimal.nix>
21
-    <lib>
22
-    <lib/lxc-container.nix>
23
-    <lib/shared.nix>
19
+    (modulesPath + "/profiles/minimal.nix")
20
+    ../../../lib
21
+    ../../../lib/lxc-container.nix
22
+    ../../../lib/shared.nix
24 23
   ];
25 24
 
26 25
   boot.tmpOnTmpfs = true;

+ 2
- 2
hosts/containers/grafana/configuration.nix View File

@@ -1,8 +1,8 @@
1
-{ config, pkgs, lib, ... }:
1
+{ config, pkgs, lib, modulesPath, ... }:
2 2
 
3 3
 {
4 4
   imports = [
5
-    <nixpkgs/nixos/modules/profiles/minimal.nix>
5
+    (modulesPath + "/profiles/minimal.nix")
6 6
     ../../../lib
7 7
     ../../../lib/lxc-container.nix
8 8
     ../../../lib/shared.nix

+ 5
- 5
hosts/containers/kibana/configuration.nix View File

@@ -1,11 +1,11 @@
1
-{ config, pkgs, lib, ... }:
1
+{ config, pkgs, lib, modulesPath, ... }:
2 2
 
3 3
 {
4 4
   imports = [
5
-    <nixpkgs/nixos/modules/profiles/minimal.nix>
6
-    <lib>
7
-    <lib/lxc-container.nix>
8
-    <lib/shared.nix>
5
+    (modulesPath + "/profiles/minimal.nix")
6
+    ../../../lib
7
+    ../../../lib/lxc-container.nix
8
+    ../../../lib/shared.nix
9 9
   ];
10 10
 
11 11
   networking.hostName = "kibana";

+ 6
- 7
hosts/containers/ledstripes/configuration.nix View File

@@ -1,11 +1,11 @@
1
-{ config, pkgs, lib, ... }:
1
+{ config, pkgs, lib, modulesPath, ... }:
2 2
 
3 3
 {
4 4
   imports = [
5
-    <nixpkgs/nixos/modules/profiles/minimal.nix>
6
-    <lib>
7
-    <lib/lxc-container.nix>
8
-    <lib/shared.nix>
5
+    (modulesPath + "/profiles/minimal.nix")
6
+    ../../../lib
7
+    ../../../lib/lxc-container.nix
8
+    ../../../lib/shared.nix
9 9
   ];
10 10
 
11 11
   c3d2 = {
@@ -22,8 +22,7 @@
22 22
   environment.systemPackages = [ pkgs.git ];
23 23
 
24 24
   systemd.services.ledball =
25
-    let
26
-      pile = import (toString <lib/pkgs/pile.nix>) { inherit pkgs; };
25
+    let pile = import ../../../lib/pkgs/pile.nix { inherit pkgs; };
27 26
     in {
28 27
       after = [ "network-online.target" ];
29 28
       wantedBy = [ "multi-user.target" ];

+ 7
- 7
hosts/containers/lxc-template.nix View File

@@ -2,15 +2,15 @@
2 2
 # your system.  Help is available in the configuration.nix(5) man page
3 3
 # and in the NixOS manual (accessible by running ‘nixos-help’).
4 4
 
5
-{ config, pkgs, lib, ... }:
5
+{ config, pkgs, lib, modulesPath, ... }:
6 6
 
7 7
 {
8
-  imports =
9
-    [ ../../lib/lxc-container.nix
10
-      ../../lib/shared.nix
11
-      ../../lib/admins.nix
12
-      <nixpkgs/nixos/modules/profiles/minimal.nix>
13
-    ];
8
+  imports = [
9
+    ../../lib/lxc-container.nix
10
+    ../../lib/shared.nix
11
+    ../../lib/admins.nix
12
+    (modulesPath + "/profiles/minimal.nix")
13
+  ];
14 14
 
15 15
   networking.hostName = "nixbert"; # Define your hostname.
16 16
   networking.useNetworkd = false;

+ 5
- 5
hosts/containers/scrape/configuration.nix View File

@@ -1,4 +1,4 @@
1
-{ config, pkgs, lib, ... }:
1
+{ config, pkgs, lib, modulesPath, ... }:
2 2
 
3 3
 let
4 4
   freifunkNodes = {
@@ -12,10 +12,10 @@ let
12 12
   };
13 13
 in {
14 14
   imports = [
15
-    <nixpkgs/nixos/modules/profiles/minimal.nix>
16
-    <lib>
17
-    <lib/lxc-container.nix>
18
-    <lib/shared.nix>
15
+    (modulesPath + "/profiles/minimal.nix")
16
+    ../../../lib
17
+    ../../../lib/lxc-container.nix
18
+    ../../../lib/shared.nix
19 19
   ];
20 20
 
21 21
   c3d2 = {

+ 1
- 1
hosts/glotzbert/configuration.nix View File

@@ -1,7 +1,7 @@
1 1
 { config, pkgs, ... }:
2 2
 
3 3
 {
4
-  imports = [ <this-host/hardware-configuration.nix> <lib> ];
4
+  imports = [ ./hardware-configuration.nix ../../lib ];
5 5
 
6 6
   c3d2 = {
7 7
     users.k-ot = true;

+ 2
- 4
hosts/glotzbert/hardware-configuration.nix View File

@@ -1,12 +1,10 @@
1 1
 # Do not modify this file!  It was generated by ‘nixos-generate-config’
2 2
 # and may be overwritten by future invocations.  Please make changes
3 3
 # to /etc/nixos/configuration.nix instead.
4
-{ config, lib, pkgs, ... }:
4
+{ config, lib, pkgs, modulesPath, ... }:
5 5
 
6 6
 {
7
-  imports =
8
-    [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9
-    ];
7
+  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
10 8
 
11 9
   boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
12 10
   boot.kernelModules = [ "kvm-intel" ];

+ 3
- 4
hosts/pulsebert/configuration.nix View File

@@ -5,10 +5,9 @@
5 5
 { config, pkgs, ... }:
6 6
 
7 7
 {
8
-  imports =
9
-    [ # Include the results of the hardware scan.
10
-      <this-host/hardware-configuration.nix>
11
-    ];
8
+  imports = [ # Include the results of the hardware scan.
9
+    ./hardware-configuration.nix
10
+  ];
12 11
 
13 12
   boot.loader.grub.enable = false;
14 13
   boot.loader.generic-extlinux-compatible.enable = false;

+ 0
- 1
hosts/server7/default.nix View File

@@ -3,7 +3,6 @@
3 3
 let yggaddr = import ../../lib/server7-yggaddr.nix;
4 4
 in {
5 5
   imports = [
6
-    # <nixpkgs/nixos/modules/profiles/minimal.nix>
7 6
     ../../lib
8 7
     ../../lib/default-gateway.nix
9 8
     ./borgbackup.nix

+ 5
- 5
lib/lxc-container.nix View File

@@ -1,10 +1,10 @@
1
-{ pkgs, lib, ... }:
1
+{ pkgs, lib, modulesPath, ... }:
2 2
 
3 3
 {
4
-  imports =
5
-    [ <nixpkgs/nixos/modules/profiles/minimal.nix>
6
-      <nixpkgs/nixos/modules/profiles/docker-container.nix>
7
-    ];
4
+  imports = [
5
+    (modulesPath + "/profiles/minimal.nix")
6
+    (modulesPath + "/profiles/docker-container.nix")
7
+  ];
8 8
 
9 9
   networking.networkmanager.dns = "unbound";
10 10
   networking.useHostResolvConf = false;

Loading…
Cancel
Save