Skip to content

Commit

Permalink
refactor: migrate to stylix (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael authored May 20, 2024
1 parent a55a741 commit e2b5149
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 44 deletions.
216 changes: 215 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
stylix = {
url = "github:danth/stylix/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
nil = {
url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs-unstable";
Expand Down Expand Up @@ -86,8 +91,12 @@
// {packages = flakeInputs.nostale-dev-env.packages.${system};};
age-plugin-op =
flakeInputs.age-plugin-op.packages.${system}
// {default = flakeInputs.age-plugin-op.packages.${system}.age-plugin-op;};
stylix =
flakeInputs.stylix
// {
default = flakeInputs.age-plugin-op.packages.${system}.age-plugin-op;
packages = flakeInputs.stylix.packages.${system};
nixosModules = flakeInputs.stylix.nixosModules // {default = flakeInputs.stylix.nixosModules.stylix;};
};
};

Expand All @@ -104,5 +113,7 @@
mappedHosts = builtins.mapAttrs (n: v: mkHost {name = n;}) hosts;
in
mappedHosts;

inherit pkgs lib inputs;
};
}
15 changes: 13 additions & 2 deletions hosts/pc/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
config,
lib,
inputs,
username,
dotfiles,
...
}:
with lib.my; {
with lib.my; let
colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;
in {
imports = [./hardware.nix ./networking.nix];

environment = {
Expand All @@ -14,7 +17,15 @@ with lib.my; {
};
};

home-manager.users.${username}.colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;
home-manager.users.${username} = {
inherit colorScheme;
stylix.base16Scheme = colorScheme;
stylix.autoEnable = false;
};

stylix.image = ""; # Workaround for Stylix requirement for this to be set.
stylix.base16Scheme = colorScheme;
stylix.autoEnable = false;

# Configure Secret Managment through sops-nix.
sops.age.keyFile = "/home/${username}/.config/sops/age/keys.txt";
Expand Down
1 change: 1 addition & 0 deletions lib/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ with lib.my; {

inputs.home-manager.nixosModules.default
inputs.sops-nix.nixosModules.default
inputs.stylix.nixosModules.default
]
++ (utils.recursiveReadDir ./../modules {
ignoredDirs = ["apps"];
Expand Down
50 changes: 10 additions & 40 deletions modules/desktop/apps/alacritty.nix
Original file line number Diff line number Diff line change
@@ -1,49 +1,19 @@
{
lib,
pkgs,
username,
colorScheme,
...
}:
with lib; {
home-manager.users.${username}.programs.alacritty = {
enable = true;
settings = {
general = {
shell = "${pkgs.fish}/bin/fish";
"live_config_reload" = false;
};
env.TERM = "xterm-256color";
}: {
home-manager.users.${username} = {
stylix.targets.alacritty.enable = true;

colors = with colorScheme.palette; {
bright = {
black = "0x${base00}";
blue = "0x${base0D}";
cyan = "0x${base0C}";
green = "0x${base0B}";
magenta = "0x${base0E}";
red = "0x${base08}";
white = "0x${base06}";
yellow = "0x${base09}";
};
cursor = {
cursor = "0x${base06}";
text = "0x${base06}";
};
normal = {
black = "0x${base00}";
blue = "0x${base0D}";
cyan = "0x${base0C}";
green = "0x${base0B}";
magenta = "0x${base0E}";
red = "0x${base08}";
white = "0x${base06}";
yellow = "0x${base0A}";
};
primary = {
background = "0x${base00}";
foreground = "0x${base06}";
programs.alacritty = {
enable = true;
settings = {
general = {
shell = "${pkgs.fish}/bin/fish";
"live_config_reload" = false;
};
env.TERM = "xterm-256color";
};
};
};
Expand Down
Loading

0 comments on commit e2b5149

Please sign in to comment.