aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'nixos')
-rw-r--r--nixos/configuration.nix9
-rw-r--r--nixos/globals.nix4
-rw-r--r--nixos/services/syncthing.service.nix6
-rw-r--r--nixos/variables.nix15
4 files changed, 21 insertions, 13 deletions
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index 2690c28..dde33e1 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -7,11 +7,10 @@
pkgs,
...
}:
-let
- globals = import ./globals.nix;
-in
{
imports = [
+ ./variables.nix
+ ./nvidia.nix
./hardware-configuration.nix
];
boot.loader = {
@@ -58,11 +57,11 @@ in
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
networking = {
- hostName = "${globals.myHostName}";
+ hostName = "${config.myHostName}";
networkmanager.enable = true;
};
users.users = {
- "${globals.myUserName}" = {
+ "${config.myUserName}" = {
initialPassword = "stevenpassword";
isNormalUser = true;
openssh.authorizedKeys.keys = [
diff --git a/nixos/globals.nix b/nixos/globals.nix
deleted file mode 100644
index e8dc5e6..0000000
--- a/nixos/globals.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- myUserName = "stvnliu";
- myHostName = "homelab-nix";
-}
diff --git a/nixos/services/syncthing.service.nix b/nixos/services/syncthing.service.nix
index 17d52b1..24dbd28 100644
--- a/nixos/services/syncthing.service.nix
+++ b/nixos/services/syncthing.service.nix
@@ -1,8 +1,6 @@
{pkgs, lib, ...}:
-let
- myUserName = "";
-in
{
enable = true;
- user = ""
+ user = "${config.myUserName}";
+
}
diff --git a/nixos/variables.nix b/nixos/variables.nix
new file mode 100644
index 0000000..e6b111d
--- /dev/null
+++ b/nixos/variables.nix
@@ -0,0 +1,15 @@
+{config, pkgs, lib, ...}:
+{
+
+ # Type definitions for nix variables used in this configuration
+ options = with lib; with types; {
+ myUserName = mkOption { type = str; };
+ myHostName = mkOption { type = str; };
+ };
+
+ # Default values for this configuration
+ config = {
+ myUserName = "stvnliu";
+ myHostName = "homelab-nix";
+ };
+}