diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..60f1f04 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,7 @@ +keys: + - &jo D94C5D66B93C7C7B855F8FF08FBFDF2DB9BBAAF9 +creation_rules: + - path_regex: secrets/[^/]+\.(yaml|json|env|ini)$ + key_groups: + - pgp: + - *jo diff --git a/flake.lock b/flake.lock index c455022..44b1b02 100644 --- a/flake.lock +++ b/flake.lock @@ -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, diff --git a/flake.nix b/flake.nix index 4c178b0..053be1e 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; }; diff --git a/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix b/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix index bfa86a7..420599a 100644 --- a/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix +++ b/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix @@ -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 ]; }; diff --git a/homes/x86_64-linux/jo@puzzlevision/default.nix b/homes/x86_64-linux/jo@puzzlevision/default.nix index a02c72e..9af58cb 100644 --- a/homes/x86_64-linux/jo@puzzlevision/default.nix +++ b/homes/x86_64-linux/jo@puzzlevision/default.nix @@ -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 diff --git a/modules/home/apps/development/zed-editor/default.nix b/modules/home/apps/development/zed-editor/default.nix index 85b0f63..1c565c3 100644 --- a/modules/home/apps/development/zed-editor/default.nix +++ b/modules/home/apps/development/zed-editor/default.nix @@ -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]; diff --git a/modules/home/palette/default.nix b/modules/home/palette/default.nix new file mode 100644 index 0000000..b1b2439 --- /dev/null +++ b/modules/home/palette/default.nix @@ -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; + }; +} diff --git a/modules/home/themes/catppuccin/gnome/default.nix b/modules/home/themes/catppuccin/gnome/default.nix index dffdbc5..93ed65c 100644 --- a/modules/home/themes/catppuccin/gnome/default.nix +++ b/modules/home/themes/catppuccin/gnome/default.nix @@ -1,47 +1,169 @@ { + lib, + namespace, + config, + pkgs, ... -}: { - gtk = { - enable = true; +}: 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}; + ''; + }; - font = { - name = "Cantarell"; - size = 12; - package = pkgs.cantarell-fonts; - }; + cfg = config.themes.catppuccin.gtk; +in +{ + options.themes.catppuccin.gtk = { enable = mkEnableOption "Enable the Catppuccin theme for GTK"; }; - catppuccin = { - icon = { - enable = true; - accent = "blue"; - flavor = "macchiato"; - }; - }; - - theme = { - name = "Colloid-Dark-Catppuccin"; - package = pkgs.colloid-gtk-theme.override { + 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 = "Ubuntu"; + size = 12; + package = pkgs.ubuntu-sans; + }; + + catppuccin = { + icon = { + enable = true; + accent = "blue"; + flavor = "macchiato"; + }; + }; + + theme = { + 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}");''; + }; + }; + + dconf.settings = { + "org/gnome/shell/extensions/user-theme" = { + name = "Colloid-Dark-Catppuccin"; + }; + + "org/gnome/desktop/background" = { + 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" = { + color-scheme = "prefer-dark"; + cursor-theme = "catppuccin-macchiato-blue-cursors"; }; }; }; - - dconf.settings = { - "org/gnome/shell/extensions/user-theme" = { - name = "Colloid-Dark-Catppuccin"; - }; - - "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"; - }; - - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - cursor-theme = "catppuccin-macchiato-blue-cursors"; - }; - }; } diff --git a/modules/nixos/archetypes/server/default.nix b/modules/nixos/archetypes/server/default.nix index 89843d5..7a82fa2 100644 --- a/modules/nixos/archetypes/server/default.nix +++ b/modules/nixos/archetypes/server/default.nix @@ -26,8 +26,8 @@ in { locale.enable = true; }; }; - }; - # Enable SSH for remote login - services.openssh.enable = true; -} \ No newline at end of file + # Enable SSH for remote login + services.openssh.enable = true; + }; +} diff --git a/modules/nixos/services/traefik/default.nix b/modules/nixos/services/traefik/default.nix index 9b1b254..1ab2c2a 100644 --- a/modules/nixos/services/traefik/default.nix +++ b/modules/nixos/services/traefik/default.nix @@ -1,6 +1,6 @@ { + lib, namespace, - hostname, config, ... }: with lib; with lib.${namespace}; @@ -98,4 +98,4 @@ in { # Todo: continue with "traefik" configuration and test it on a running system # Todo: setup sops-nix for secret management }; -} \ No newline at end of file +} diff --git a/modules/nixos/services/vaultwarden/default.nix b/modules/nixos/services/vaultwarden/default.nix index a573f66..ae5dd67 100644 --- a/modules/nixos/services/vaultwarden/default.nix +++ b/modules/nixos/services/vaultwarden/default.nix @@ -1,7 +1,8 @@ { + lib, namespace, - hostname, config, + host, ... }: with lib; with lib.${namespace}; let @@ -13,8 +14,8 @@ in { virtualisation.oci-containers.containers.vaultwarden = { image = "vaultwarden/server"; autoStart = true; - hostname = hostname; + hostname = host; # Todo: continue writing vaultwarden config }; }; -} \ No newline at end of file +} diff --git a/resources/wallpapers/accent-color-wallpaper.png b/resources/wallpapers/accent-color-wallpaper.png deleted file mode 100644 index a40f058..0000000 Binary files a/resources/wallpapers/accent-color-wallpaper.png and /dev/null differ diff --git a/resources/wallpapers/bass.png b/resources/wallpapers/bass.png new file mode 100644 index 0000000..ce2df8e Binary files /dev/null and b/resources/wallpapers/bass.png differ diff --git a/resources/wallpapers/blossoms.png b/resources/wallpapers/blossoms.png new file mode 100644 index 0000000..830aa56 Binary files /dev/null and b/resources/wallpapers/blossoms.png differ diff --git a/resources/wallpapers/maid_in_forest_with_lantern.jpg b/resources/wallpapers/maid_in_forest_with_lantern.jpg deleted file mode 100644 index 6f88150..0000000 Binary files a/resources/wallpapers/maid_in_forest_with_lantern.jpg and /dev/null differ diff --git a/resources/wallpapers/pixelart_river_boat.png b/resources/wallpapers/pixelart_river_boat.png new file mode 100644 index 0000000..9d67641 Binary files /dev/null and b/resources/wallpapers/pixelart_river_boat.png differ diff --git a/systems/x86_64-linux/absolutesolver/default.nix b/systems/x86_64-linux/absolutesolver/default.nix index f35b125..a86365e 100644 --- a/systems/x86_64-linux/absolutesolver/default.nix +++ b/systems/x86_64-linux/absolutesolver/default.nix @@ -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"; diff --git a/systems/x86_64-linux/puzzlevision/default.nix b/systems/x86_64-linux/puzzlevision/default.nix index 078d8e3..307d5b5 100644 --- a/systems/x86_64-linux/puzzlevision/default.nix +++ b/systems/x86_64-linux/puzzlevision/default.nix @@ -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";