nixos/flake.nix
Evie Litherland-Smith 07be39befd Lots of starship config updates
Remove language and OS custom icons, also some misc things like sudo,
version, read-only dir, etc... to use defaults instead. Keep custom
for git information and container indicator

Add jobs with custom icon because the default has weird spacing

Update zsh transient function so that transient prompt matches
starship prompt

Switch Emoji font back to Noto, some of starship config didn't display
properly with EmojiOne
2024-04-02 17:32:56 +01:00

243 lines
7.5 KiB
Nix

{
description = "Evie's machine configurations";
nixConfig = {
extra-substituters = ["https://nix.xenia.me.uk"];
extra-trusted-public-keys = ["nix.xenia.me.uk:VaQu+8hshk7aSbW3z91pgkKbYeAcO3Q0AomqP8RaaLc="];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
iosevka-custom.url = "git+https://git.xenia.me.uk/pixelifytica/iosevka.git";
base16.url = "github:SenchoPens/base16.nix";
tt-schemes = {
url = "github:tinted-theming/schemes";
flake = false;
};
};
outputs = {
nixpkgs,
home-manager,
iosevka-custom,
base16,
tt-schemes,
...
}: let
systemConfig = {
hostName ? "Atlas",
user ? "pixelifytica",
system ? "x86_64-linux",
stateVersion ? "23.05",
systemModules ? [],
homeModules ? [],
}: let
defaultUserShell = "zsh";
specialArgs = {
inherit hostName user;
accentColour = "base07"; # catppuccin lavender
catppuccinVariant = "Mocha";
fonts = with import nixpkgs {inherit system;};
with iosevka-custom.outputs; rec {
sizes = {
applications = 16;
desktop = 20;
popups = 20;
terminal = 16;
};
serif = sansSerif;
sansSerif = {
name = names."iosevka-custom-aile";
package = packages.${system}."iosevka-custom-aile";
};
monospace = {
name = names."iosevka-custom-nerdfont";
package = packages.${system}."iosevka-custom-nerdfont";
};
emoji = {
name = "Noto Color Emoji";
package = noto-fonts-emoji;
};
};
};
in
nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules =
[
home-manager.nixosModules.home-manager
base16.nixosModule
./hosts/${hostName}/configuration.nix
./hosts/${hostName}/hardware-configuration.nix
./system/default.nix
({
config,
lib,
pkgs,
catppuccinVariant ? "Mocha",
...
}: {
scheme = "${tt-schemes}/base16/catppuccin-${lib.strings.toLower catppuccinVariant}.yaml";
nix = {
enable = true;
package = pkgs.nixVersions.nix_2_19;
settings = {
cores = 0;
max-jobs = "auto";
trusted-users = ["root" user];
experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true;
};
channel.enable = true;
nixPath = ["nixpkgs=${pkgs.path}"];
registry.nixpkgs.flake = nixpkgs;
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
optimise.automatic = true;
extraOptions = ''
keep-outputs = false
keep-derivations = false
min-free = ${toString (100 * 1024 * 1024)}
max-free = ${toString (1024 * 1024 * 1024)}
'';
};
nixpkgs.config.allowUnfree = true;
networking = {inherit hostName;};
programs.${defaultUserShell}.enable = true;
system = {inherit stateVersion;};
users = {
defaultUserShell = pkgs.${defaultUserShell};
users = let
authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINI1dWlS16Keil0MGPWmMsBzx8F9ylfz+fRwxUr8/tZ/ ion"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDOcgeR3hh23aTiXnyC37xdP8oXfTZbbjgWzkUyxhT9P root@Vanguard"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIANfkqd5lPTsSPU3SRYnAa1UjCYDmDeBTyzq5McmWlm6 xenia@Vanguard"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ/ZSSCN5sqrA+tdoIZr5EUm5DRuBV4dQ7J+QBEtUwUU xenia@Northstar"
];
in {
root.openssh = {inherit authorizedKeys;};
${user} = {
group = "users";
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel" "video" "input" "uinput"];
initialHashedPassword = "$y$j9T$tHIPQt09Kf3KH2eIRze3g/$2mwSlcq27DTGvHNPJ5EP9/1CfL3bXP0F6oS/Vuffmn3";
openssh = {inherit authorizedKeys;};
};
};
};
home-manager = {
extraSpecialArgs = {inherit (config) scheme;} // specialArgs;
useGlobalPkgs = true;
useUserPackages = true;
users = {
root = {
imports = [./home/default.nix];
home = {
inherit stateVersion;
username = "root";
homeDirectory = "/root";
};
programs.home-manager.enable = true;
};
${user} = let
username = user;
homeDirectory = "/home/${user}";
in {
imports =
[./hosts/${hostName}/home.nix ./home/default.nix]
++ homeModules;
home = {inherit username homeDirectory stateVersion;};
programs.home-manager.enable = true;
xdg.userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
XDG_PROJECTS_DIR = "${homeDirectory}/Projects";
};
};
};
};
};
})
]
++ systemModules;
};
in {
nixosConfigurations = {
## Server
Legion = systemConfig {
hostName = "Legion";
systemModules = [
./services/nix-serve.nix
./services/caddy.nix
./services/forgejo.nix
./services/grafana.nix
./services/minecraft.nix
./services/sshd.nix
./services/syncthing.nix
];
homeModules = [./home/default.nix];
};
## Personal
Northstar = systemConfig {
hostName = "Northstar";
systemModules = [
./system/laptop.nix
./system/hyprland.nix
];
homeModules = [
./home/hyprland/default.nix
];
};
Vanguard = systemConfig {
hostName = "Vanguard";
systemModules = [
./system/hyprland.nix
./system/games.nix
];
homeModules = [
./home/hyprland/default.nix
];
};
## Work
Ronin = systemConfig {
hostName = "Ronin";
user = "elitherl";
systemModules = [
./system/laptop.nix
./system/hyprland.nix
];
homeModules = [
./home/hyprland/default.nix
./home/email/work.nix
];
};
Scorch = systemConfig {
hostName = "Scorch";
user = "elitherl";
systemModules = [
./system/hyprland.nix
];
homeModules = [
./home/hyprland/default.nix
./home/email/work.nix
];
};
};
};
}