Basic configuration for new servers and start modularizing config

This commit is contained in:
Charlotte Van Petegem 2020-12-01 19:23:28 +01:00
parent 82bb5b401c
commit ca93d09059
No known key found for this signature in database
GPG key ID: 019E764B7184435A
38 changed files with 622 additions and 316 deletions

View file

@ -1,14 +0,0 @@
{ ... }:
{
virtualisation.docker = {
enable = true;
extraOptions = "--data-root /data/var/lib/docker";
storageDriver = "zfs";
};
users.users.charlotte.extraGroups = [
"docker"
];
}

View file

@ -1,44 +0,0 @@
{ config, lib, pkgs, ... }:
{
options.chvp.git.email = lib.mkOption {
type = lib.types.str;
default = "charlotte@vanpetegem.me";
example = "charlotte@vanpetegem.me";
description = ''
Default email set in global git config.
'';
};
config.home-manager.users.charlotte = { pkgs, ... }: {
home.packages = with pkgs; [
gitAndTools.gitflow
git-crypt
];
programs.git = {
enable = true;
extraConfig = {
branch = {
autosetuprebase = "always";
};
pull = {
rebase = true;
};
};
ignores = [
".direnv"
".envrc"
"shell.nix"
# Ruby dependencies in source tree
"/vendor/bundle"
"**/*.patch"
];
signing = {
key = "charlotte@vanpetegem.me";
signByDefault = true;
};
userEmail = config.chvp.git.email;
userName = "Charlotte Van Petegem";
};
};
}

View file

@ -1,41 +0,0 @@
{ ... }:
{
imports = [ ./ssh/secret.nix ];
chvp.zfs.homeLinks = [
{ path = ".ssh/known_hosts"; type = "cache"; }
];
nixpkgs.overlays = [
(self: super: {
ssh = self.symlinkJoin {
name = "openssh";
paths = [
(
self.writeShellScriptBin "ssh" ''
export TERM=xterm-256color
${super.openssh}/bin/ssh $@
''
)
super.openssh
];
};
})
];
home-manager.users.charlotte = { pkgs, ... }: {
home.packages = with pkgs; [
ssh
];
programs.ssh = {
enable = true;
compression = true;
hashKnownHosts = true;
serverAliveInterval = 300;
extraConfig = ''
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
'';
};
};
}

Binary file not shown.

View file

@ -23,8 +23,8 @@ pkgs.writeShellScriptBin "screenshot" ''
if [[ -n "$remote" ]]
then
name=$(${pkgs.utillinux}/bin/uuidgen).png
${pkgs.grim}/bin/grim -t png -g "$dims" - | ${pkgs.openssh}/bin/ssh sunspear "cat > /usr/share/nginx/html/screenshots/$name"
path="https://cvpetegem.be/screenshots/$name"
${pkgs.grim}/bin/grim -t png -g "$dims" - | ${pkgs.openssh}/bin/ssh data "cat > data/public/$name"
path="https://data.vanpetegem.me/public/$name"
else
name=$(date +'screenshot_%Y-%m-%d-%H%M%S.png')
path="$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/$name"

View file

@ -1,23 +1,5 @@
{ pkgs, ... }:
{
imports = [ ./users/secret.nix ];
users = {
mutableUsers = false;
defaultUserShell = pkgs.zsh;
users = {
charlotte = {
isNormalUser = true;
home = "/home/charlotte";
description = "Charlotte Van Petegem";
extraGroups = [
"input"
"systemd-journal"
"video"
"wheel"
];
};
};
};
users.users.charlotte.extraGroups = [ "input" "video" ];
}

Binary file not shown.

View file

@ -1,51 +0,0 @@
{ ... }:
{
chvp.zfs.homeLinks = [
{ path = ".local/share/autojump"; type = "cache"; }
{ path = ".local/share/zsh"; type = "cache"; }
];
home-manager.users.charlotte = { pkgs, ... }: {
home.packages = [ pkgs.autojump ];
programs.zsh = {
enable = true;
enableAutosuggestions = true;
autocd = true;
dotDir = ".config/zsh";
history = {
expireDuplicatesFirst = true;
path = "\$HOME/.local/share/zsh/history";
};
initExtra = ''
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
'';
oh-my-zsh = {
enable = true;
plugins = [
"autojump"
"common-aliases"
"extract"
"history-substring-search"
"git"
"sudo"
"systemd"
"tmux"
];
theme = "agnoster";
};
plugins = [
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.7.1";
sha256 = "03r6hpb5fy4yaakqm3lbf4xcvd408r44jgpv4lnzl9asp4sb9qc0";
};
}
];
sessionVariables = { DEFAULT_USER = "charlotte"; };
};
};
}