tidy and seperate some base home-manager profiles and presets

This commit is contained in:
chaos 2024-05-11 16:29:43 +01:00
parent 79b4c2f1ff
commit 09bc397a1d
No known key found for this signature in database
12 changed files with 67 additions and 46 deletions

15
home/apps/age.nix Normal file
View file

@ -0,0 +1,15 @@
{
self,
pkgs,
...
}: let
encryptedUSBData = import "${self}/data/drives/encryptedUSB.nix";
in {
home.packages = with pkgs; [age];
programs.zsh.shellAliases = {
chaos_age = "age -i ${encryptedUSBData.chaosAgePrivateKeyPath}";
chaos_age_encrypt = "age -a -e -i ${encryptedUSBData.chaosAgePrivateKeyPath}";
chaos_pub = "cat ${encryptedUSBData.chaosAgePublicKeyPath}";
};
}

View file

@ -0,0 +1,5 @@
{tree, ...}: {
imports = with tree; [
home.apps.age
];
}

21
home/base/ssh-aliases.nix Normal file
View file

@ -0,0 +1,21 @@
{lib, ...}: let
inherit (lib.modules) mkMerge;
in {
programs.ssh = {
enable = true;
matchBlocks = mkMerge [
(mkMerge (map (hostname: {
"${hostname}" = {
user = "root";
hostname = "${hostname}.servers.genderfucked.monster";
};
}) ["hetzner-arm" "hetzner-arm-decrypt" "vault" "vault-decrypt" "raspberry"]))
{
"blahaj" = {
user = "chaos";
hostname = "blahaj.sapphicco.de";
};
}
];
};
}

View file

@ -1,21 +1,3 @@
{lib, ...}: let
inherit (lib.modules) mkMerge;
in {
programs.ssh = {
enable = true;
matchBlocks = mkMerge [
(mkMerge (map (hostname: {
"${hostname}" = {
user = "root";
hostname = "${hostname}.servers.genderfucked.monster";
};
}) ["hetzner-arm" "hetzner-arm-decrypt" "vault" "vault-decrypt" "raspberry"]))
{
"blahaj" = {
user = "chaos";
hostname = "blahaj.sapphicco.de";
};
}
];
};
{...}: {
programs.ssh.enable = true;
}

11
home/base/vault.nix Normal file
View file

@ -0,0 +1,11 @@
{pkgs, ...}: {
home.packages = with pkgs; [vault-bin];
programs.zsh.envExtra = ''
export VAULT_ADDR="https://vault.owo.monster"
'';
home.sessionVariables = {
VAULT_ADDR = "https://vault.owo.monster";
};
}

View file

@ -1,11 +1,5 @@
{
self,
pkgs,
...
}: let
encryptedUSBData = import "${self}/data/drives/encryptedUSB.nix";
in {
home.packages = with pkgs; [eza bat ripgrep vault-bin libarchive age];
{pkgs, ...}: {
home.packages = with pkgs; [bat ripgrep];
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
@ -16,27 +10,17 @@ in {
plugins = [];
};
shellAliases = {
nixdirfmt = "alejandra . && statix fix . && deadnix -e .";
tar = "bsdtar";
exa = "eza";
eza = "eza --time-style long-iso";
la = "eza -Ga";
ll = "eza -l";
lla = "eza -lga";
ip6 = "ip -6";
sys = "systemctl";
sysu = "systemctl --user";
logu = "journalctl --user";
log = "journalctl";
logu = "journalctl --user";
dmesg = "dmesg -HP";
hg = "history 0 | rg";
chaos_age = "age -i ${encryptedUSBData.chaosAgePrivateKeyPath}";
chaos_age_encrypt = "age -a -e -i ${encryptedUSBData.chaosAgePrivateKeyPath}";
chaos_pub = "cat ${encryptedUSBData.chaosAgePublicKeyPath}";
};
envExtra = ''
export VAULT_ADDR="https://vault.owo.monster"
'';
};
programs.direnv = {
enable = true;

View file

@ -4,4 +4,6 @@
zip
p7zip
];
programs.zsh.shellAliases.tar = "bsdtar";
}

View file

@ -13,4 +13,6 @@
programs.vscode-mod.userSettings = {
"alejandra.program" = "alejandra";
};
programs.zsh.shellAliases.nixdirfmt = "alejandra . && statix fix . && deadnix -e .";
}

View file

@ -60,7 +60,7 @@ in {
musicSync
#soulseek # takes up too much ram :(
]);
home-manager.users.root.imports = with tree; [ home.apps.musicutil ];
home-manager.users.root.imports = with tree; [home.apps.musicutil];
networking.firewall.allowedTCPPorts = with ports; [
mpd

View file

@ -20,7 +20,7 @@
];
home-manager.users.root = {
imports = with tree; [home.base home.dev.small];
imports = with tree; [home.base.zsh home.base.age-encyption home.dev.small];
};
networking.firewall = {

View file

@ -10,7 +10,7 @@
];
home-manager.users.root = {
imports = with tree; [home.base home.dev.small];
imports = with tree; [home.base.zsh home.base.age-encyption home.dev.small];
};
networking.firewall = {

View file

@ -20,7 +20,6 @@
netmask = "255.255.255.255";
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
];