You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

{ pkgs, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
prefix = "/server/current";
in
{
imports = [
(import "${home-manager}/nixos")
];
systemd.tmpfiles.rules = [
"d /server 0777 root root"
];
users.users =
let
user =
{ zsh ? false, manager ? false, name, passwd }: {
isNormalUser = true;
home = "${prefix}/${name}";
createHome = true;
extraGroups = [ "current" ] ++
(if manager then ["docker" "wheel"] else []);
shell = (if zsh then pkgs.zsh else pkgs.bash);
password = passwd;
};
in
{
junikim = user { manager = true; name = "junikim"; passwd = "1234"; };
a = user { zsh = true; name = "a"; passwd = "1234"; };
b = user { name = "b"; passwd = "1234"; };
c = user { name = "c"; passwd = "1234"; };
};
home-manager.users =
let
user = name: {
home = {
username = name;
homeDirectory = "${prefix}/${name}";
stateVersion = "22.05";
};
programs = {
home-manager.enable = true;
neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
neovim-sensible
vim-airline
vim-airline-themes
vim-nix
];
};
git = {
enable = true;
};
};
};
in {
junikim = user "junikim";
a = user "a";
b = user "b";
};
}