2024-07-03 23:58:26 +02:00
|
|
|
{ stylix }:
|
|
|
|
{
|
2024-04-05 11:55:35 +02:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2024-07-03 23:58:26 +02:00
|
|
|
}:
|
|
|
|
let
|
2024-01-14 17:33:16 +01:00
|
|
|
cfg = config.jconfig;
|
2024-07-03 23:58:26 +02:00
|
|
|
keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: {
|
|
|
|
name = "pubkeys/${username}";
|
|
|
|
value = {
|
|
|
|
mode = "0755";
|
|
|
|
source = builtins.fetchurl {
|
|
|
|
inherit sha256;
|
|
|
|
url = "https://github.com/${username}.keys";
|
2024-01-31 18:06:40 +01:00
|
|
|
};
|
2024-07-03 23:58:26 +02:00
|
|
|
};
|
|
|
|
}) cfg.importSSHKeysFromGithub;
|
|
|
|
in
|
|
|
|
{
|
2024-01-15 12:42:01 +01:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
./gui
|
|
|
|
stylix.nixosModules.stylix
|
2024-07-03 23:58:26 +02:00
|
|
|
{ stylix = import ./stylix-config.nix { inherit config pkgs; }; }
|
2024-01-15 12:42:01 +01:00
|
|
|
];
|
2024-01-14 17:33:16 +01:00
|
|
|
|
2024-01-15 12:42:01 +01:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-01-14 17:33:16 +01:00
|
|
|
boot.plymouth.enable = cfg.styling.enable;
|
|
|
|
|
|
|
|
# Enable unlocking the gpg-agent at boot (configured through home.nix)
|
|
|
|
security.pam.services.login.gnupg.enable = true;
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
|
|
|
# CLI tools
|
|
|
|
pkgs.fd
|
|
|
|
pkgs.bat
|
|
|
|
pkgs.skim
|
|
|
|
pkgs.ripgrep
|
|
|
|
pkgs.du-dust
|
|
|
|
pkgs.curl
|
|
|
|
pkgs.wget
|
|
|
|
pkgs.eza
|
2024-01-25 20:06:11 +01:00
|
|
|
pkgs.zip
|
|
|
|
pkgs.unzip
|
2024-01-14 17:33:16 +01:00
|
|
|
];
|
|
|
|
|
2024-03-02 18:56:30 +01:00
|
|
|
# Enable dev documentation
|
|
|
|
documentation.dev.enable = cfg.dev.enable;
|
2024-05-17 18:50:01 +02:00
|
|
|
programs = {
|
|
|
|
# Shell prompt
|
|
|
|
starship = {
|
|
|
|
enable = true;
|
|
|
|
settings = lib.mkIf cfg.styling.enable {
|
|
|
|
format = "$time$all";
|
|
|
|
add_newline = false;
|
|
|
|
cmd_duration.min_time = 500;
|
|
|
|
cmd_duration.show_milliseconds = true;
|
|
|
|
time = {
|
|
|
|
format = "[$time](bold yellow) ";
|
|
|
|
disabled = false;
|
|
|
|
};
|
|
|
|
status = {
|
|
|
|
format = "[$signal_name$common_meaning$maybe_int](red)";
|
|
|
|
symbol = "[✗](bold red)";
|
|
|
|
disabled = false;
|
|
|
|
};
|
|
|
|
sudo.disabled = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# Default shell
|
|
|
|
zsh.enable = true;
|
2024-01-14 17:33:16 +01:00
|
|
|
};
|
2024-01-15 22:19:06 +01:00
|
|
|
|
2024-01-31 18:06:40 +01:00
|
|
|
environment.etc = keysFromGithub;
|
2024-10-05 22:37:58 +02:00
|
|
|
services = {
|
|
|
|
# Enable printer autodiscovery if printing is enabled
|
|
|
|
avahi = {
|
|
|
|
inherit (config.services.printing) enable;
|
|
|
|
nssmdns4 = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
openssh.authorizedKeysFiles = builtins.map (path: "/etc/${path}") (
|
|
|
|
builtins.attrNames keysFromGithub
|
|
|
|
);
|
2024-10-15 22:12:39 +02:00
|
|
|
jupyter = {
|
|
|
|
inherit (cfg.dev) enable;
|
|
|
|
group = "users";
|
|
|
|
};
|
2024-04-14 20:44:37 +02:00
|
|
|
};
|
2024-01-14 17:33:16 +01:00
|
|
|
users.defaultUserShell = pkgs.zsh;
|
|
|
|
# Open ports for spotifyd
|
2024-05-17 18:50:01 +02:00
|
|
|
networking.firewall = {
|
2024-07-03 23:58:26 +02:00
|
|
|
allowedUDPPorts = [ 5353 ];
|
|
|
|
allowedTCPPorts = [ 2020 ];
|
2024-05-17 18:50:01 +02:00
|
|
|
};
|
2024-01-14 17:33:16 +01:00
|
|
|
# Nix Settings
|
2024-05-17 18:50:01 +02:00
|
|
|
nix = {
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
# run between 0 and 45min after boot if run was missed
|
|
|
|
randomizedDelaySec = "45min";
|
|
|
|
};
|
|
|
|
settings = {
|
2024-09-20 09:24:25 +02:00
|
|
|
use-xdg-base-directories = true;
|
2024-05-17 18:50:01 +02:00
|
|
|
auto-optimise-store = true;
|
|
|
|
experimental-features = [
|
|
|
|
"nix-command"
|
|
|
|
"flakes"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-01-14 17:33:16 +01:00
|
|
|
};
|
|
|
|
}
|