Revert "share more settings"
This reverts commit 9c8723b16c
.
doesn't work that way
This commit is contained in:
parent
9c8723b16c
commit
845b4b6997
132
common.nix
132
common.nix
|
@ -2,58 +2,6 @@
|
|||
let
|
||||
impermanence = builtins.fetchTarball "https://github.com/nix-community/impermanence/archive/master.tar.gz";
|
||||
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
|
||||
|
||||
# shared user settings
|
||||
sharedUserSettings = {
|
||||
# init password
|
||||
hashedPassword = builtins.readFile "/data/nixos/password.secret";
|
||||
|
||||
# use fixed auth keys
|
||||
openssh.authorizedKeys.keys = pkgs.lib.splitString "\n" (builtins.readFile "/data/nixos/authorized_keys.secret");
|
||||
};
|
||||
|
||||
# shared home manager settings
|
||||
sharedHomeManagerSettings = {
|
||||
# initial version
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
# zsh with some nice prompt and extra main user configuration
|
||||
programs.starship.enable = true;
|
||||
programs.zoxide.enable = true;
|
||||
programs.zoxide.options = [ "--cmd" "cd" ];
|
||||
programs.zsh = {
|
||||
# zsh with extras wanted
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
history.share = false;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
# aliases
|
||||
shellAliases = {
|
||||
# system build/update/cleanup
|
||||
update = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot";
|
||||
upgrade = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot --upgrade";
|
||||
updatenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch";
|
||||
upgradenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch --upgrade";
|
||||
gc = "sudo nix-collect-garbage --delete-older-than 7d";
|
||||
verify = "sudo nix --extra-experimental-features nix-command store verify --all";
|
||||
optimize = "sudo nix --extra-experimental-features nix-command store optimise";
|
||||
|
||||
# overwrite some tools
|
||||
cat = "bat";
|
||||
ls = "lsd";
|
||||
|
||||
# ssh around in the local network
|
||||
mac = "ssh mac.fritz.box";
|
||||
macroot = "ssh root@mac.fritz.box";
|
||||
mini = "ssh mini.fritz.box";
|
||||
miniroot = "ssh root@mini.fritz.box";
|
||||
neko = "ssh neko.fritz.box";
|
||||
nekoroot = "ssh root@neko.fritz.box";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
#
|
||||
|
@ -578,12 +526,34 @@ in
|
|||
# all users and passwords are defined here
|
||||
users.mutableUsers = false;
|
||||
|
||||
# administrator, just the shared settings
|
||||
users.users.root = sharedUserSettings;
|
||||
home-manager.users.root = sharedHomeManagerSettings;
|
||||
#
|
||||
# administrator
|
||||
#
|
||||
|
||||
# main user
|
||||
users.users.cullmann = sharedUserSettings // {
|
||||
users.users.root = {
|
||||
# init password
|
||||
hashedPassword = builtins.readFile "/data/nixos/password.secret";
|
||||
|
||||
# use fixed auth keys
|
||||
openssh.authorizedKeys.keys = pkgs.lib.splitString "\n" (builtins.readFile "/data/nixos/authorized_keys.secret");
|
||||
};
|
||||
|
||||
home-manager.users.root = {
|
||||
# initial version
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
# zsh with some nice prompt
|
||||
programs.starship.enable = true;
|
||||
programs.zoxide.enable = true;
|
||||
programs.zoxide.options = [ "--cmd" "cd" ];
|
||||
programs.zsh.enable = true;
|
||||
};
|
||||
|
||||
#
|
||||
# my main user
|
||||
#
|
||||
|
||||
users.users.cullmann = {
|
||||
# hard code UID for stability over machines
|
||||
uid = 1000;
|
||||
|
||||
|
@ -595,9 +565,55 @@ in
|
|||
|
||||
# allow VirtualBox and sudo for my main user
|
||||
extraGroups = [ "vboxusers" "wheel" ];
|
||||
|
||||
# init password
|
||||
hashedPassword = builtins.readFile "/data/nixos/password.secret";
|
||||
|
||||
# use fixed auth keys
|
||||
openssh.authorizedKeys.keys = pkgs.lib.splitString "\n" (builtins.readFile "/data/nixos/authorized_keys.secret");
|
||||
};
|
||||
|
||||
home-manager.users.cullmann = {
|
||||
# initial version
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
# zsh with some nice prompt and extra main user configuration
|
||||
programs.starship.enable = true;
|
||||
programs.zoxide.enable = true;
|
||||
programs.zoxide.options = [ "--cmd" "cd" ];
|
||||
programs.zsh = {
|
||||
# zsh with extras wanted
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
history.share = false;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
# aliases
|
||||
shellAliases = {
|
||||
# system build/update/cleanup
|
||||
update = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot";
|
||||
upgrade = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot --upgrade";
|
||||
updatenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch";
|
||||
upgradenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch --upgrade";
|
||||
gc = "sudo nix-collect-garbage --delete-older-than 7d";
|
||||
verify = "sudo nix --extra-experimental-features nix-command store verify --all";
|
||||
optimize = "sudo nix --extra-experimental-features nix-command store optimise";
|
||||
|
||||
# overwrite some tools
|
||||
cat = "bat";
|
||||
ls = "lsd";
|
||||
|
||||
# ssh around in the local network
|
||||
mac = "ssh mac.fritz.box";
|
||||
macroot = "ssh root@mac.fritz.box";
|
||||
mini = "ssh mini.fritz.box";
|
||||
miniroot = "ssh root@mini.fritz.box";
|
||||
neko = "ssh neko.fritz.box";
|
||||
nekoroot = "ssh root@neko.fritz.box";
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.cullmann = sharedHomeManagerSettings // {
|
||||
# enable keychain
|
||||
programs.keychain = {
|
||||
enable = true;
|
||||
|
|
Loading…
Reference in a new issue