mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2026-03-19 15:50:30 +01:00
chore: move linux specific things to user-linux.nix
This commit is contained in:
parent
60a693cc91
commit
d3305f1e76
2 changed files with 50 additions and 21 deletions
22
modules/core/user-linux.nix
Normal file
22
modules/core/user-linux.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ username, ... }:
|
||||||
|
{
|
||||||
|
users.users.${username} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [
|
||||||
|
"networkmanager"
|
||||||
|
"wheel"
|
||||||
|
"docker"
|
||||||
|
"input"
|
||||||
|
"dialout"
|
||||||
|
"wheel"
|
||||||
|
];
|
||||||
|
initialPassword = "temporary-password";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
inherit username;
|
||||||
|
homeDirectory = "/home/${username}";
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts.fontconfig.antialias = false;
|
||||||
|
}
|
||||||
|
|
@ -1,18 +1,26 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
config,
|
|
||||||
username,
|
username,
|
||||||
host,
|
host,
|
||||||
|
lib,
|
||||||
|
system,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ inputs.home-manager.nixosModules.home-manager ]
|
(lib.optionals (system == "x64_64-linux") [ inputs.home-manager.nixosModules.home-manager ])
|
||||||
++ [ ./../../roles/default.nix ]
|
++ (lib.optionals (system == "aarch64-darwin") [ inputs.home-manager.darwinModules.home-manager ])
|
||||||
++ [ ./sops.nix ]
|
++ (lib.optionals (system == "x64_64-linux") [ ./../../roles/default.nix ])
|
||||||
|
++ (lib.optionals (system == "aarch64-linux") [ ./../../roles/default.nix ])
|
||||||
|
++ (lib.optionals (system == "x64_64-linux") [ ./user-linux.nix ])
|
||||||
|
++ (lib.optionals (system == "aarch64-linux") [ ./user-linux.nix ])
|
||||||
|
++ (lib.optionals (system == "x64_64-linux") [ ./sops.nix ])
|
||||||
|
++ (lib.optionals (system == "aarch64-linux") [ ./sops.nix ])
|
||||||
++ [ ./../../variables.nix ];
|
++ [ ./../../variables.nix ];
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
backupFileExtension = "bak";
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
extraSpecialArgs = { inherit inputs username host; };
|
extraSpecialArgs = { inherit inputs username host; };
|
||||||
|
|
@ -30,34 +38,33 @@
|
||||||
[ ./../home/default.server.nix ]
|
[ ./../home/default.server.nix ]
|
||||||
else if (host == "daisy") then
|
else if (host == "daisy") then
|
||||||
[ ./../home/default.server.nix ]
|
[ ./../home/default.server.nix ]
|
||||||
# else if (host == "yoshino") then
|
else if (system == "aarch64-darwin") then
|
||||||
# [ ./../home/default.nix ]
|
[ ./../home/default.azalea.nix ]
|
||||||
else
|
else
|
||||||
[ ./../home ];
|
[ ./../home ];
|
||||||
home = {
|
home = {
|
||||||
username = "${username}";
|
username = "liv";
|
||||||
homeDirectory = "/home/${username}";
|
|
||||||
stateVersion = "22.11";
|
stateVersion = "22.11";
|
||||||
|
sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
VISUAL = "nvim";
|
||||||
|
PAGER = "less";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
fonts.fontconfig.antialias = false;
|
|
||||||
|
|
||||||
users.users.${username} = {
|
users.users.${username} = {
|
||||||
isNormalUser = true;
|
home =
|
||||||
description = "${username}";
|
if (system == "x64_64-linux") then
|
||||||
extraGroups = [
|
"/home/${username}"
|
||||||
"networkmanager"
|
else if (system == "aarch64-darwin") then
|
||||||
"wheel"
|
"/Users/${username}"
|
||||||
"docker"
|
else
|
||||||
"input"
|
"/home/${username}";
|
||||||
"dialout"
|
|
||||||
"wheel"
|
|
||||||
];
|
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
initialPassword = "temporary-password";
|
description = "ahwx";
|
||||||
};
|
};
|
||||||
nix.settings.allowed-users = [ "${username}" ];
|
nix.settings.allowed-users = [ "${username}" ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue