variables: Add username

This commit is contained in:
Donovan Glover 2023-06-06 10:48:10 -04:00
parent b5ccd2e18b
commit 4d9a6b6877
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
7 changed files with 26 additions and 16 deletions

View File

@ -1,10 +1,12 @@
{
let
VARIABLES = import ../src/variables.nix;
in {
containers.rar = {
privateNetwork = true;
bindMounts = {
"/home/user" = {
hostPath = "/home/user/containers/rar";
hostPath = "/home/${VARIABLES.username}/containers/rar";
isReadOnly = false;
};
};

View File

@ -1,4 +1,5 @@
{config, ...}: let
VARIABLES = import ../src/variables.nix;
hostCfg = config;
in {
containers.wine = {
@ -6,7 +7,7 @@ in {
bindMounts = {
"/home/user" = {
hostPath = "/home/user/containers/wine";
hostPath = "/home/${VARIABLES.username}/containers/wine";
isReadOnly = false;
};

View File

@ -1,4 +1,6 @@
{pkgs, ...}: {
{pkgs, ...}: let
VARIABLES = import ../src/variables.nix;
in {
imports = [
./feh
./kitty
@ -150,7 +152,7 @@
};
initial_session = {
command = "${pkgs.hyprland}/bin/Hyprland";
user = "user";
user = VARIABLES.username;
};
};
};

View File

@ -1,9 +1,11 @@
{pkgs, ...}: {
{pkgs, ...}: let
VARIABLES = import ../../src/variables.nix;
in {
home-manager.sharedModules = [
{
services.mpd = {
enable = true;
musicDirectory = "/home/user/Music";
musicDirectory = "/home/${VARIABLES.username}/Music";
};
xdg.configFile."mpd/mpd.conf".text = ''

View File

@ -1,4 +1,6 @@
{
let
VARIABLES = import ../../src/variables.nix;
in {
home-manager.sharedModules = [
{
xdg.userDirs = {
@ -8,11 +10,11 @@
templates = null;
publicShare = null;
download = "/home/user/";
documents = "/home/user/";
music = "/home/user/";
pictures = "/home/user/";
videos = "/home/user/";
download = "/home/${VARIABLES.username}/";
documents = "/home/${VARIABLES.username}/";
music = "/home/${VARIABLES.username}/";
pictures = "/home/${VARIABLES.username}/";
videos = "/home/${VARIABLES.username}/";
};
xdg.configFile."user-dirs.locale".text = "ja_JP";

View File

@ -161,7 +161,7 @@ in {
users = {
mutableUsers = false;
users.user = {
users."${VARIABLES.username}" = {
isNormalUser = true;
uid = 1000;
password = "user";
@ -170,8 +170,8 @@ in {
};
home-manager.users.user = {
home.username = "user";
home.homeDirectory = "/home/user";
home.username = VARIABLES.username;
home.homeDirectory = "/home/${VARIABLES.username}";
};
# dev

View File

@ -6,4 +6,5 @@
stateVersion = "22.11";
defaultLocale = "ja_JP.UTF-8";
supportedLocales = ["ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8"];
username = "user";
}