aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-17 10:19:47 +0200
committerMartin Fischer <martin@push-f.com>2026-10-17 11:55:48 +0200
commitb2f4c85a6c1afb74b257a14dcce9236ae021fe4a (patch)
tree1cfa3537c28fb96fc99370f560622de60f470f86 /nixos
parent96f1b03a5faf7dcfa81818986d9365aa786d7d4d (diff)
refactor: pass sources via specialArgs
Diffstat (limited to 'nixos')
-rw-r--r--nixos/hosts/ev/default.nix3
-rw-r--r--nixos/hosts/hamac/default.nix3
-rw-r--r--nixos/hosts/tente/default.nix3
-rw-r--r--nixos/profiles/common/default.nix16
-rw-r--r--nixos/profiles/workstation/create.nix5
-rw-r--r--nixos/profiles/workstation/default.nix3
-rwxr-xr-xnixos/rebuild2
-rw-r--r--nixos/shared/prometheus-sql-exporter/default.nix4
-rw-r--r--nixos/shared/prometheus-sql-exporter/service.nix4
-rw-r--r--nixos/shared/prometheus-storagebox-exporter/default.nix4
-rw-r--r--nixos/shared/prometheus-storagebox-exporter/service.nix4
-rw-r--r--nixos/system.nix4
12 files changed, 22 insertions, 33 deletions
diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix
index 3e30678..a528fe4 100644
--- a/nixos/hosts/ev/default.nix
+++ b/nixos/hosts/ev/default.nix
@@ -2,13 +2,12 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, sources, ... }:
let
ports = import ./ports.nix;
helpers = import <top/helpers.nix> { inherit config lib pkgs; };
backupHost = "u518695-sub2@u518695-sub2.your-storagebox.de";
- sources = import <top/npins>;
pkgs-unstable = import sources.nixos-unstable {};
in
{
diff --git a/nixos/hosts/hamac/default.nix b/nixos/hosts/hamac/default.nix
index f258606..c68c408 100644
--- a/nixos/hosts/hamac/default.nix
+++ b/nixos/hosts/hamac/default.nix
@@ -1,9 +1,8 @@
# See the configuration.nix(5) man page and the NixOS manual (accessible by running `nixos-help`).
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, sources, ... }:
let
- sources = import <top/npins>;
pkgs-unstable = import sources.nixos-unstable {};
in
{
diff --git a/nixos/hosts/tente/default.nix b/nixos/hosts/tente/default.nix
index edf2bd8..04a2c98 100644
--- a/nixos/hosts/tente/default.nix
+++ b/nixos/hosts/tente/default.nix
@@ -2,14 +2,13 @@
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, sources, ... }:
let
baseDomain = "push-f.com";
acmeEmail = "martin@push-f.com";
backupHost = "u518695-sub1@u518695-sub1.your-storagebox.de";
ports = import ./ports.nix;
- sources = import <top/npins>;
helpers = import <top/helpers.nix> { inherit config lib pkgs; };
gitoliteDataDir = "/srv/gitolite";
reposDir = "${gitoliteDataDir}/repositories";
diff --git a/nixos/profiles/common/default.nix b/nixos/profiles/common/default.nix
index 1705adf..d891879 100644
--- a/nixos/profiles/common/default.nix
+++ b/nixos/profiles/common/default.nix
@@ -1,13 +1,9 @@
-{ config, pkgs, ... }:
+{ config, pkgs, sources, ... }:
{
- imports =
- let
- sources = import <top/npins>;
- in
- [
- ./sanix.nix
- ./basics.nix
- "${sources.agenix}/modules/age.nix"
- ];
+ imports = [
+ ./sanix.nix
+ ./basics.nix
+ "${sources.agenix}/modules/age.nix"
+ ];
}
diff --git a/nixos/profiles/workstation/create.nix b/nixos/profiles/workstation/create.nix
index 5580ec4..08320e6 100644
--- a/nixos/profiles/workstation/create.nix
+++ b/nixos/profiles/workstation/create.nix
@@ -1,8 +1,5 @@
-{ config, pkgs, pkgs-unstable, ... }:
+{ config, pkgs, pkgs-unstable, sources, ... }:
-let
- sources = import <top/npins>;
-in
{
environment.systemPackages = with pkgs; [
graphviz-nox # for dot
diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix
index 9332bca..0961a24 100644
--- a/nixos/profiles/workstation/default.nix
+++ b/nixos/profiles/workstation/default.nix
@@ -1,8 +1,7 @@
-{ config, lib, pkgs, pkgs-unstable, ... }:
+{ config, lib, pkgs, pkgs-unstable, sources, ... }:
let
cfg = config.workstation;
- sources = import <top/npins>;
cmd50 = pkgs.callPackage (sources.my-cmd50 { inherit pkgs; }) {};
in
{
diff --git a/nixos/rebuild b/nixos/rebuild
index d6a06a8..dc7ee5d 100755
--- a/nixos/rebuild
+++ b/nixos/rebuild
@@ -47,5 +47,5 @@ nixpkgsPath=$(
# nixos-rebuild always reads Nixpkgs from the NIX_PATH,
# so we need to set it explicitly to our pinned version
- exec nixos-rebuild "$@" -I nixpkgs="$nixpkgsPath" -I nixos-config="$configPath" -I top="$top"
+ exec nixos-rebuild "$@" --file "$top/system.nix" -I nixpkgs="$nixpkgsPath" -I nixos-config="$configPath" -I top="$top"
)
diff --git a/nixos/shared/prometheus-sql-exporter/default.nix b/nixos/shared/prometheus-sql-exporter/default.nix
index 5d80a62..e049396 100644
--- a/nixos/shared/prometheus-sql-exporter/default.nix
+++ b/nixos/shared/prometheus-sql-exporter/default.nix
@@ -1,10 +1,8 @@
{
lib,
buildGoModule,
+ sources,
}:
-let
- sources = import <top/npins>;
-in
buildGoModule {
pname = "sql_exporter";
version = sources.prometheus-sql-exporter.version;
diff --git a/nixos/shared/prometheus-sql-exporter/service.nix b/nixos/shared/prometheus-sql-exporter/service.nix
index a79528c..3bbf5c2 100644
--- a/nixos/shared/prometheus-sql-exporter/service.nix
+++ b/nixos/shared/prometheus-sql-exporter/service.nix
@@ -1,8 +1,8 @@
# TODO: submit burningalchemist's sql_exporter to nixpkgs
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, sources, ... }:
let
- sqlExporter = pkgs.callPackage ./default.nix {};
+ sqlExporter = pkgs.callPackage ./default.nix { inherit sources; };
cfg = config.services.prometheus-sql-exporter;
configFile = builtins.toFile "config.yaml" (builtins.toJSON cfg.config);
validateConfig = file:
diff --git a/nixos/shared/prometheus-storagebox-exporter/default.nix b/nixos/shared/prometheus-storagebox-exporter/default.nix
index 281290f..d4fd13e 100644
--- a/nixos/shared/prometheus-storagebox-exporter/default.nix
+++ b/nixos/shared/prometheus-storagebox-exporter/default.nix
@@ -1,10 +1,8 @@
{
lib,
buildGoModule,
+ sources,
}:
-let
- sources = import <top/npins>;
-in
buildGoModule {
pname = "storagebox_exporter";
version = sources.prometheus-storagebox-exporter.version;
diff --git a/nixos/shared/prometheus-storagebox-exporter/service.nix b/nixos/shared/prometheus-storagebox-exporter/service.nix
index 74f0dd1..1d3cff5 100644
--- a/nixos/shared/prometheus-storagebox-exporter/service.nix
+++ b/nixos/shared/prometheus-storagebox-exporter/service.nix
@@ -1,8 +1,8 @@
# TODO: submit Christian's storagebox exporter to nixpkgs
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, sources, ... }:
let
- storageboxExporter = pkgs.callPackage ./default.nix {};
+ storageboxExporter = pkgs.callPackage ./default.nix { inherit sources; };
cfg = config.services.prometheus-storagebox-exporter;
in
{
diff --git a/nixos/system.nix b/nixos/system.nix
new file mode 100644
index 0000000..a3b04cb
--- /dev/null
+++ b/nixos/system.nix
@@ -0,0 +1,4 @@
+import <nixpkgs/nixos> {
+ configuration = import <nixos-config>;
+ specialArgs.sources = import ./npins;
+}