refac: restructure users

This commit is contained in:
Dmitriy Pleshevskiy 2022-10-08 13:22:46 +03:00
parent b0afdac571
commit 1e2ff5b882
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
51 changed files with 16 additions and 16 deletions

2
.gitattributes vendored
View file

@ -1 +1 @@
secrets.nix filter=git-crypt diff=git-crypt **/secrets.nix filter=git-crypt diff=git-crypt

View file

@ -1,11 +1,11 @@
switchHm = home-manager switch --flake switchHm = home-manager switch --flake
switchSys = nixos-rebuild switch --flake switchSys = nixos-rebuild switch --flake
home-me: fix-systemd users-jan: fix-systemd
${switchHm} .#home-me ${switchHm} .#users-jan
home-laptop-me: fix-systemd users-laptop-jan: fix-systemd
${switchHm} .#home-laptop-me ${switchHm} .#users-laptop-jan
sys-home: sys-home:
sudo ${switchSys} .#system-home sudo ${switchSys} .#system-home

View file

@ -14,18 +14,18 @@ let
]; ];
}; };
mkHome = mods: home-manager.lib.homeManagerConfiguration { mkUsersJan = mods: home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
inputs.wired.homeManagerModules.default inputs.wired.homeManagerModules.default
../home/home.nix ../users/jan/home.nix
] ++ mods; ] ++ mods;
}; };
in in
{ {
home-me = mkHome [ ]; users-jan = mkUsersJan [ ];
home-laptop-me = mkHome [ users-laptop-jan = mkUsersJan [
({ config, ... }: { ({ config, ... }: {
progs.alacritty.fontSize = 6.0; progs.alacritty.fontSize = 6.0;
}) })

Binary file not shown.

View file

@ -97,8 +97,8 @@ in
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.me = { users.users.me = {
isNormalUser = true; isNormalUser = true;
name = secrets.userName; name = secrets.mainUser.userName;
home = secrets.userDir; home = secrets.mainUser.userDir;
extraGroups = [ extraGroups = [
"wheel" # Enable sudo for the user. "wheel" # Enable sudo for the user.
"networkmanager" "networkmanager"
@ -131,7 +131,7 @@ in
settings = { settings = {
auto-optimise-store = true; auto-optimise-store = true;
trusted-users = [ "root" secrets.userName ]; trusted-users = [ "root" secrets.mainUser.userName ];
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];

View file

@ -1,12 +1,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
secrets = import ../secrets.nix; secrets = import ./secrets.nix;
in in
{ {
imports = (import ./ui) ++ (import ./shell) ++ (import ./progs); imports = (import ./ui) ++ (import ./shell) ++ (import ./progs);
nixpkgs.overlays = import ../overlays; nixpkgs.overlays = import ../../overlays;
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.
@ -120,12 +120,12 @@ in
home.file = { home.file = {
"scripts" = { "scripts" = {
source = ../scripts; source = ./scripts;
recursive = true; recursive = true;
}; };
"pictures/wallpapers" = { "pictures/wallpapers" = {
source = ../wallpapers; source = ./wallpapers;
recursive = true; recursive = true;
}; };
}; };

BIN
users/jan/secrets.nix Normal file

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 5.4 MiB

After

Width:  |  Height:  |  Size: 5.4 MiB

View file

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View file

Before

Width:  |  Height:  |  Size: 4.7 MiB

After

Width:  |  Height:  |  Size: 4.7 MiB

View file

Before

Width:  |  Height:  |  Size: 4.5 MiB

After

Width:  |  Height:  |  Size: 4.5 MiB

View file

Before

Width:  |  Height:  |  Size: 4.9 MiB

After

Width:  |  Height:  |  Size: 4.9 MiB

View file

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

View file

Before

Width:  |  Height:  |  Size: 4.5 MiB

After

Width:  |  Height:  |  Size: 4.5 MiB

View file

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

View file

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

View file

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

View file

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View file

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB