Put every variables in top of the file for easy copy to another config

Former-commit-id: 0bd55fdc10
This commit is contained in:
Hadi
2024-10-09 15:12:50 +02:00
parent 3bebb475d7
commit 492d257fa5
27 changed files with 298 additions and 301 deletions

View File

@@ -1,8 +1,10 @@
{ config, ... }: {
{ config, ... }:
let configDir = config.var.configDirectory;
in {
system.autoUpgrade = {
enable = config.var.autoUpgrade;
dates = "04:00";
flake = "${config.var.configDirectory}";
flake = "${configDir}";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = false;
};

View File

@@ -1,4 +1,6 @@
{ config, ... }: {
{ config, ... }:
let autoGarbageCollector = config.var.autoGarbageCollector;
in {
nixpkgs.config = {
allowUnfree = true;
allowBroken = true;
@@ -16,7 +18,7 @@
];
};
gc = {
automatic = config.var.autoGarbageCollector;
automatic = autoGarbageCollector;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";

View File

@@ -1,10 +1,12 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
let username = config.var.username;
in {
programs.zsh.enable = true;
users = {
defaultUserShell = pkgs.zsh;
users.${config.var.username} = {
users.${username} = {
isNormalUser = true;
description = "${config.var.username} account";
description = "${username} account";
extraGroups = [ "networkmanager" "wheel" ];
};
};

View File

@@ -1,16 +1,20 @@
{ pkgs, config, ... }: {
{ pkgs, config, ... }:
let
hostname = config.var.hostname;
keyboardLayout = config.var.keyboardLayout;
in {
networking.hostName = config.var.hostname;
networking.hostName = hostname;
services = {
xserver = {
enable = true;
xkb.layout = config.var.keyboardLayout;
xkb.layout = keyboardLayout;
xkb.variant = "";
};
gnome.gnome-keyring.enable = true;
};
console.keyMap = config.var.keyboardLayout;
console.keyMap = keyboardLayout;
environment.variables = {
XDG_DATA_HOME = "$HOME/.local/share";