2024-06-27 20:37:20 +02:00
|
|
|
{ config, pkgs, ... }:
|
2024-07-02 19:54:05 +02:00
|
|
|
let
|
|
|
|
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
|
|
|
|
in
|
2024-06-27 20:37:20 +02:00
|
|
|
{
|
2024-07-02 19:54:05 +02:00
|
|
|
# get home manager working
|
|
|
|
imports = [
|
|
|
|
# home manager for per user config
|
|
|
|
"${home-manager}/nixos"
|
|
|
|
];
|
|
|
|
|
2024-07-02 19:55:04 +02:00
|
|
|
# define the users we have on our systems
|
2024-06-27 20:37:20 +02:00
|
|
|
users = {
|
|
|
|
# all users and passwords are defined here
|
|
|
|
mutableUsers = false;
|
|
|
|
|
2024-07-29 18:21:20 +02:00
|
|
|
# default shell is ZSH
|
|
|
|
defaultUserShell = pkgs.zsh;
|
2024-06-27 20:37:20 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# administrator
|
|
|
|
#
|
|
|
|
|
|
|
|
users.root = {
|
|
|
|
# init password
|
2024-09-01 17:38:06 +02:00
|
|
|
hashedPassword = builtins.readFile "/nix/data/nixos/secret/password.secret";
|
2024-06-27 20:37:20 +02:00
|
|
|
|
|
|
|
# use fixed auth keys
|
2024-09-01 17:38:06 +02:00
|
|
|
openssh.authorizedKeys.keys = pkgs.lib.splitString "\n" (builtins.readFile "/nix/data/nixos/secret/authorized_keys.secret");
|
2024-06-27 20:37:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#
|
|
|
|
# my main user
|
|
|
|
#
|
|
|
|
|
|
|
|
users.cullmann = {
|
|
|
|
# hard code UID for stability over machines
|
|
|
|
uid = 1000;
|
|
|
|
|
|
|
|
# normal user
|
|
|
|
isNormalUser = true;
|
|
|
|
|
|
|
|
# it's me :P
|
|
|
|
description = "Christoph Cullmann";
|
|
|
|
|
|
|
|
# allow VirtualBox and sudo for my main user
|
|
|
|
extraGroups = [ "vboxusers" "wheel" ];
|
|
|
|
|
|
|
|
# init password
|
|
|
|
hashedPassword = config.users.users.root.hashedPassword;
|
|
|
|
|
|
|
|
# use fixed auth keys
|
|
|
|
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-02 19:54:05 +02:00
|
|
|
# home manager settings
|
|
|
|
home-manager = {
|
|
|
|
# let home manager install stuff to /etc/profiles
|
|
|
|
useUserPackages = true;
|
|
|
|
|
|
|
|
# use global pkgs
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
|
2024-07-02 21:39:05 +02:00
|
|
|
# use shared home manager settings
|
2024-07-02 19:54:05 +02:00
|
|
|
users.root = import ./home.nix;
|
|
|
|
users.cullmann = import ./home.nix;
|
|
|
|
};
|
2024-06-27 20:37:20 +02:00
|
|
|
}
|