Rename fake modules to modules-old

This commit is contained in:
Tibo De Peuter 2023-10-17 12:15:41 +02:00
parent 82a2d7bbea
commit 97db5d05d3
28 changed files with 13 additions and 13 deletions

View file

@ -0,0 +1,31 @@
{
imports = [
./git
./mpv
./sops
./ssh
./tea
./vifm
./vim
./zellij
];
home-manager.users.tdpeuter = { pkgs, ... }: {
home.packages = with pkgs; [
direnv
duf
lynx
nsxiv
w3m
wget
zenith-nvidia
];
programs = {
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
};
}

View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
{
home-manager.users.tdpeuter = {
programs.git = {
enable = true;
userName = "Tibo De Peuter";
userEmail = "tibo.depeuter@gmail.com";
extraConfig = {
core.editor = "vim";
};
ignores = [
"*.swp"
];
includes = [
{
condition = "gitdir:~/university/"; # Trailing backslash is necessary!
contentSuffix = ".gitconfig";
contents = {
user.email = "tibo.depeuter@ugent.be";
};
}
];
};
};
}

View file

@ -0,0 +1,11 @@
{ config, system, lib, pkgs-unstable, ... }:
{
home-manager.users.tdpeuter.home = {
packages = with pkgs-unstable; [
mpv
];
file.".config/mpv".source = ../../../../stow/mpv/.config/mpv;
};
}

View file

@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
sops
];
sops = {
# Add secrets.yml to the nix store
defaultSopsFile = ../../../secrets/secrets.yaml;
age = {
# Automatically import SSH keys as age keys
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
# Use an age key that is expected to already be in the filesystem
keyFile = "/var/lib/sops-nix/key.txt";
# Generate new keys if the key specified above does not exist
# generateKey = true;
};
secrets =
let
user = config.users.users.tdpeuter.name;
Hugo = {
format = "yaml";
sopsFile = ../../../secrets/Hugo.yaml;
owner = user;
};
UGent = {
format = "yaml";
sopsFile = ../../../secrets/UGent.yaml;
owner = user;
};
in {
"Hugo/ssh" = Hugo;
"UGent/HPC/ssh" = UGent;
"GitHub/ssh" = {
format = "yaml";
sopsFile = ../../../secrets/GitHub.yaml;
owner = user;
};
"Hugo/Gitea/ssh" = Hugo;
"UGent/GitHub/ssh" = UGent;
"UGent/SubGit/ssh" = UGent;
};
};
}

View file

@ -0,0 +1,41 @@
# Adding SSH keys
To incorporate SSH keys, for instance, to enable authentication with a Git server, follow these steps:
Step 0: If necessary, generate a keypair, for example using the command:
```bash
ssh-keygen -t ed25519
```
Please note that setting a password for the keypair is not yet tested.
Step 1: Create a new file named `yourservice.yaml` within the [secrets](../../../secrets/) directory by executing the following command:
```bash
sops secrets/yourservice.yaml
```
Within this file, create a value that contains your private key. For example:
```yaml
yourservice:
ssh: |
-----BEGIN OPENSSH PRIVATE KEY-----
<...>
-----END OPENSSH PRIVATE KEY-----
```
Step 2: Reference this value in [your sops configuration](../../utils/sops/default.nix) as follows:
```
sops.secrets."yourservice/ssh".format = "yaml";
sops.secrets."yourservice/sss".sopsFile = secrets/youservice.yaml;
```
Step 3: Finally, add the SSH key to your SSH configuration so that it is used correctly when connecting to your host. Add the following lines to your SSH configuraton file:
```
Host yourservice
IdentityFile /run/secrets/yourservice/ssh
```

View file

@ -0,0 +1,54 @@
{ config, lib, pkgs, ... }:
{
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
home-manager.users.tdpeuter = {
programs.ssh = {
enable = true;
matchBlocks = {
"Hugo" = {
hostname = "192.168.0.11";
identitiesOnly = true;
identityFile = "/run/secrets/Hugo/ssh";
user = "admin";
};
"HPC" = {
hostname = "login.hpc.ugent.be";
identitiesOnly = true;
identityFile = "/run/secrets/UGent/HPC/ssh";
user = "vsc44995";
};
# Git authentication
"git.depeuter.dev" = {
hostname = "git.depeuter.dev";
identitiesOnly = true;
identityFile = "/run/secrets/Hugo/Gitea/ssh";
user = "git";
};
"github.com" = {
hostname = "github.com";
identitiesOnly = true;
identityFile = "/run/secrets/GitHub/ssh";
user = "git";
};
"github.ugent.be" = {
hostname = "github.ugent.be";
identitiesOnly = true;
identityFile = "/run/secrets/UGent/GitHub/ssh";
user = "git";
};
"subgit.ugent.be" = {
hostname = "subgit.ugent.be";
identitiesOnly = true;
identityFile = "/run/secrets/UGent/SubGit/ssh";
user = "git";
};
};
};
};
}

View file

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
home-manager.users.tdpeuter.home = {
packages = with pkgs; [
tea
];
};
}

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
home-manager.users.tdpeuter.home = {
packages = with pkgs; [
vifm
chafa # Terminal image previewer
glow # Terminal Markdown renderer
font-awesome_5
];
# Put files separately so history still works
file = {
".config/vifm/colors".source = ../../../../stow/vifm/.config/vifm/colors;
".config/vifm/scripts".source = ../../../../stow/vifm/.config/vifm/scripts;
".config/vifm/vifmrc".source = ../../../../stow/vifm/.config/vifm/vifmrc;
};
};
}

View file

@ -0,0 +1,81 @@
{ inputs, lib, config, pkgs, ... }:
{
home-manager.users.tdpeuter = { pkgs, ... }: {
home.file = {
".vim".source = ../../../../stow/vim/.vim;
};
programs.vim = {
enable = true;
extraConfig = ''
colorscheme tdpeuter-light
" Tags
" pacman -S ctags
command! MakeTags !ctags -R . &
" Move to defintion using ^]
" Move to ambigious using g^]
" Move back using ^t
filetype on
filetype indent on
filetype plugin on
" File browsing
let g:netrw_browse_split=4 " open in the previous window
let g:netrw_altv=1 " split new windows to the right
let g:netrw_liststyle=3 " treeview
set autoindent
set conceallevel=2
set incsearch
set linebreak
set nocompatible
set path+=**
set scrolloff=3
set showcmd
set showmatch
set smartindent
set smarttab
set title
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
set wildmenu
syntax enable
if $TERM == 'alacritty'
set ttymouse=sgr " Alacritty specific
endif
if $TERM == 'xterm-kitty'
" Fix <HOME> and <END> not working
set term=xterm-256color
endif
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" https://stackoverflow.com/a/37558470/19044747
augroup remember_folds
autocmd!
autocmd BufWinLeave * silent! mkview
autocmd BufWinEnter * silent! loadview
augroup END
endif
'';
plugins = with pkgs.vimPlugins; [
ale
catppuccin-vim
statix
vifm-vim
];
settings = {
expandtab = true;
mouse = "a";
number = true;
relativenumber = true;
shiftwidth = 4;
tabstop = 4;
};
};
};
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
{
home-manager.users.tdpeuter.home = {
packages = with pkgs; [
zellij
];
file.".config/zellij".source = ../../../../stow/zellij/.config/zellij;
};
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
];
}