feat: created variable-based nix configuration
Added variables.nix Added Syncthing service definition
This commit is contained in:
parent
8fecc5f592
commit
0770a70d0b
4 changed files with 21 additions and 13 deletions
|
@ -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 = [
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
myUserName = "stvnliu";
|
||||
myHostName = "homelab-nix";
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
{pkgs, lib, ...}:
|
||||
let
|
||||
myUserName = "";
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
user = ""
|
||||
user = "${config.myUserName}";
|
||||
|
||||
}
|
||||
|
|
15
nixos/variables.nix
Normal file
15
nixos/variables.nix
Normal file
|
@ -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";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue