Add heaven (my server)

This commit is contained in:
Hadi
2024-06-07 21:21:03 +02:00
parent d917ac9f6a
commit 17f93ea60b
25 changed files with 238 additions and 17 deletions

1
home/apps/server.nix Normal file
View File

@@ -0,0 +1 @@
{ imports = [ ./lf ./neofetch ./nvim ]; }

View File

@@ -2,7 +2,12 @@
let variable = import ../variables.nix;
in {
imports = [ ./themes ./system ./scripts ./apps ];
imports = [
./themes/laptop.nix
./system/laptop.nix
./scripts/laptop.nix
./apps/laptop.nix
];
home = {
username = variable.username;

View File

@@ -7,10 +7,6 @@ let
sudo nixos-rebuild switch --flake ${homedir}/.config/nixos#nixy
'';
nixy-edit = pkgs.writeShellScriptBin "nixy-edit" ''
$EDITOR ${homedir}/.config/nixos/
'';
nixy-upgrade = pkgs.writeShellScriptBin "nixy-upgrade" ''
sudo nixos-rebuild switch --upgrade --flake ${homedir}/.config/nixos#nixy
'';
@@ -27,13 +23,37 @@ let
sudo /run/current-system/bin/switch-to-configuration boot
'';
heaven-rebuild = pkgs.writeShellScriptBin "heaven-rebuild" ''
sudo nixos-rebuild switch --flake ${homedir}/.config/nixos#heaven
'';
heaven-upgrade = pkgs.writeShellScriptBin "heaven-upgrade" ''
sudo nixos-rebuild switch --upgrade --flake ${homedir}/.config/nixos#heaven
'';
heaven-update = pkgs.writeShellScriptBin "heaven-update" ''
cd ${homedir}/.config/nixos && sudo nix flake update
'';
heaven-gc = pkgs.writeShellScriptBin "heaven-gc" ''
cd ${homedir}/.config/nixos && sudo nix-collect-garbage -d
'';
heaven-cb = pkgs.writeShellScriptBin "heaven-cb" ''
sudo /run/current-system/bin/switch-to-configuration boot
'';
in {
home.packages = with pkgs; [
nixy-rebuild
nixy-edit
nixy-upgrade
nixy-update
nixy-gc
nixy-cb
heaven-rebuild
heaven-upgrade
heaven-update
heaven-gc
heaven-cb
];
}

1
home/scripts/server.nix Normal file
View File

@@ -0,0 +1 @@
{ imports = [ ./nixy ./nerdfetch ./compress ]; }

41
home/server.nix Normal file
View File

@@ -0,0 +1,41 @@
{ pkgs, ... }:
let variable = import ../variables.nix;
in {
imports = [
./themes/server.nix
./system/server.nix
./scripts/server.nix
./apps/server.nix
];
home = {
username = variable.username;
homeDirectory = variable.homeDirectory;
packages = with pkgs; [
btop
# Dev
go
cargo
nodejs
python3
jq
# Utils
sops # Secrets
age # Secrets
fd
bc
gcc
zip
unzip
wget
curl
];
stateVersion = variable.server.stateVersion;
};
programs.home-manager.enable = true;
}

View File

@@ -1,4 +0,0 @@
{
imports =
[ ./git ./dunst ./hyprland ./shell ./sops ./waybar ./wlogout ./sops ];
}

4
home/system/laptop.nix Normal file
View File

@@ -0,0 +1,4 @@
{
imports =
[ ./git ./dunst ./hyprland ./shell ./sops/laptop.nix ./waybar ./wlogout ];
}

1
home/system/server.nix Normal file
View File

@@ -0,0 +1 @@
{ imports = [ ./git ./shell ./sops/server.nix ]; }

View File

@@ -10,6 +10,7 @@
gk = { path = "/home/hadi/.ssh/github"; };
glk = { path = "/home/hadi/.ssh/gitlab"; };
silicon = { path = "/home/hadi/.ssh/silicon"; };
heaven = { path = "/home/hadi/.ssh/heaven"; };
};
};

View File

@@ -0,0 +1,14 @@
{ sops-nix, ... }: {
imports = [ sops-nix.homeManagerModules.sops ];
sops = {
age.keyFile = "/home/hadi/.config/sops/age/keys.txt";
defaultSopsFile = ../../../secrets/secrets.yaml;
secrets = {
gts = { path = "/home/hadi/.ssh/gts"; };
sshconfigheaven = { path = "/home/hadi/.ssh/config"; };
};
};
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
}

1
home/themes/server.nix Normal file
View File

@@ -0,0 +1 @@
{ ... }: { imports = [ ./wip.nix ./config/load_colors.nix ]; }