This commit is contained in:
Lucy Hochkamp 2025-03-23 16:02:52 +01:00
parent 62df62c3aa
commit db11846811
No known key found for this signature in database
27 changed files with 887 additions and 64 deletions

51
hm-modules/alacritty.nix Normal file
View file

@ -0,0 +1,51 @@
{
pkgs,
config,
lib,
inputs,
...
}:
let
cfg = config.xyno.alacritty;
in
{
options.xyno.alacritty.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable {
programs.alacritty = {
enable = true;
settings = {
font.normal.family = "JetBrainsMono NerdFont";
colors = {
primary = {
# hard contrast
background = "#1d2021";
# normal background = "#282828";
# soft contrast background = = "#32302f"
foreground = "#ebdbb2";
};
normal = {
black = "#282828";
red = "#cc241d";
green = "#98971a";
yellow = "#d79921";
blue = "#458588";
magenta = "#b16286";
cyan = "#689d6a";
white = "#a89984";
};
bright = {
black = "#928374";
red = "#fb4934";
green = "#b8bb26";
yellow = "#fabd2f";
blue = "#83a598";
magenta = "#d3869b";
cyan = "#8ec07c";
white = "#ebdbb2";
};
};
};
};
};
}

48
hm-modules/borgmatic.nix Normal file
View file

@ -0,0 +1,48 @@
{
pkgs,
config,
lib,
osConfig,
...
}:
let
cfg = config.xyno.borgmatic;
in
{
options.xyno.borgmatic.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable {
programs.borgmatic = {
enable = true;
backups.system =
let
notify = "${pkgs.libnotify}/bin/notify-send";
in
{
location.sourceDirectories = [ "/home" "/var" ];
location.repositories = [ { path = "ssh://ragon@ds9//backups/${osConfig.networking.hostName}"; } ];
location.extraConfig.exclude_if_present = [ ".nobackup" ];
storage.encryptionPasscommand = "${pkgs.libsecret}/bin/secret-tool lookup borg-repository system";
location.extraConfig.before_backup = [
"${notify} -u low -a borgmatic borgmatic \"starting backup\" -t 10000"
];
location.extraConfig.after_backup = [
"${notify} -u low -a borgmatic borgmatic \"finished backup\" -t 10000"
];
location.extraConfig.on_error = [
"${notify} -u critical -a borgmatic borgmatic \"backup failed<br>maybe unlock keepass\""
];
location.extraConfig.ssh_command = "ssh -o IdentityAgent=/run/user/1000/ssh-agent";
location.extraConfig.one_file_system = true;
retention = {
keepHourly = 24;
keepDaily = 7;
keepWeekly = 4;
keepMonthly = 12;
keepYearly = 2;
};
};
};
services.borgmatic.enable = true;
};
}

28
hm-modules/dark-theme.nix Normal file
View file

@ -0,0 +1,28 @@
{
pkgs,
config,
lib,
inputs,
...
}:
let
cfg = config.xyno.dark-theme;
in
{
options.xyno.dark-theme.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable {
dconf = {
settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
};
gtk = {
enable = true;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
};
};
}

35
hm-modules/git.nix Normal file
View file

@ -0,0 +1,35 @@
{
pkgs,
config,
lib,
inputs,
...
}:
let
cfg = config.xyno.git;
in
{
options.xyno.git.enable = lib.mkEnableOption "xynos git config";
config = lib.mkIf cfg.enable {
git = {
enable = true;
lfs.enable = true;
# Default configs
extraConfig = {
commit.gpgSign = true;
gpg.format = "ssh";
user.name = "Lucy Hochkamp";
user.email = "git@xyno.systems";
user.signingKey = # TODO: don't hardcode a computer
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID/oMAi5jyQsNohfhcSH2ItisTpBGB0WtYTVxJYKKqhj"; # theseus
# Set default "git pull" behaviour so it doesn't try to default to
# either "git fetch; git merge" (default) or "git fetch; git rebase".
pull.ff = "only";
};
};
};
}

View file

@ -3,7 +3,7 @@ let
cfg = config.xyno.helix;
in
{
options.ragon.xyno.enable = lib.mkOption { default = false; };
options.xyno.helix.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
jsonnet-language-server

View file

@ -1,3 +1,7 @@
[
./alacritty.nix
./borgmatic.nix
# ./git.nix
./helix.nix
./dark-theme.nix
]