feat(modules): add new GTK styles to Catppuccin config

fix(modules): update vaultwarden service hostname usage

feat(flake): add sops-nix to flake

feat: add .sops.yaml base, not quite ready just yet
This commit is contained in:
Jo 2024-09-22 03:11:14 +02:00
parent b23bddaf71
commit 3cd04be672
18 changed files with 293 additions and 95 deletions

7
.sops.yaml Normal file
View file

@ -0,0 +1,7 @@
keys:
- &jo D94C5D66B93C7C7B855F8FF08FBFDF2DB9BBAAF9
creation_rules:
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
key_groups:
- pgp:
- *jo

View file

@ -2,11 +2,11 @@
"nodes": {
"catppuccin": {
"locked": {
"lastModified": 1724469296,
"narHash": "sha256-p3R4LUNk6gC+fTKRUm9ByXaoRIocnQMwVuJSIxECQ8o=",
"lastModified": 1725509983,
"narHash": "sha256-NHCgHVqumPraFJnLrkanoLDuhOoUHUvRhvp/RIHJR+A=",
"owner": "catppuccin",
"repo": "nix",
"rev": "874e668ddaf3687e8d38ccd0188a641ffefe1cfb",
"rev": "45745fe5960acaefef2b60f3455bcac6a0ca6bc9",
"type": "github"
},
"original": {
@ -70,11 +70,11 @@
},
"hardware": {
"locked": {
"lastModified": 1724878143,
"narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=",
"lastModified": 1725885300,
"narHash": "sha256-5RLEnou1/GJQl+Wd+Bxaj7QY7FFQ9wjnFq1VNEaxTmc=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef",
"rev": "166dee4f88a7e3ba1b7a243edb1aca822f00680e",
"type": "github"
},
"original": {
@ -91,11 +91,11 @@
]
},
"locked": {
"lastModified": 1725180166,
"narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=",
"lastModified": 1726036828,
"narHash": "sha256-ZQHbpyti0jcAKnwQY1lwmooecLmSG6wX1JakQ/eZNeM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb",
"rev": "8a1671642826633586d12ac3158e463c7a50a112",
"type": "github"
},
"original": {
@ -122,11 +122,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1725103162,
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
"lastModified": 1725983898,
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
"type": "github"
},
"original": {
@ -136,6 +136,22 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1725762081,
"narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"catppuccin": "catppuccin",
@ -143,7 +159,8 @@
"home-manager": "home-manager",
"nix-flatpak": "nix-flatpak",
"nixpkgs": "nixpkgs",
"snowfall-lib": "snowfall-lib"
"snowfall-lib": "snowfall-lib",
"sops-nix": "sops-nix"
}
},
"snowfall-lib": {
@ -168,6 +185,27 @@
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1726524647,
"narHash": "sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e2d404a7ea599a013189aa42947f66cede0645c8",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,

View file

@ -11,6 +11,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# Secret management tool
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home manager for managing the /home directory.
home-manager = {
url = "github:nix-community/home-manager";
@ -49,12 +55,14 @@
allowUnfree = true; # Allow unfree packages.
};
# Apply some NixOS modules globally.
systems.modules.nixos = with inputs; [
sops-nix.nixosModules.sops
];
# Apply some home-manager modules globally.
homes.modules = with inputs; [
nix-flatpak.homeManagerModules.nix-flatpak
];
homes.users."jo@puzzlevision".modules = with inputs; [
catppuccin.homeManagerModules.catppuccin
];
};

View file

@ -20,19 +20,19 @@
"org/gnome/shell" = {
favorite-apps = [
"org.gnome.Nautilus.desktop"
"firefox.desktop"
"chromium-browser.desktop"
"spotify.desktop"
"phpstorm.desktop"
];
enabled-extensions = [
"user-theme@gnome-shell-extensions.gcampax.github.com"
"dash-to-dock@micxgx.gmail.com"
"blur-my-shell@aunetx"
"appindicatorsupport@rgcjonas.gmail.com"
"unite@hardpixel.eu"
"color-picker@tuberry"
"clipboard-history@alexsaveau.dev"
pkgs.gnomeExtensions.unite.extensionUuid
pkgs.gnomeExtensions.color-picker.extensionUuid
pkgs.gnomeExtensions.clipboard-history.extensionUuid
pkgs.gnomeExtensions.blur-my-shell.extensionUuid
pkgs.gnomeExtensions.user-themes.extensionUuid
pkgs.gnomeExtensions.dash-to-dock.extensionUuid
pkgs.gnomeExtensions.appindicator.extensionUuid
];
};

View file

@ -19,21 +19,14 @@
config,
...
}: with lib; with lib.${namespace};
let
zed-fhs = pkgs.buildFHSUserEnv {
name = "zed";
targetPkgs = pkgs:
with pkgs; [
zed-editor
];
runScript = "zed";
};
in
{
imports = [
./apps/gnome.nix
];
themes.catppuccin.gtk.enable = true;
apps.zed-editor.enable = true;
# Flatpak configuration.
services.flatpak = {
enable = true;
@ -56,6 +49,7 @@ in
g4music
blanket
bitwarden-desktop
kitty
### Development
avra
@ -65,7 +59,6 @@ in
nodejs_22
bun
devenv
zed-fhs
### Rust development specific
rustup

View file

@ -7,7 +7,7 @@
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.apps.development.zed-editor;
cfg = config.apps.zed-editor;
zed-fhs = pkgs.buildFHSUserEnv {
name = "zed";
@ -18,7 +18,7 @@ let
runScript = "zed";
};
in {
options.${namespace}.apps.zed-editor = { enable = mkEnableOption "zed-editor"; };
options.apps.zed-editor = { enable = mkEnableOption "zed-editor"; };
config = mkIf cfg.enable {
home.packages = [zed-fhs];

View file

@ -0,0 +1,17 @@
{
lib,
namespace,
config,
pkgs,
...
}: with lib; with lib.${namespace};
let
palette = (pkgs.lib.importJSON (config.catppuccin.sources.palette + "/palette.json")).${config.catppuccin.flavor}.colors;
in
{
options.palette = mkOption { type = types.attrsOf types.raw; };
config = {
inherit palette;
};
}

View file

@ -1,13 +1,128 @@
{
lib,
namespace,
config,
pkgs,
...
}: {
}: with lib; with lib.${namespace};
let
# Stolen from Oli @ git.gay, basically just themes default libadwaita components.
css = pkgs.writeTextFile {
name = "gtk-css";
text = ''
@define-color accent_color ${config.palette.blue.hex};
@define-color accent_bg_color ${config.palette.blue.hex};
@define-color accent_fg_color ${config.palette.base.hex};
@define-color destructive_color ${config.palette.red.hex};
@define-color destructive_bg_color ${config.palette.red.hex};
@define-color destructive_fg_color ${config.palette.base.hex};
@define-color success_color ${config.palette.green.hex};
@define-color success_bg_color ${config.palette.green.hex};
@define-color success_fg_color ${config.palette.base.hex};
@define-color warning_color ${config.palette.mauve.hex};
@define-color warning_bg_color ${config.palette.mauve.hex};
@define-color warning_fg_color ${config.palette.base.hex};
@define-color error_color ${config.palette.red.hex};
@define-color error_bg_color ${config.palette.red.hex};
@define-color error_fg_color ${config.palette.base.hex};
@define-color window_bg_color ${config.palette.base.hex};
@define-color window_fg_color ${config.palette.text.hex};
@define-color view_bg_color ${config.palette.base.hex};
@define-color view_fg_color ${config.palette.text.hex};
@define-color headerbar_bg_color ${config.palette.mantle.hex};
@define-color headerbar_fg_color ${config.palette.text.hex};
@define-color headerbar_border_color rgba(${builtins.toString config.palette.base.rgb.r}, ${builtins.toString config.palette.base.rgb.g}, ${builtins.toString config.palette.base.rgb.b}, 0.7);
@define-color headerbar_backdrop_color @window_bg_color;
@define-color headerbar_shade_color rgba(0, 0, 0, 0.07);
@define-color headerbar_darker_shade_color rgba(0, 0, 0, 0.07);
@define-color sidebar_bg_color ${config.palette.mantle.hex};
@define-color sidebar_fg_color ${config.palette.text.hex};
@define-color sidebar_backdrop_color @window_bg_color;
@define-color sidebar_shade_color rgba(0, 0, 0, 0.07);
@define-color secondary_sidebar_bg_color @sidebar_bg_color;
@define-color secondary_sidebar_fg_color @sidebar_fg_color;
@define-color secondary_sidebar_backdrop_color @sidebar_backdrop_color;
@define-color secondary_sidebar_shade_color @sidebar_shade_color;
@define-color card_bg_color ${config.palette.mantle.hex};
@define-color card_fg_color ${config.palette.text.hex};
@define-color card_shade_color rgba(0, 0, 0, 0.07);
@define-color dialog_bg_color ${config.palette.mantle.hex};
@define-color dialog_fg_color ${config.palette.text.hex};
@define-color popover_bg_color ${config.palette.mantle.hex};
@define-color popover_fg_color ${config.palette.text.hex};
@define-color popover_shade_color rgba(0, 0, 0, 0.07);
@define-color shade_color rgba(0, 0, 0, 0.07);
@define-color scrollbar_outline_color ${config.palette.surface0.hex};
@define-color blue_1 ${config.palette.blue.hex};
@define-color blue_2 ${config.palette.blue.hex};
@define-color blue_3 ${config.palette.blue.hex};
@define-color blue_4 ${config.palette.blue.hex};
@define-color blue_5 ${config.palette.blue.hex};
@define-color green_1 ${config.palette.green.hex};
@define-color green_2 ${config.palette.green.hex};
@define-color green_3 ${config.palette.green.hex};
@define-color green_4 ${config.palette.green.hex};
@define-color green_5 ${config.palette.green.hex};
@define-color yellow_1 ${config.palette.yellow.hex};
@define-color yellow_2 ${config.palette.yellow.hex};
@define-color yellow_3 ${config.palette.yellow.hex};
@define-color yellow_4 ${config.palette.yellow.hex};
@define-color yellow_5 ${config.palette.yellow.hex};
@define-color orange_1 ${config.palette.peach.hex};
@define-color orange_2 ${config.palette.peach.hex};
@define-color orange_3 ${config.palette.peach.hex};
@define-color orange_4 ${config.palette.peach.hex};
@define-color orange_5 ${config.palette.peach.hex};
@define-color red_1 ${config.palette.red.hex};
@define-color red_2 ${config.palette.red.hex};
@define-color red_3 ${config.palette.red.hex};
@define-color red_4 ${config.palette.red.hex};
@define-color red_5 ${config.palette.red.hex};
@define-color purple_1 ${config.palette.mauve.hex};
@define-color purple_2 ${config.palette.mauve.hex};
@define-color purple_3 ${config.palette.mauve.hex};
@define-color purple_4 ${config.palette.mauve.hex};
@define-color purple_5 ${config.palette.mauve.hex};
@define-color brown_1 ${config.palette.flamingo.hex};
@define-color brown_2 ${config.palette.flamingo.hex};
@define-color brown_3 ${config.palette.flamingo.hex};
@define-color brown_4 ${config.palette.flamingo.hex};
@define-color brown_5 ${config.palette.flamingo.hex};
@define-color light_1 ${config.palette.mantle.hex};
@define-color light_2 ${config.palette.mantle.hex};
@define-color light_3 ${config.palette.mantle.hex};
@define-color light_4 ${config.palette.mantle.hex};
@define-color light_5 ${config.palette.mantle.hex};
@define-color dark_1 ${config.palette.mantle.hex};
@define-color dark_2 ${config.palette.mantle.hex};
@define-color dark_3 ${config.palette.mantle.hex};
@define-color dark_4 ${config.palette.mantle.hex};
@define-color dark_5 ${config.palette.mantle.hex};
'';
};
cfg = config.themes.catppuccin.gtk;
in
{
options.themes.catppuccin.gtk = { enable = mkEnableOption "Enable the Catppuccin theme for GTK"; };
config = mkIf cfg.enable {
home.packages = with pkgs; [
(colloid-gtk-theme.override {
themeVariants = ["default"];
colorVariants = ["dark"];
sizeVariants = ["standard"];
tweaks = ["catppuccin"];
})
];
gtk = {
enable = true;
font = {
name = "Cantarell";
name = "Ubuntu";
size = 12;
package = pkgs.cantarell-fonts;
package = pkgs.ubuntu-sans;
};
catppuccin = {
@ -19,13 +134,19 @@
};
theme = {
name = "Colloid-Dark-Catppuccin";
package = pkgs.colloid-gtk-theme.override {
themeVariants = ["default"];
colorVariants = ["dark"];
sizeVariants = ["standard"];
tweaks = ["catppuccin"];
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
gtk3 = {
extraCss = ''@import url("${css}");'';
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
gtk4 = {
extraCss = ''@import url("${css}");'';
};
};
@ -35,8 +156,8 @@
};
"org/gnome/desktop/background" = {
picture-uri = lib.snowfall.fs.get-file "resources/wallpapers/catppuccin_blue_cat.png";
picture-uri-dark = lib.snowfall.fs.get-file "resources/wallpapers/catppuccin_blue_cat.png";
picture-uri = lib.snowfall.fs.get-file "resources/wallpapers/blossoms.png";
picture-uri-dark = lib.snowfall.fs.get-file "resources/wallpapers/blossoms.png";
};
"org/gnome/desktop/interface" = {
@ -44,4 +165,5 @@
cursor-theme = "catppuccin-macchiato-blue-cursors";
};
};
};
}

View file

@ -26,8 +26,8 @@ in {
locale.enable = true;
};
};
};
# Enable SSH for remote login
services.openssh.enable = true;
};
}

View file

@ -1,6 +1,6 @@
{
lib,
namespace,
hostname,
config,
...
}: with lib; with lib.${namespace};

View file

@ -1,7 +1,8 @@
{
lib,
namespace,
hostname,
config,
host,
...
}: with lib; with lib.${namespace};
let
@ -13,7 +14,7 @@ in {
virtualisation.oci-containers.containers.vaultwarden = {
image = "vaultwarden/server";
autoStart = true;
hostname = hostname;
hostname = host;
# Todo: continue writing vaultwarden config
};
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View file

@ -5,9 +5,7 @@
namespace,
config,
...
}:
with lib;
with lib.${namespace};
}: with lib; with lib.${namespace};
{
imports = [
./hardware-configuration.nix
@ -26,24 +24,34 @@ with lib.${namespace};
# Enable docker
virtualisation.docker.enable = true;
# Set system Type
puzzlevision.archetypes.server.enable = true;
# Set system configuration
puzzlevision = {
archetypes.server.enable = true;
services = {
traefik.enable = true;
};
};
# Configure users.
snowfallorg.users.jo.admin = true;
users.users.jo.isNormalUser = true;
users.users.jo.extraGroups = [ "dialout" "docker" ];
snowfallorg.users.cyn.admin = true;
users.users.cyn.isNormalUser = true;
users.users.cyn.extraGroups = [ "dialout" "docker" ];
# Configure home-manager
home-manager = {
backupFileExtension = "homeManagerBackup";
};
# Provide users with some sane default packages.
# Install required system packages
environment.systemPackages = with pkgs; [
### General
nano
vim
## Runtimes
nodejs_22
bun
];
system.stateVersion = "24.05";

View file

@ -5,9 +5,7 @@
namespace,
config,
...
}:
with lib;
with lib.${namespace};
}: with lib; with lib.${namespace};
{
imports = [
./hardware-configuration.nix
@ -43,8 +41,10 @@ with lib.${namespace};
# Enable docker
virtualisation.docker.enable = true;
# Set system Type
puzzlevision.archetypes.workstation.enable = true;
# Set system configuration
puzzlevision = {
archetypes.workstation.enable = true;
};
# Enable flatpak support.
services.flatpak.enable = true;
@ -67,6 +67,10 @@ with lib.${namespace};
chromium
vlc
spotify
## Security
pinentry-tty
gnupg
];
system.stateVersion = "23.05";