diff --git a/README.md b/README.md index 2271053..77cd987 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,33 @@ # dotfiles -- my personal nix dotfiles in flake +- my personal nix dotfiles in the **flake** + +- simple build command for system ```bash -git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles --depth 1 +git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles sudo nixos-rebuild switch --flake ~/dotfiles#laptop ``` +- generate a vm of the flake with this command + ```bash nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#leanix' -f vm --disk-size 20480 ``` +- deploy configuration on the new system + +```bash +# Copy my repository +git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles --depth 1 + +# Generate your own hardware configurations for system +sudo nixos-generate-config --dir ~/dotfiles/zenith +# or +sudo nixos-generate-config --dir ~/dotfiles/leanix + +# Rebuild your system from the flake +sudo nixos-rebuild switch --flake ~/dotfiles#zenith +``` + ## Features diff --git a/TODO.md b/TODO.md index 52bb76d..497829d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,24 @@ # TODO -- [ ] Wallpaper switch -- [x] Keyboard switch -- [x] Waybar fix -- [x] Rofi config -- [ ] Cliphist manager fix -- [x] Stylix theming to each module -- [ ] Enabling nvidia graphics and disabling it -- [ ] Modularity connected via configuration.nix file with home manager (disable gnome, gnome configuration will be disabled too) -- [x] Rofi theme and other themes, where are colors setup declaratively +- [x] wallpaper switch +- [x] keyboard switch +- [x] waybar fix +- [x] rofi config +- [x] cliphist manager fix +- [x] stylix theming to each module +- [x] rofi theme and other themes, where are colors setup declaratively +- [ ] enabling nvidia graphics and disabling it +- [ ] modularity connected via configuration.nix file with home manager (disable gnome, gnome configuration will be disabled too) +- [x] custom if else statements +- [ ] neovim +- [ ] librewolf and firefox fix +- [ ] fix kde theme in stylix +- [x] move sops +- [ ] figure out yubico authentication +- [ ] graph of my system structure +- [x] add zsh to my config +- [ ] ?tryout starship? +- [ ] cleanup hyprland subtools (rofi, hyprlock, waybar) +- [ ] auto-cpufreq +- [ ] modularize hyprland config into multiple files +- [ ] consider moving nh config helper into module diff --git a/flake.nix b/flake.nix index b73a694..2b21d5d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,11 @@ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + hyprland = { url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs"; @@ -15,6 +20,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + spicetify-nix = { url = "github:Gerg-L/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -25,17 +36,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - plasma-manager = { - url = "github:nix-community/plasma-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.home-manager.follows = "home-manager"; - }; - firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; @@ -54,10 +54,10 @@ ... } @ inputs: let userSettings = { - username = "foglar"; # konsta or foglar (else defaulting to foglar or none) - hostname = "laptop"; + username = "foglar"; # konsta or shinya (else defaulting to shinya or none) + hostname = "kogami"; # kogami or ginoza - shell = "bash"; # bash, zsh + shell = "zsh"; # bash, zsh, none terminal = "kitty"; # kitty, alacritty browser = "librewolf"; # firefox, librewolf, qutebrowser editor = "neovim"; # neovim, vscode @@ -86,28 +86,28 @@ }; in { nixosConfigurations = { - laptop = nixpkgs.lib.nixosSystem { + kogami = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs system pkgs pkgs-stable userSettings; }; modules = [ - ./zenith/configuration.nix + ./kogami/configuration.nix inputs.stylix.nixosModules.stylix inputs.nix-ld.nixosModules.nix-ld inputs.sops-nix.nixosModules.sops ]; }; - leanix = nixpkgs.lib.nixosSystem { + ginoza = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs system pkgs pkgs-stable userSettings; }; modules = [ - ./leanix/configuration.nix + ./ginoza/configuration.nix inputs.stylix.nixosModules.stylix ]; }; diff --git a/ginoza/configuration.nix b/ginoza/configuration.nix index 765e948..633ee49 100644 --- a/ginoza/configuration.nix +++ b/ginoza/configuration.nix @@ -26,11 +26,6 @@ # Bootloader boot.loader.systemd-boot.enable = true; - # Environment variables - environment.sessionVariables = { - FLAKE = "/home/${userSettings.username}/.dotfiles"; - }; - # System level configuration sys = { audio.enable = true; diff --git a/nixos/home/packages/applications/firefox.nix b/nixos/home/packages/applications/firefox.nix index 265f91f..a4f3703 100644 --- a/nixos/home/packages/applications/firefox.nix +++ b/nixos/home/packages/applications/firefox.nix @@ -137,7 +137,7 @@ ublock-origin ] ++ ( - if (userSettings.username == "foglar") + if (userSettings.username == "shinya") then [ inputs.firefox-addons.packages."x86_64-linux".simple-translate inputs.firefox-addons.packages."x86_64-linux".duckduckgo-privacy-essentials diff --git a/nixos/home/packages/programming/code.nix b/nixos/home/packages/programming/code.nix index 88e9128..d628ff0 100644 --- a/nixos/home/packages/programming/code.nix +++ b/nixos/home/packages/programming/code.nix @@ -3,6 +3,7 @@ pkgs-stable, lib, config, + userSettings, ... }: { options = { @@ -141,7 +142,7 @@ }; "options" = { "nixos" = { - "expr" = "(builtins.getFlake \"~/dotfiles/\").nixosConfigurations.laptop.options"; + "expr" = "(builtins.getFlake \"~/.dotfiles/\").nixosConfigurations.${userSettings.hostname}.options"; }; }; # "home_manager": { diff --git a/nixos/system/packages.nix b/nixos/system/packages.nix index 9c3fe1a..751a494 100644 --- a/nixos/system/packages.nix +++ b/nixos/system/packages.nix @@ -1,4 +1,7 @@ -{lib, ...}: { +{ + lib, + ... +}: { imports = [ ./packages/docker.nix ./packages/podman.nix diff --git a/nixos/system/packages/sops/sops.nix b/nixos/system/packages/sops/sops.nix index 3a52736..072d96c 100644 --- a/nixos/system/packages/sops/sops.nix +++ b/nixos/system/packages/sops/sops.nix @@ -14,7 +14,7 @@ sops.age.keyFile = "/home/${userSettings.username}/.config/sops/age/keys.txt"; - sops.secrets."zenith/password-hash" = { + sops.secrets."${userSettings.hostname}/password-hash" = { neededForUsers = true; }; diff --git a/nixos/system/settings/default-applications.nix b/nixos/system/settings/default-applications.nix index c87b384..7fd53c1 100644 --- a/nixos/system/settings/default-applications.nix +++ b/nixos/system/settings/default-applications.nix @@ -19,6 +19,7 @@ DEFAULT_BROWSER = "${pkgs."${userSettings.browser}"}/bin/${userSettings.browser}"; TERMINAL = "${pkgs."${userSettings.terminal}"}/bin/${userSettings.terminal}"; EDITOR = "${pkgs."${userSettings.editor}"}/bin/${userSettings.editor}"; + FLAKE = "/home/${userSettings.username}/.dotfiles"; }; # Default applications configuration