From 58c8146cc0d7414b0e72323306d570974a9390f8 Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Fri, 13 Feb 2026 19:21:27 +0000 Subject: [PATCH] progress... --- .../hosts/aspects/doloro-laptop/hardware.nix | 33 +++++++ config/hosts/aspects/doloro-laptop/home.nix | 5 +- config/hosts/aspects/doloro-laptop/host.nix | 10 ++- config/hosts/aspects/doloro-shared.nix | 23 +++-- config/hosts/computers.nix | 28 +++--- config/modules/fish.nix | 76 ++++++++-------- config/modules/git.nix | 45 ++++++++++ config/modules/hyprland/doloro-settings.nix | 1 + config/modules/hyprland/hyprland.nix | 6 ++ config/modules/kitty.nix | 19 ++++ config/modules/secrets/sops.nix | 48 +++++----- config/modules/tmux.nix | 32 ++++--- config/modules/tuigreetd.nix | 18 ++++ config/modules/zen-browser.nix | 88 +++++++++++++++++++ flake.lock | 23 ++++- flake.nix | 4 + 16 files changed, 363 insertions(+), 96 deletions(-) create mode 100644 config/hosts/aspects/doloro-laptop/hardware.nix create mode 100644 config/modules/git.nix create mode 100644 config/modules/kitty.nix create mode 100644 config/modules/tuigreetd.nix create mode 100644 config/modules/zen-browser.nix diff --git a/config/hosts/aspects/doloro-laptop/hardware.nix b/config/hosts/aspects/doloro-laptop/hardware.nix new file mode 100644 index 0000000..e9e9113 --- /dev/null +++ b/config/hosts/aspects/doloro-laptop/hardware.nix @@ -0,0 +1,33 @@ +{ + den, + modules, + __findFile, + ... +}: +{ + den.aspects.laptop = { + nixos = + { + pkgs, + lib, + config, + ... + }: + { + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "vmd" + "nvme" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + }; + }; +} diff --git a/config/hosts/aspects/doloro-laptop/home.nix b/config/hosts/aspects/doloro-laptop/home.nix index 99ae6d4..6d4e092 100644 --- a/config/hosts/aspects/doloro-laptop/home.nix +++ b/config/hosts/aspects/doloro-laptop/home.nix @@ -9,17 +9,20 @@ includes = [ den.aspects.doloro-shared - modules.user.doloro modules.hyprland modules.sops modules.fish + + modules.kitty ]; nixos = { config, pkgs, ... }: { users.users.doloro = { + isNormalUser = true; shell = pkgs.fish; + initialPassword = "sex"; hashedPasswordFile = config.sops.secrets."doloro-hashed_password".path; }; }; diff --git a/config/hosts/aspects/doloro-laptop/host.nix b/config/hosts/aspects/doloro-laptop/host.nix index abfb36c..715163a 100644 --- a/config/hosts/aspects/doloro-laptop/host.nix +++ b/config/hosts/aspects/doloro-laptop/host.nix @@ -8,6 +8,7 @@ den.aspects.laptop = { includes = [ modules.nix + modules.tuigreet ]; nixos = { pkgs, config, ... }: @@ -49,7 +50,7 @@ services.gnome.gnome-keyring.enable = true; hardware = { - firmware = [ pkgs.intel-npu-driver ]; + # firmware = [ pkgs.intel-npu-driver ]; cpu.intel = { # npu.enable = true; }; @@ -97,8 +98,8 @@ boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; # Define a user account. Don't forget to set a password with ‘passwd’. # users.users.doloro = { - # isNormalUser = true; - # shell = pkgs.fish; + # isNormalUser = true; + # shell = pkgs.fish; # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. # packages = with pkgs; [ # tree @@ -109,6 +110,9 @@ # ]; # # initialPassword = "sex"; # }; + users.users.root = { + password = "meowmeowmeow"; + }; users.mutableUsers = false; services.system76-scheduler.enable = true; diff --git a/config/hosts/aspects/doloro-shared.nix b/config/hosts/aspects/doloro-shared.nix index 63d8e6e..33836ce 100644 --- a/config/hosts/aspects/doloro-shared.nix +++ b/config/hosts/aspects/doloro-shared.nix @@ -1,15 +1,26 @@ -{ den, modules, ... }: +{ + den, + modules, + __findFile, + ... +}: { den.aspects.doloro-shared = { includes = [ modules.nixvim modules.nix + modules.tmux + ]; - homeManager = { - home = { - username = "doloro"; - homeDirectory = "/home/doloro"; + homeManager = + { pkgs, ... }: + { + home = { + username = "doloro"; + homeDirectory = "/home/doloro"; + packages = with pkgs; [ wl-clipboard ]; + }; + programs.home-manager.enable = true; }; - }; }; } diff --git a/config/hosts/computers.nix b/config/hosts/computers.nix index aea57cf..4a2b0a2 100644 --- a/config/hosts/computers.nix +++ b/config/hosts/computers.nix @@ -1,24 +1,24 @@ { den, __findFile, ... }: { # Homes - den.homes.x86_64-linux.doloro-desktop = { - userName = "doloro"; - }; - # TODO - # den.homes.x86_64-linux.doloro-laptop = { + # den.homes.x86_64-linux.doloro-desktop = { # userName = "doloro"; # }; - # Machines - den.hosts.x86_64-linux.desktop = { - users.doloro = { - includes = [ ]; - aspect = "doloro-desktop"; - }; - }; # TODO - # den.hosts.x86_64-linux.laptop = { + den.homes.x86_64-linux.doloro-laptop = { + userName = "doloro"; + }; + # Machines + # den.hosts.x86_64-linux.desktop = { # users.doloro = { - # aspect = "doloro-laptop"; + # includes = [ ]; + # aspect = "doloro-desktop"; # }; # }; + # TODO + den.hosts.x86_64-linux.laptop = { + users.doloro = { + aspect = "doloro-laptop"; + }; + }; } diff --git a/config/modules/fish.nix b/config/modules/fish.nix index 41f3410..a74a404 100644 --- a/config/modules/fish.nix +++ b/config/modules/fish.nix @@ -1,44 +1,50 @@ -{ modules, pkgs, ... }: +{ modules, ... }: { modules.fish = { nixos = { programs.fish.enable = true; }; - homeManager = { - home.shell.enableFishIntegration = true; - home.packages = [ pkgs.nix-output-monitor ]; - programs = { - fish = { - enable = true; - shellInit = '' - set -g theme_nerd_fonts yes - set -g theme_color_scheme nord - set -g theme_display_user yes - set -g fish_color_autosuggestion 6F6578 - alias nik 'nix' - ''; - # alias nos 'sudo echo; sudo nixos-rebuild switch --flake .#${aspect-name} --log-format internal-json -v &| nom --json' - # alias hms 'home-manager switch --flake .#${aspect-name} --log-format internal-json -v &| nom --json' - plugins = [ - { - name = "bobthefish"; - src = pkgs.fetchFromGitHub { - owner = "oh-my-fish"; - repo = "theme-bobthefish"; - rev = "e3b4d4eafc23516e35f162686f08a42edf844e40"; - sha256 = "sha256-cXOYvdn74H4rkMWSC7G6bT4wa9d3/3vRnKed2ixRnuA="; - }; - } - ]; - }; - eza = { - enable = true; - enableFishIntegration = true; - icons = "auto"; - git = true; - extraOptions = [ ]; + homeManager = + { pkgs, ... }: + { + home.shell.enableFishIntegration = true; + home.packages = [ pkgs.nix-output-monitor ]; + programs = { + fish = { + enable = true; + shellInit = '' + set -g theme_nerd_fonts yes + set -g theme_color_scheme nord + set -g theme_display_user yes + set -g fish_color_autosuggestion 6F6578 + alias nik 'nix' + ''; + # alias nos 'sudo echo; sudo nixos-rebuild switch --flake .#${aspect-name} --log-format internal-json -v &| nom --json' + # alias hms 'home-manager switch --flake .#${aspect-name} --log-format internal-json -v &| nom --json' + plugins = [ + { + name = "bobthefish"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "theme-bobthefish"; + rev = "e3b4d4eafc23516e35f162686f08a42edf844e40"; + sha256 = "sha256-cXOYvdn74H4rkMWSC7G6bT4wa9d3/3vRnKed2ixRnuA="; + }; + } + ]; + }; + eza = { + enable = true; + enableFishIntegration = true; + icons = "auto"; + git = true; + extraOptions = [ ]; + }; + direnv = { + enable = true; + nix-direnv.enable = true; + }; }; }; - }; }; } diff --git a/config/modules/git.nix b/config/modules/git.nix new file mode 100644 index 0000000..3ae818a --- /dev/null +++ b/config/modules/git.nix @@ -0,0 +1,45 @@ +{ den, modules, ... }: +{ + modules.git = { + provides = { + doloro = { + homeManager = + { home, pkgs, ... }: + { + programs.git = { + enable = true; + settings = { + user = { + name = "Doloro1978"; + email = "doloroo@proton.me"; + signingKey = "089B373588540877"; + }; + commit = { + gpgSign = true; + }; + pull = { + rebase = true; + }; + }; + }; + programs.gpg = { + enable = true; + }; + services = { + gpg-agent = { + enable = true; + pinentry = { + package = pkgs.pinentry-qt; + program = "pinentry-qt"; + }; + }; + }; + }; + nixos = + { pkgs, ... }: + { + }; + }; + }; + }; +} diff --git a/config/modules/hyprland/doloro-settings.nix b/config/modules/hyprland/doloro-settings.nix index bce0d7c..e2a6c70 100644 --- a/config/modules/hyprland/doloro-settings.nix +++ b/config/modules/hyprland/doloro-settings.nix @@ -101,6 +101,7 @@ "$mainMod, C, killactive" "$mainMod, M, exec, uwsm stop" "$mainMod, E, exec, $fileManager" + "$mainMod, Q, exec, kitty" "$mainMod, V, togglefloating," "$mainMod, P, pseudo, # dwindle" "$mainMod, J, togglesplit, # dwindle" diff --git a/config/modules/hyprland/hyprland.nix b/config/modules/hyprland/hyprland.nix index 9c7152f..3689e0b 100644 --- a/config/modules/hyprland/hyprland.nix +++ b/config/modules/hyprland/hyprland.nix @@ -11,6 +11,12 @@ nixos = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + wayfreeze + grim + slurp + wlogout + ]; programs.xwayland.enable = true; programs.hyprland = { enable = true; diff --git a/config/modules/kitty.nix b/config/modules/kitty.nix new file mode 100644 index 0000000..2d37138 --- /dev/null +++ b/config/modules/kitty.nix @@ -0,0 +1,19 @@ +{ den, modules, ... }: +{ + modules.kitty = { + homeManager = { + programs.kitty = { + enable = true; + font = { + name = "Google Sans Code Nerd Font"; + size = 11; + }; + settings = { + sync_to_monitor = "yes"; + background_opacity = 0.6; + cursor_trail = 1; + }; + }; + }; + }; +} diff --git a/config/modules/secrets/sops.nix b/config/modules/secrets/sops.nix index e76d8aa..1ae3615 100644 --- a/config/modules/secrets/sops.nix +++ b/config/modules/secrets/sops.nix @@ -8,31 +8,35 @@ }; }; modules.sops = { - homeManager = { - imports = [ - inputs.sops-nix.homeManagerModules.sops - ]; - sops = { - age.keyFile = "/home/doloro/.config/sops/age/key.txt"; # must have no password! - defaultSopsFile = ./secrets.yaml; + homeManager = + { ... }: + { + imports = [ + inputs.sops-nix.homeManagerModules.sops + ]; + sops = { + age.keyFile = "/home/doloro/.config/sops/age/key.txt"; # must have no password! + defaultSopsFile = ./secrets.yaml; + }; }; - }; - nixos = { - imports = [ - inputs.sops-nix.nixosModules.sops - ]; - sops = { - age.keyFile = "/etc/ssh/ssh_host_ed25519_key"; - defaultSopsFile = ./secrets.yaml; - secrets = { - root-hashed_password = { - neededForUsers = true; - }; - doloro-hashed_password = { - neededForUsers = true; + nixos = + { ... }: + { + imports = [ + inputs.sops-nix.nixosModules.sops + ]; + sops = { + # age.keyFile = "/etc/ssh/ssh_host_ed25519_key"; + defaultSopsFile = ./secrets.yaml; + secrets = { + root-hashed_password = { + neededForUsers = true; + }; + doloro-hashed_password = { + neededForUsers = true; + }; }; }; }; - }; }; } diff --git a/config/modules/tmux.nix b/config/modules/tmux.nix index d1e7e08..8f74ae2 100644 --- a/config/modules/tmux.nix +++ b/config/modules/tmux.nix @@ -1,18 +1,22 @@ -{ pkgs, modules, ... }: +{ modules, ... }: { modules.tmux = { - programs.tmux = { - enable = true; - plugins = with pkgs.tmuxPlugins; [ - sensible - minimal-tmux-status - ]; - extraConfig = '' - set-option -g default-terminal "xterm-256color" - set -a terminal-features "xterm-256color:RGB" - set -g status-bg black - set -g status-fg white - ''; - }; + homeManager = + { home, pkgs, ... }: + { + programs.tmux = { + enable = true; + plugins = with pkgs.tmuxPlugins; [ + sensible + minimal-tmux-status + ]; + extraConfig = '' + set-option -g default-terminal "xterm-256color" + set -a terminal-features "xterm-256color:RGB" + set -g status-bg black + set -g status-fg white + ''; + }; + }; }; } diff --git a/config/modules/tuigreetd.nix b/config/modules/tuigreetd.nix new file mode 100644 index 0000000..b2d1a9b --- /dev/null +++ b/config/modules/tuigreetd.nix @@ -0,0 +1,18 @@ +{ den, modules, ... }: +{ + modules.tuigreet = { + nixos = + { pkgs, config, ... }: + { + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --sessions ${config.services.xserver.displayManager.sessionData.desktops}/share/xsessions:${config.services.xserver.displayManager.sessionData.desktops}/share/wayland-sessions --remember --remember-user-session"; + user = "greeter"; + }; + }; + }; + }; + }; +} diff --git a/config/modules/zen-browser.nix b/config/modules/zen-browser.nix new file mode 100644 index 0000000..02e8eee --- /dev/null +++ b/config/modules/zen-browser.nix @@ -0,0 +1,88 @@ +{ + den, + modules, + inputs, + ... +}: +{ + flake-file.inputs = { + zen-browser.url = "github:youwen5/zen-browser-flake"; + zen-browser.inputs.nixpkgs.follows = "nixpkgs"; + }; + modules.zen-browser = { + homeManager = + { + home, + pkgs, + lib, + ... + }: + let + extension = shortId: guid: { + name = guid; + value = { + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; + installation_mode = "normal_installed"; + }; + }; + + prefs = { + # Check these out at about:config + "extensions.autoDisableScopes" = 0; + "extensions.pocket.enabled" = false; + # ... + }; + + extensions = [ + # To add additional extensions, find it on addons.mozilla.org, find + # the short ID in the url (like https://addons.mozilla.org/en-US/firefox/addon/!SHORT_ID!/) + # Then go to https://addons.mozilla.org/api/v5/addons/addon/!SHORT_ID!/ to get the guid + (extension "ublock-origin" "uBlock0@raymondhill.net") + # ... + ]; + in + { + home.packages = [ + (pkgs.wrapFirefox + inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped + { + extraPrefs = lib.concatLines ( + lib.mapAttrsToList ( + name: value: "lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});" + ) prefs + ); + + extraPolicies = { + DisableTelemetry = true; + ExtensionSettings = builtins.listToAttrs extensions; + + SearchEngines = { + Default = "ddg"; + Add = [ + { + Name = "nixpkgs packages"; + URLTemplate = "https://search.nixos.org/packages?query={searchTerms}"; + IconURL = "https://wiki.nixos.org/favicon.ico"; + Alias = "@np"; + } + { + Name = "NixOS options"; + URLTemplate = "https://search.nixos.org/options?query={searchTerms}"; + IconURL = "https://wiki.nixos.org/favicon.ico"; + Alias = "@no"; + } + { + Name = "NixOS Wiki"; + URLTemplate = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; + IconURL = "https://wiki.nixos.org/favicon.ico"; + Alias = "@nw"; + } + ]; + }; + }; + } + ) + ]; + }; + }; +} diff --git a/flake.lock b/flake.lock index 2770a66..0e32288 100644 --- a/flake.lock +++ b/flake.lock @@ -716,7 +716,8 @@ "nixvim": "nixvim", "raspberry-pi-nix": "raspberry-pi-nix", "sops-nix": "sops-nix", - "systems": "systems_3" + "systems": "systems_3", + "zen-browser": "zen-browser" } }, "rpi-bluez-firmware-src": { @@ -943,6 +944,26 @@ "repo": "xdg-desktop-portal-hyprland", "type": "github" } + }, + "zen-browser": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770438797, + "narHash": "sha256-pwnQTmZswF6bu2/Ie7ajOo8w6rXQwVI954S9WX1UG3w=", + "owner": "youwen5", + "repo": "zen-browser-flake", + "rev": "d396599774bdbafeb86c122dc2c422c7084ea390", + "type": "github" + }, + "original": { + "owner": "youwen5", + "repo": "zen-browser-flake", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 772805d..ba58378 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,10 @@ url = "github:Mic92/sops-nix"; }; systems.url = "github:nix-systems/default"; + zen-browser = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:youwen5/zen-browser-flake"; + }; }; }