Fix the issue with username

This commit is contained in:
serge 2024-03-03 22:14:32 +01:00
parent df23c11155
commit 0d0050a92e
4 changed files with 56 additions and 39 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
result

View File

@ -13,29 +13,29 @@
};
outputs = { self, nixpkgs, ... }@inputs:
let
lib = nixpkgs.lib;
system = "x86_64-linux";
in
{
nixosConfigurations = {
nixos = lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./machines/wospbook
inputs.home-manager.nixosModules.default
];
};
let
lib = nixpkgs.lib;
system = "x86_64-linux";
in
{
nixosConfigurations = {
nixos = lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./machines/wospbook
inputs.home-manager.nixosModules.default
];
};
kiwee = lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./machines/workstation
inputs.home-manager.nixosModules.default
];
};
kiwee = lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./machines/workstation
inputs.home-manager.nixosModules.default
];
};
};
};
}

View File

@ -1,21 +1,34 @@
{ pkgs, ... }:
{ pkgs, config, lib, ... }:
{
imports = [
./common.nix
./common.nix
];
home.username = "work";
home.homeDirectory = "/home/work";
options.work-user = {
username = lib.mkOption {
default = "work";
type = lib.types.str;
};
};
home.packages = with pkgs; [
firefox # Yuck!
thunderbird
slack
dbeaver
];
config =
let
cfg = config.work-user;
in
{
home.username = cfg.username;
home.homeDirectory = "/home/${cfg.username}";
home.packages = with pkgs; [
firefox # Yuck!
thunderbird
slack
dbeaver
];
programs.helix.extraPackages = [
pkgs.nodePackages_latest.intelephense
];
programs.helix.extraPackages = [
pkgs.nodePackages_latest.intelephense
];
};
}

View File

@ -1,5 +1,6 @@
{ config, pkgs, inputs, ... }:
let
username = "serge";
in
{
imports = [
./hardware-configuration.nix
@ -20,7 +21,9 @@
LC_TIME = "pl_PL.UTF-8";
};
users.users.serge = {
work-user.username = username;
users.users.${username}= {
isNormalUser = true;
uid = 1000;
description = "Serhii Korzh";
@ -28,7 +31,7 @@
};
home-manager.users = {
"serge" = import ../../home-manager/work.nix;
"${username}" = import ../../home-manager/work.nix;
};
# Enable automatic login for the user.